Forums › ProRealTime English forum › ProBuilder support › BarIndex = 0 › Reply To: BarIndex = 0
11/21/2019 at 10:25 AM
#113293
No, BarIndex is needed.
BarIndex is the very first bar when you load an indicator or a strategy. In your case you need it to start the HA sequence.
If you have instructions to be executed only when your code is loaded and not the next candles, well… BarIndex is what you need.
IntraDayBarIndex is another constant that returns 0 when it’s the first intraday bar of the day.
IntraDayBarIndex restarts from zero each new day, while BarIndex starts from 0 when you first execute your code and ALWAYS increases.