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

[amibroker] MACD divergence



PureBytes Links

Trading Reference Links




 <FONT 
face="Times New Roman">
ST33=MACD<FONT 
size=2>();
bars=50<FONT face=Verdana 
size=2>;<FONT 
face="Times New Roman">
TR1=LLVBars<FONT 
size=2>(ST33,5<FONT 
face="Times New Roman">);<FONT 
face="Times New Roman">
COND1=TR1>0 AND <FONT 
size=2>Ref(TR1,-<FONT 
size=2>1)==0 AND 
Ref(ST33,-<FONT 
size=2>1)<0<FONT 
face=Verdana size=2>;<FONT 
color=#0000ff>
TR2=IIf<FONT 
size=2>(COND1,Ref(ST33,-<FONT 
size=2>1),0<FONT face=Verdana 
size=2>);<FONT 
face=Verdana size=2><FONT 
face="Times New Roman">
Plot(st33,"MACD"<FONT 
size=2>,1,<FONT 
size=2>1<FONT 
face="Times New Roman">);<FONT 
face="Times New Roman">
M1=ValueWhen<FONT 
face=Verdana size=2>(COND1,ST33);<FONT 
color=#0000ff>
P1=ValueWhen<FONT 
size=2>(COND1,LLV(L,<FONT 
size=2>3<FONT 
face="Times New Roman">));<FONT 
face="Times New Roman">
DM1=M1-Ref<FONT 
size=2>(M1,-1);DP1=P1-<FONT 
size=2>Ref(P1,-1<FONT 
face=Verdana size=2>);<FONT 
color=#0000ff>
DT=Ref(<FONT 
size=2>BarsSince(COND1),-<FONT 
size=2>1<FONT 
face="Times New Roman">);<FONT 
face="Times New Roman">
POSDIV=DM1>0 AND 
DP1<0 AND DT<BARS;<FONT 
size=2>Plot(<FONT 
size=2>Ref(POSDIV*Ref<FONT 
size=2>(ST33,-1),<FONT 
size=2>1),""<FONT 
size=2>,5,<FONT 
size=2>2<FONT 
face="Times New Roman">);<FONT 
face="Times New Roman">
TR11=HHVBars<FONT 
size=2>(ST33,5<FONT 
face="Times New Roman">);<FONT 
face="Times New Roman">
COND11=TR11>0 AND <FONT 
size=2>Ref(TR11,-<FONT 
size=2>1)==0 AND 
Ref(ST33,-<FONT 
size=2>1)>0<FONT 
face=Verdana size=2>;<FONT 
color=#0000ff>
TR21=IIf<FONT 
size=2>(COND11,Ref(ST33,-<FONT 
size=2>1),0<FONT 
face=Verdana size=2>);<FONT 
color=#0000ff>
M11=ValueWhen<FONT 
face=Verdana size=2><FONT 
face="Times New Roman">(COND11,ST33);<FONT 
face="Times New Roman">
P11=ValueWhen<FONT 
size=2>(COND11,HHV(H,<FONT 
size=2>3<FONT 
face="Times New Roman">));<FONT 
face="Times New Roman">
DM11=M11-Ref<FONT 
size=2>(M11,-1);DP11=P11-<FONT 
size=2>Ref(P11,-1<FONT 
face=Verdana size=2>);<FONT 
color=#0000ff>
DT1=Ref(<FONT 
size=2>BarsSince(COND11),-<FONT 
size=2>1<FONT 
face="Times New Roman">);<FONT 
face="Times New Roman">
NEGDIV=DM11<0 AND 
DP11>0 AND DT1<BARS;<FONT 
size=2>Plot(NEGDIV*ST33,<FONT 
size=2>"",4<FONT 
size=2>,2<FONT 
face="Times New Roman">);
Filter=posdiv OR 
negdiv;<FONT 
face="Times New Roman">
AddColumn(posdiv,"POSITIVE 
DIV",1.0<FONT face=Verdana 
size=2>);<FONT 
face=Verdana size=2>
AddColumn(NEGDIV,"NEGATIVE 
DIV",1.0<FONT face=Verdana 
size=2>);
 
Paste in indicator 
builder or in AA and explore .
For the N100 
database, 13/100 of the population presented a bullish MACD divergence on 
March13, signaling the recent movement.
Another version of MACD divergence may come through 
trendlines.
There are some code problems, trendlines are based on 
Peak/Trough , which do not function properly with negative arrays.
We may overcome this difficulty using a 1000+MACD() instead of 
MACD() itself [I think the lowest MACD() for the last 10 years
was around -800 for ^N225]. I have to check some details for a 
uniform per= value and post this alternative too. 
 
 






Yahoo! Groups Sponsor


  ADVERTISEMENT









Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



Attachment:
MACDdiv.gif

Attachment: Description: "Description: GIF image"