[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Metastock's formula into AFL



PureBytes Links

Trading Reference Links


Can someone please 
convert this Metastock's formula into AFL - Thanks
ENTER LONG wcan:= C > 
O; MACD() > Mov(MACD(), 9, E) AND C > O AND O < L+(H-L) *0.5 
AND ((C/O) - 1) * 100 >=1 AND Sum(wcan,2) <=1 
 
CLOSE LONG wcan:= C > 
O; buyprice:= ValueWhen(1, MACD() > Mov(MACD(),9,E) AND C > O AND 
O < L + (H-L) * 0.5 AND ((C/O) - 1) * 100 >=1 AND Sum(wcan,2) < = 1,C); 
 cond1:= MACD() < Mov(MACD(),9,E); cond2:= (C/buyprice 
>= 0 AND BarsSince(MACD() > Mov(MACD(),9,E) AND C > O AND O < 
L+(H-L)*0.5 AND ((C/O)-1)*100 >= 1 AND Sum(wcan,2) <= 1) >= 17); 
 cond1 OR cond2 
 
ENTER 
SHORT        
bcan:=C<=O;        
cond1:=MACD()<Mov(MACD(),9,E);        
cond1 AND bcan=1 AND C<L+(H-L)*0.2 AND Sum(bcan,3)<=1
 
CLOSE SHORT
 
        
bcan:=C<=O;        
cond1:=MACD()>Mov(MACD(),9,E);        
sellprice:=ValueWhen(1,cond1 AND bcan=1 AND C<L+(H-L)*0.2 AND 
Sum(bcan,3)<=1,C);        
cond2:=(sellprice>=0 AND BarsSince(cond1 AND bcan=1 AND C<L+(H-L)*0.2 AND 
Sum(bcan,3)<=1)>=50);        cond1 
OR cond2
 

Thanks 
Peter