Rank: Advanced Member
Groups: Registered, Registered Users, Unverified Users Joined: 9/13/2004(UTC) Posts: 673 Location: Salt Lake City, UT
|
There's a few ways you can deal with this. You can use the following examples below to see if this will work. Note that you are supposed to put your own formulas in place of the formulas below, and you must include these formulas for each symbol of an expert advisor.
2 state:
bc:=Cross(C,Mov(C,20,S)){buy signal condition}; sc:=Cross(Mov(C,20,S),C){sell signal condition}; trade:=If( bc=1, 1, If(sc=1, 0, PREV)); cross( trade= x, 0.5)
3 state:
bc:=C > Mov(C,20,S)+1{enter long condition}; be:=Cross(Mov(C,20,S),C){close long condition}; sc:=C < Mov(C,20,S)-1{enter short condition}; se:=Cross(C,Mov(C,20,S)){close short condition}; trade:=If( bc=1, 1, If(sc=1, -1, If((be AND PREV=1) OR (se AND PREV=-1),0,PREV))); Cross( trade= x, 0.5)
|