Hi All
I am trying to create a ROC indicator, but for some reason, it doesn't get displayed, the code is below
As long as I comment out RateOfChange = 100 * ROC / PrevClose;, it starts showing something, for example, I can change it and display ROC.
What is the problem here?
Always check the Experts tab for errors.
In this case you will probably see a zero divide error.
PrevClose = iClose(Symbol(), 0, i + n_Period);
Make sure that this doesn't give an array out of range error.
Always check the Experts tab for errors.
In this case you will probably see a zero divide error.
Make sure that this doesn't give an array out of range error.
PrevClose = iClose(Symbol(), 0, i + n_Period);
We don't know what values you are using for i or n_Period.
But i + n_Period must be less than rates_total or you will get the array out of range error.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi All
I am trying to create a ROC indicator, but for some reason, it doesn't get displayed, the code is below
As long as I comment out RateOfChange = 100 * ROC / PrevClose;, it starts showing something, for example, I can change it and display ROC.
What is the problem here?