Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 9/8/2004(UTC) Posts: 2,266
Was thanked: 1 time(s) in 1 post(s)
|
Take a look at the second to last post for the exact setup.
http://forum.equis.com/v...hp?t=226&highlight=state
Take a look at this formula for an example :
{Enter Long}
BullTrend:=Cross(Mov(C,5,S),Max(Mov(C,10,S),Mov(C,20,S)));
BearTrend:=Cross(Min(Mov(C,10,S),Mov(C,20,S)),Mov(C,5,S));
Trend:=If(BarsSince(Ref(BullTrend,-1))<BarsSince(Ref(BearTrend,-1)),1,-1);
EnterLong:=Trend=1 AND Cross(Stoch(14,3),25);
ExitLong:=Trend=1 AND Cross(75,Stoch(14,3));
EnterShort:=Trend=-1 AND Cross(75,Stoch(14,3));
ExitShort:=Trend=-1 AND Cross(Stoch(14,3),25);
Status:=If(EnterLong,2,If(EnterShort,-2,If(ExitLong,1,If(ExitShort,-1,PREV))));
EL:=Cross(Status,1.5);
XL:=Cross(1.5,Status) AND Ref(Status,-1)=2;
ES:=Cross(-1.5,Status);
XS:=Cross(Status,-1.5) AND Ref(Status,-1)=-2;
EL
{Exit Long}
BullTrend:=Cross(Mov(C,5,S),Max(Mov(C,10,S),Mov(C,20,S)));
BearTrend:=Cross(Min(Mov(C,10,S),Mov(C,20,S)),Mov(C,5,S));
Trend:=If(BarsSince(Ref(BullTrend,-1))<BarsSince(Ref(BearTrend,-1)),1,-1);
EnterLong:=Trend=1 AND Cross(Stoch(14,3),25);
ExitLong:=Trend=1 AND Cross(75,Stoch(14,3));
EnterShort:=Trend=-1 AND Cross(75,Stoch(14,3));
ExitShort:=Trend=-1 AND Cross(Stoch(14,3),25);
Status:=If(EnterLong,2,If(EnterShort,-2,If(ExitLong,1,If(ExitShort,-1,PREV))));
EL:=Cross(Status,1.5);
XL:=Cross(1.5,Status) AND Ref(Status,-1)=2;
ES:=Cross(-1.5,Status);
XS:=Cross(Status,-1.5) AND Ref(Status,-1)=-2;
XL
{Enter Short}
BullTrend:=Cross(Mov(C,5,S),Max(Mov(C,10,S),Mov(C,20,S)));
BearTrend:=Cross(Min(Mov(C,10,S),Mov(C,20,S)),Mov(C,5,S));
Trend:=If(BarsSince(Ref(BullTrend,-1))<BarsSince(Ref(BearTrend,-1)),1,-1);
EnterLong:=Trend=1 AND Cross(Stoch(14,3),25);
ExitLong:=Trend=1 AND Cross(75,Stoch(14,3));
EnterShort:=Trend=-1 AND Cross(75,Stoch(14,3));
ExitShort:=Trend=-1 AND Cross(Stoch(14,3),25);
Status:=If(EnterLong,2,If(EnterShort,-2,If(ExitLong,1,If(ExitShort,-1,PREV))));
EL:=Cross(Status,1.5);
XL:=Cross(1.5,Status) AND Ref(Status,-1)=2;
ES:=Cross(-1.5,Status);
XS:=Cross(Status,-1.5) AND Ref(Status,-1)=-2;
ES
{Exit Short}
BullTrend:=Cross(Mov(C,5,S),Max(Mov(C,10,S),Mov(C,20,S)));
BearTrend:=Cross(Min(Mov(C,10,S),Mov(C,20,S)),Mov(C,5,S));
Trend:=If(BarsSince(Ref(BullTrend,-1))<BarsSince(Ref(BearTrend,-1)),1,-1);
EnterLong:=Trend=1 AND Cross(Stoch(14,3),25);
ExitLong:=Trend=1 AND Cross(75,Stoch(14,3));
EnterShort:=Trend=-1 AND Cross(75,Stoch(14,3));
ExitShort:=Trend=-1 AND Cross(Stoch(14,3),25);
Status:=If(EnterLong,2,If(EnterShort,-2,If(ExitLong,1,If(ExitShort,-1,PREV))));
EL:=Cross(Status,1.5);
XL:=Cross(1.5,Status) AND Ref(Status,-1)=2;
ES:=Cross(-1.5,Status);
XS:=Cross(Status,-1.5) AND Ref(Status,-1)=-2;
XS
Patrick :mrgreen:
|