iCCIOnArray function issues

Post Reply
premiernc
Posts: 2
Joined: Fri Dec 28, 2012 7:37 pm

iCCIOnArray function issues

Post by premiernc »

Hey Guys,
My first post. I have been working on a few different multi timeframe indicators and have not been able to use the ONArray functions with any success.
Below is the code snipits for my array creation and the comparison.

When I Alert out the values of both arrays they area identical.
When I alert out the values of the CCI calculations, they are way different.
I have scoured the internet for anyone who has used these function successfully but have yet to find anyone. Am I extracting the data incorrectly from the iCCIOnArray function? Is there any way to see the actual source code of the iCCIOnArray function so I can see exactly what it is doing?
Thanks a million for any help in advance.


ArraySetAsSeries(my_array,false); //used both true and false


double a=iCCIOnArray(my_array,WHOLE_ARRAY,14,1);
double b=iCCI(NULL,0,14,PRICE_CLOSE,1);


//Building my_array
for(int a=(Bars-1);a>1;a--)
my_array[a]=Close[a];// I know it should be HLC/3 but I have tested all iterations
garyfritz

Re: iCCIOnArray function issues

Post by garyfritz »

This ArraySetAsSeries() nightmare is a particularly ugly area of MQL -- it gives me fits every time I'm foolish enough to wade into it. :?

Try looking at George's posts here and here and see if those spark any insights...
User avatar
fxdaytrader
Trader
Posts: 190
Joined: Sun Jun 10, 2012 7:03 am
Location: Poon-Town (germany, se-asia, se-europe) ...

Re: iCCIOnArray function issues

Post by fxdaytrader »

Maybe you should use ArrayResize also? I am not sure, the array-stuff is very confusing for me.
But, nevertheless, ist seems that the array stuff in my indicator here is working, perhaps it helps you. Have look to theattachment in my post here
premiernc
Posts: 2
Joined: Fri Dec 28, 2012 7:37 pm

Re: iCCIOnArray function issues

Post by premiernc »

Hey Guys,
Thanks for the fast replies. It seems something is very strange with the OnArray functions in MQL4.
I have a good grasp on using arrays but still do not get the expected results. I suppose unless you have a copy of the source code of the functions, there will never be a clear answer. I like what was said in one of the other posts that George put up, I might be better off building a brand new CCI that is built to use my arrays rather than messing with the iCCIOnArray function. Seems like a bunch of work but I am in the process now. I will update and share when done or update if I find any answers.

Glad I found a forum that is MQL4 and people are still around.
Thanks a million guys.
Post Reply

Return to “Coders Hangout”