please convert this MS code to AFL

mmca2006

Active Member
#1
Requesting AFL experts to convert this MS code to AFL, I want to plot the BUY and SELL condition as ribbon. Just convert the long condition , I will try to do the rest.



Code:
[B]Enter Long[/B]=

a:=(H-Mov(C,13,E))>0-(L-Mov(C,13,E));
b:=(L-Mov(C,13,E))<0-(H-Mov(C,13,E));

state:=If(BarsSince(a)<BarsSince(b),1,0);

state>Ref(state,-1)


[B]Enter Short[/B]=


a:=(H-Mov(C,13,E))>0-(L-Mov(C,13,E));
b:=(L-Mov(C,13,E))<0-(H-Mov(C,13,E));

state:=If(BarsSince(a)<BarsSince(b),1,0);

state<Ref(state,-1)



[B]Exit Long[/B]=

a:=(H-Mov(C,13,E))>0-(L-Mov(C,13,E));
b:=(L-Mov(C,13,E))<0-(H-Mov(C,13,E));

state:=If(BarsSince(a)<BarsSince(b),1,0);

state<Ref(state,-1)

[B]Exit Short[/B]=

a:=(H-Mov(C,13,E))>0-(L-Mov(C,13,E));
b:=(L-Mov(C,13,E))<0-(H-Mov(C,13,E));

state:=If(BarsSince(a)<BarsSince(b),1,0);

state>Ref(state,-1)
 

Similar threads