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

RE: [amibroker] Re: MACD-Price divergence, by D. Tsokakis



PureBytes Links

Trading Reference Links

Hi,
 Macd divergence:
---------------------------------------------------------------------------------

alex huynh <ahuynh7@xxxxxxxxx> wrote:

//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; here DT<BARS

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;here DT1<BARS

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

GraphXSpace=5;

---------------------------------------------------------------------------------------------------
 

## MACD-DIVERGENCE:## D.Tsk.

ST33=MACD();

bars=50;

TR1=LLVBars(ST33,5);

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

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

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

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<BARS;Plot(Ref(POSDIV*Ref(ST33,-1),1),"",5,2);

TR11=HHVBars(ST33,5);

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<BARS;Plot(NEGDIV*ST33,"",4,2);

Filter=posdiv OR negdiv;

AddColumn(posdiv,"POSITIVE DIV",1.0);

AddColumn(NEGDIV,"NEGATIVE DIV",1.0);

 

GraphXSpace=5;

 

------------------------------------------

 

MACD-DIVERGENCE:

//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",colorSkyblue,styleLine);

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<BARS;

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<BARS;

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

 

Filter=posdiv OR negdiv;

AddColumn(posdiv,"POSITIVE DIV",1.0);

AddColumn(NEGDIV,"NEGATIVE DIV",1.0);

 

GraphXSpace=5;

-----------------------------------


Ken Henderson <kjh@xxxxxxxxxxxxxxx> wrote:

Hi

 

The code for the above indicator was recently posted.  Unfortunately, I deleted it before having a proper look.

 

Could someone please retransmit this code to me please.

 

Many thanks

 

Ken





Warm regards,
Natasha !
 
Visit The Doll Palace [Where Cartoon Dolls Live]


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 Links

GIF image