Hi BBCTrader
If you have the "Multi-Frame D EMA" indicator installed and set with the appropriate options (13 weeks etc.) then the following code should provide you with a starting point. Each block of signals is truncated and only the first TRUE is allowed to pass. You can get this indicator at...
http://www.metastocktips.co.nz/multi_frame_d_ema.txt
{Buy}
K:=Fml("Multi-Frame D EMA");
J:=FmlVar("Multi-Frame D EMA","J");
Buy:=K>ValueWhen(2,J,K) AND C>Mov(C,13,E);
Buy AND Alert(Buy=0,2);
{Sell}
Sell:=C<Mov(C,13,E);
Sell AND Alert(Sell=0,2);
{Sell Short}
K:=Fml("Multi-Frame D EMA");
J:=FmlVar("Multi-Frame D EMA","J");
Short:=K<ValueWhen(2,J,K) AND C<Mov(C,13,E);
Short AND Alert(Short=0,2);
{Buy to Cover}
Cover:=C>Mov(C,13,E);
Cover AND Alert(Cover=0,2);
Regards, Roy