Hi.
I just discovered that all functions of indicator on array such as iRSIonArray, iCCIonArray, iMAonArray etc, show different results if run from Expert advisor.
I write small code, as indicator, then copy/paste it to Expert Advisor and got wrong results.
http://www.forexfactory.com/attachme...1&d=1324246683
this is the code. Run it once as EA then as Custom Indicator, and see the difference...
I wonder what might cause the values to fail when running the same code by Expert Advisor?
If anyone familiar with this type of issue, please hint me of how to overcome this strange issue.
I just discovered that all functions of indicator on array such as iRSIonArray, iCCIonArray, iMAonArray etc, show different results if run from Expert advisor.
I write small code, as indicator, then copy/paste it to Expert Advisor and got wrong results.
http://www.forexfactory.com/attachme...1&d=1324246683
this is the code. Run it once as EA then as Custom Indicator, and see the difference...
PHP Code
double tempArray[][6];
double Array_eurusd[1500];
ArrayCopyRates(tempArray,"EURUSD",PERIOD_H1);
for(int i=0;i<1500;i++)
Array_eurusd[i]=tempArray[i][4]; //Get close price
ArraySetAsSeries(Array_eurusd,true);
double irsi=iRSI("EURUSD",PERIOD_H1,14,PRICE_CLOSE,0);
double irsiOnArray=iRSIOnArray(Array_eurusd,1500,14,0);
Comment("Function iRSI= "+irsi+"\n"+
"Function iRSIOnArray= "+irsiOnArray);
If anyone familiar with this type of issue, please hint me of how to overcome this strange issue.
Attached Image