I have 2 series hist and RSI from time 10 to 257. I want to create a dummy variable shade that is equal to 1 if hist(t)<0 and hist(t-1)>0 and RSI(t)>=60
It is also equal to 1 if hist(t)<0 and hist(t-1)>0 and RSI(t-1) >=60. When I run the program nothing gets recorded. I presume I did not set up correctly the if-block ****
Could you correct what I wrote.
do t=10,257
if hist(t)<0 {
if hist(t-1)>0 {
if RSI(t) >=60 {
com shade(t)=1.0
}
****** if RSI(t-1) >=60 {
com shade(t) = 1.0
}
}
}
else {
com shade(t)=0
}
end do t
