using stock variables
Posted: Tue May 06, 2014 3:45 pm
Chris,
I am interested developing a market timing strategy. I use data from HGSI. I have a list of the entire NYSE plus the NYSE index ($NYA), Stock Advances ($ADVN), and Stock Declines ($DECN), that are also part of this list. The script below generates an error. The script is my buy signal which is the following; first condition (gate1) is if the stock has increased at least 3%; the second test is to determine if the symbol is $NYA, or $ADVN, or $DECN, these symbols should not trigger a buy.
PCTCHG:= 100 * (C - REF(C, 1)) / REF(C, 1);
gate1:=if(PCTCHG>3,1,0);
gate2:=if(STKLABEL="$NYA",1,0);
gate3:=if(STKLABEL="$ADVN",1,0);
gate4:=if(STKLABEL="$DECN",1,0);
gate5:=if(gate2+gate3+gate4>0,2,0);
result:=if(gate1+gate5=1,1,0)
event:if(result=1,1,0);
I believe STKLABEL is expecting a variable type symbol and I have passed a string. Please help.
Regards,
John.
I am interested developing a market timing strategy. I use data from HGSI. I have a list of the entire NYSE plus the NYSE index ($NYA), Stock Advances ($ADVN), and Stock Declines ($DECN), that are also part of this list. The script below generates an error. The script is my buy signal which is the following; first condition (gate1) is if the stock has increased at least 3%; the second test is to determine if the symbol is $NYA, or $ADVN, or $DECN, these symbols should not trigger a buy.
PCTCHG:= 100 * (C - REF(C, 1)) / REF(C, 1);
gate1:=if(PCTCHG>3,1,0);
gate2:=if(STKLABEL="$NYA",1,0);
gate3:=if(STKLABEL="$ADVN",1,0);
gate4:=if(STKLABEL="$DECN",1,0);
gate5:=if(gate2+gate3+gate4>0,2,0);
result:=if(gate1+gate5=1,1,0)
event:if(result=1,1,0);
I believe STKLABEL is expecting a variable type symbol and I have passed a string. Please help.
Regards,
John.