Rank: Advanced Member
Groups: Registered, Registered Users, Unverified Users Joined: 9/13/2004(UTC) Posts: 673 Location: Salt Lake City, UT
|
Here are a couple formulas you may find useful. You would want to substitute your own formulas into the fields.
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)
You will need to change the Trade=X, in the above formulas to Trade= 1, Trade= -1, or Trade= 0, depending on the condition you are defining.
|