Bars is the count of bars, the first bar's index is zero, that means the last bar's index is Bars-1 You start your loop from Bars, there is no bar with that index.
SDC:
Bars is the count of bars, the first bar's index is zero, that means the last bar's index is Bars-1 You start your loop from Bars, there is no bar with that index.
Thank you for your reply SDC.
Bars is the count of bars, the first bar's index is zero, that means the last bar's index is Bars-1 You start your loop from Bars, there is no bar with that index.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Hey guys,
I am new to this forum and I have a question about this code:
I get an "Array out of range" error. This is not my code. I managed to get it working by editing the for loop to count upwards.
I am just curious why the author of this code decided to code the for loop in this way, and why is it now producing an array out of range error. Please advise.