Help convert Metastock to AFL

#1
Hello,

I'm looking for an AFL equivalent to this Metastock code:

Dave's New System (DNS)

If(SAR(.02,.2)<C,1,0) +
If((Mov(C,5,E)>Mov(C,13,E)),1,0) +
If((Mov(C,13,E)>Mov(C,40,E)),1,0) +
If((Mov(C,8,E)-Mov(C,17,E))> (Mov(Mov(C,8,E)-Mov(C,17,E),9,E)),1,0) +
If(Mov(C,50,SIMPLE) - Ref(Mov(C,50,SIMPLE),-15)> 0,1,0) +
If((Mov(ROC(C,12,%),3,E)>=-6 OR ROC(C,12,%)>0),1,0)+
If(OBV()>Mov(OBV(),40,S),1,0) +
If(V>Mov(V,120,S),1,0)

Essentially, it evaluates a series of conditions and creates a "score" which is then graphed. Any suggestions?

Thanks in advance!
 

extremist

Well-Known Member
#2
hopefully it satisfies ur need.



DNS=
IIf(SAR(.02,.2)<C,1,0) +
IIf((EMA(C,5)>EMA(C,13)),1,0) +
IIf((EMA(C,13)>EMA(C,40)),1,0) +
IIf((EMA(C,8)-EMA(C,17))>(EMA(EMA(C,8)-EMA(C,17),9)),1,0)+
IIf(MA(C,50) -Ref(MA(C,50),-15) > 0,1,0)+
IIf((EMA(ROC(C,12),3)>=-6 OR ROC(C,12)>0),1,0)+
IIf(OBV()>MA(OBV(),40),1,0)+
IIf(V>MA(V,120),1,0);

Plot (DNS,"\n DNS : " ,ParamColor( "DNS Color", colorWhite ), ParamStyle("DNS Style",styleLine,maskAll));

Plot(3,"",colorLightGrey,styleDashed);
Plot(5,"",colorLightGrey,styleDashed);
Plot(8,"",colorLightGrey,styleDashed);
 
#3
Hi extremist

please clarify if we can plot price and SAR on the same chart along with DAN

It seems it is not possible as chart becomes unreadable mix of lines and price goes out of visible zone.

any hints,please share
regards
ford
 

Similar threads