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

Re: [amibroker] developing code for finding divergences



PureBytes Links

Trading Reference Links

It's not a perfect code but better than nake eyes.
 

//MACD-Price divergence, by D. Tsokakis

ST33=MACD();bars=100;d=5;

TR1=LLVBars(ST33,d);

COND1=TR1>0 AND Ref(TR1,-1)==0 AND Ref(ST33,-1)<0;

TR2=IIf(COND1,Ref(ST33,-1),0);

Plot(st33,"MACD",1,8);

M1=ValueWhen(COND1,ST33);

P1=ValueWhen(COND1,LLV(L,3));

DM1=M1-Ref(M1,-1);DP1=P1-Ref(P1,-1);

DT=Ref(BarsSince(COND1),-1);

POSDIV=DM1>0 AND DP1<0 AND DT;

Plot(POSDIV*LastValue(Lowest(ST33)),"",5,2);

TR11=HHVBars(ST33,d);

COND11=TR11>0 AND Ref(TR11,-1)==0 AND Ref(ST33,-1)>0;

TR21=IIf(COND11,Ref(ST33,-1),0);

M11=ValueWhen(COND11,ST33);

P11=ValueWhen(COND11,HHV(H,3));

DM11=M11-Ref(M11,-1);DP11=P11-Ref(P11,-1);

DT1=Ref(BarsSince(COND11),-1);

NEGDIV=DM11<0 AND DP11>0 AND DT1;

Plot(NEGDIV*LastValue(Highest(ST33)),"",4,2);

GraphXSpace=5;



traderix2003 <d.adam@xxxxxxx> wrote:

Hi everybody.
I would like to trade a system based on divergences.                
Has any trader developped a code for finding divergences??
divergence between price and MACD and STO

Thank you  Traderix





Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html




Do you Yahoo!?
The all-new My Yahoo! – Get yours free!

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html



Yahoo! Groups Sponsor

Get unlimited calls to

U.S./Canada



Yahoo! Groups Links