No bar 0 is the newest or current one and the highest number is the oldest bar.
- www.mql5.com
- www.mql5.com
I read them... I just can't connect that info to what I see in the debug output. Even the bit that the doc says that time[0] should be the newest one, but in the screen I posted above you see that it's the other way round.
By the way, the doc you linked says:
Arrays passed
to the function reflect price data, i.e.
these arrays have the sign of a timeseries and function ArrayIsSeries() will
return true when checking these arrays.
But the first thing I call in OnCalculate is:
bool as_ser1 = ArrayGetAsSeries(time); bool as_ser2 = ArrayGetAsSeries(open);
and both values are false contrary to what the doc says

Hello all,
I have trouble understanding the basic concept of bar indexes.
From what I see, bar with index 0 is the oldest one on the chart.
The current one has index:
rates_total - 1
I was trying to use iBarShift, but it seems to give me opposite results? This is what confuses me. In the example below time[0] is the oldest time available. But
Gives a big number... Then calling it again with time[1] will give a smaller number. The code below runs in a M15 chart.
Could you help?
I'm trying to get a hang on iBarShift as an indicator I want to develop depends on data from 3 different time intervals.
Cheers!