Replace
roc[i]=iClose(NULL,0,i)/iClose(NULL,0,i+m);to
if(iClose(NULL,0,i+m)!=0)roc[i]=iClose(NULL,0,i)/iClose(NULL,0,i+m);else roc[i]=1;
Roger:
Replace
to
It does work.
Thank a lot.
crazywoo:
It does work.
Thank a lot.
Problem is in the for loops. They should be like this:
for (i=0;i<Bars-m; i++)

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I wrote the code like this:
There is only one line for "roc" showed in the chart, and the other one is missing.
but,if I change the code like this:
and both two lines are appeared in the chart.
Why the first code doesn't work at all?
I am so confused