Indicator calculation backwards

 

Hello,

I want to draw an old saved value on indicator,

therefore I have to calculate the indicator-loop backwards and not as normal:

for(i=0;i<limit;i++)

I tried it like that

for(i=limit;i<0;i--)

but it doesn't work.

Any idea??

Thank you!

 

for(i=limit;i>0;i--)

 

Thank you, but it doesn't work.

I want to programm something like that:

  for(i=limit,y=0;i>0;i--)
   {
   
      if (Time[i]<TimeArray[y]) y++;  
  
      double value0 =iCustom(NULL,TimeFrame,"BBands Stops",Length,Deviation,MoneyRisk,Signal,Line,Nbars,0,y); 

  ...

   } 

Can you see the mistake?

Reason: