Quantcast
Channel: Traderji.com
Viewing all articles
Browse latest Browse all 10287

troubles with IIF functions

$
0
0
dear all,
please, help me with this problem.
I want the array 'trial' = 10 from the bar 10 till to the end.

this my attempt:
trial=1;
trial =IIf (BarIndex()==10, 10, Ref(trial,-1));


it happens that just the bar 10 is = 10. But from the 11th bar till to the end the value of 'trial' array is =1 :confused:


Maybe the problem come from the first row, where I initialize the array. It is read for each bar, so each time is deleted the value assigned with IIF function.

So the question is: how can I iniziatialize the array 'trial' just one time avoiding the same row is read at each bar?.

thank you

Cippo

Viewing all articles
Browse latest Browse all 10287

Trending Articles