For function backwards

 

Hi all,

I am using the following function:

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

This is to make calculation on the 10 last bars. Unfortunately the indicator I am developping should start counting at bar i=10 and finish on bar i=0, and the above function does that backwards (start at i=0 and ends at i=10)

I tried to write the following instead : for(i=10;i<0;i--)

But the indicator is not showing anything that way.

Any clue if it is right to write for(i=0;i<10;i++) ? or can anyone give me a hint on that ?

many thx.

 
Nevermind, I used the When function, worked fine the way I wanted.
Reason: