Can somebody please help in converting this Metastock Code to Tradestation Easy Language.
It is basically a trend following system. The code generates a buy/sell on breakout above/below the 20 days range. For the exit/sar it plots the trailing stop loss.
Regards & Thanks in advance
Amar
--------
no:=Input("Swing/ Bars", 1, 20, 2);
res:=HHV(H,no);
sup:=LLV(L,no);
avd:=If(C>Ref(res,-1),1,If(C<Ref(sup,-1),-1,0));
avn:=ValueWhen(1,avd<>0,avd);
tsl:=If(avn=1,Ref(sup,-1),Ref(res,-1));
tsl;
It is basically a trend following system. The code generates a buy/sell on breakout above/below the 20 days range. For the exit/sar it plots the trailing stop loss.
Regards & Thanks in advance
Amar
--------
no:=Input("Swing/ Bars", 1, 20, 2);
res:=HHV(H,no);
sup:=LLV(L,no);
avd:=If(C>Ref(res,-1),1,If(C<Ref(sup,-1),-1,0));
avn:=ValueWhen(1,avd<>0,avd);
tsl:=If(avn=1,Ref(sup,-1),Ref(res,-1));
tsl;