The only case that I can think of your code returning the error would be if it was altered so that iBarShift calculates with a different timeframe.
I meant if
iBarShift(NULL, 0, focusedDate)
was altered to
iBarShift(NULL, PERIOD_H4, focusedDate)
or any other timeframe where the returned shift is larger than the Bars on the current chart
I see... no, it is not related to this problem, in my case it appears on M1 every time. More likely it is because the i-functions are using different data sets than the arrays (snapshots from different times). I just like to avoid problems caused by mixing them, but any information about data management is lacking.
Ovo:
More likely it is because the i-functions are using different data sets than the arrays (snapshots from different times).
While I can't offer you any insight, I did have strong suspicions of this when exploring the problem I posted about the other day (connected and history updated)... results were inconclusive, but it seemed iTime() took longer to update than Time[] even when passing the current chart period to iTime().
More likely it is because the i-functions are using different data sets than the arrays (snapshots from different times).
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 sometimes (thought rarely) receive "array out of range error" in the following code:
which leads me to a question, whether someone has explanation. Perhaps Time[focusedIndex] and iBarShift() work with different chart buffers, and may go out of sync, who knows.
And perhaps iTime() is the only one consistent with the iBarShift(). If there is a difference between Time[] and iTime(), I may be in need of large fixes throughout my entire code.