Indicator calculation loops and the start index
When an indicator first loads, prev_calculated is 0 on the firs execution. On subsequent calls, prev_calculated holds the number of bars that were processed in the previous execution. So when the indicator has has calculated more than one bar, prev_calculated – 1 can be accepted as the last processed bar and is an efficient starting…