Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 10/29/2004(UTC) Posts: 1,394 Location: Glastonbury, CT
Was thanked: 2 time(s) in 2 post(s)
|
sma1:=Mov(C,140,S);
sma2:=Mov(C,10,S);
a:=If(C>Max(sma1,sma2),1,If(C<Min(sma1,sma2),-1,0));
{Long entry signal} a=1 and Ref(A,-1)<1
sma1:=Mov(C,140,S);
sma2:=Mov(C,10,S);
a:=If(C>Max(sma1,sma2),1,If(C<Min(sma1,sma2),-1,0));
{Short entry signal} a=-1 and Ref(A,-1)>-1
sma1:=Mov(C,140,S);
sma2:=Mov(C,10,S);
a:=If(C>Max(sma1,sma2),1,If(C<Min(sma1,sma2),-1,0));
{Long exit signal} a=0 and Ref(A,-1)=1
sma1:=Mov(C,140,S);
sma2:=Mov(C,10,S);
a:=If(C>Max(sma1,sma2),1,If(C<Min(sma1,sma2),-1,0));
{Short exit signal} a=0 and Ref(A,-1)=-1
the system is designed to trade long when the close is above the higher of the 2 sma's, exit long when the close crosses below one of the sma's, goes short when the close is below the minimum of the 2 sma's and exits short when the close crosses above the lowest sma.
this system has an advantage over a simple cross over system, it filters out noisy trades by trading with a trend
|