Array out of range in (1962,24) - page 2

 
Alain Verleyen:
No it don't, as if tic is 0, the loop is not executed. (I didn't check the original code, only what you posted).

Yes that is true.

I just read his is about BO.

This problem is better left unsolved.

This array out of range is actually a feature that prevents a capital loss in this case.
 

Thanks a lot for all of your supports..

this actually solved it.. and saved me lots of time

before...

    int limit = MathMin(iBars(_sm, _Timeframe) - 1, _lts);
  for (shift = limit; shift > 1; shift--)
    {


    }

after...

  



int limit = MathMin(iBars(_sm, _Timeframe) - 1, _lts);
for (shift = limit-1; shift >= 1; shift--) { }
Reason: