NA in "if" statement
Posted: Wed Oct 13, 2010 12:59 pm
I'm trying to assign +1 values to a 'trade' series when my 'res' (=residual) series is greater than standard deviation (=s) and -1 when my 'res' series less than negative standard deviation
if res>s then
series trade=1
else
if res<-s then
series trade=-1
endif
endif
but getting a message "NA found in matrix IF RES>S then"
Is there a way to avoid the NA message?
if res>s then
series trade=1
else
if res<-s then
series trade=-1
endif
endif
but getting a message "NA found in matrix IF RES>S then"
Is there a way to avoid the NA message?