Hi guys, anybody who could advice how to work with specific candle from past, pls?
I am able to find it with loop(first 3 lines of code below), but after I want work more with it, but its not possible use neither t nor h in those brackets [] as those are variables and just constats are permited..any solution??
def t= fold y= 2 to 7 with p=1 while((open[y]>lov && close[y]>lov) or (open[y]<lov && close[y]<lov) or (open[y]>up && close[y]>up) or (open[y]<up && close[y]<up) ) do P+1;
def h= if(t==7) then 0 else t;
#check more details of found candle/error here : just constants permited
def kandle= if(open[h]>close[h] && close[h]<lov) then -1 else 1;
I am able to find it with loop(first 3 lines of code below), but after I want work more with it, but its not possible use neither t nor h in those brackets [] as those are variables and just constats are permited..any solution??
def t= fold y= 2 to 7 with p=1 while((open[y]>lov && close[y]>lov) or (open[y]<lov && close[y]<lov) or (open[y]>up && close[y]>up) or (open[y]<up && close[y]<up) ) do P+1;
def h= if(t==7) then 0 else t;
#check more details of found candle/error here : just constants permited
def kandle= if(open[h]>close[h] && close[h]<lov) then -1 else 1;