Range not behaving as expected - page 3

 
William Roeder #:
First define your maximum lookback.
int lookback = ... // iMA(period) has look back of period.
                        // buffer[i+2] has look back of 2 (as TimeSeries)
                        // buffer[i-2] has look back of 2 (not TimeSeries)
                       // use maximum of all.
Old way, counting down as a TimeSeries
New way, counting down as a TimeSeries (Bars always equals rates_total so can be substituted.)

Returning rates_total-1 makes prev_calculated the same as IndicatorCounted().

Alternatively if you return rates_total then must decrement prev_calculated if non-zero at the beginning of On_Calculate to recalculate the current bar.

Always count down so you're not using future values.

New way, counting up, not a TimeSeries.
Always count up so you're not using future values.
sorry . but i dont understand currectly .. can you explain more ????? pleaseeee.
 
William Roeder #:
New way, counting down as a TimeSeries, but not through bar zero.
This can be used to not cover newest bars, or can be used to update the indicator in steps, e.g. 1000-900, 899-799, ... 99-0, 0...

Thank you.. i have no idea how reading 2k bars is much more faster now!! really appreciate bro! :D

Reason: