Color MACD Histogram Changes for Amibroker (AFL)
kaiji over 16 years ago Amibroker (AFL)
Use on weekly charts to determine Trend Changes. If the Weekly Bars are Green check the daily bars for LONG entries, if the Weekly Bars on Red check the daily for SHORT entires.
By MTR Investors Group
Indicator / Formula
Copy & Paste Friendly
/*-----------------------------------------------------------
MTR Investors Group - www.MTRIG.com
Color MACD Histogram Bars. Use on weekly chart to determine
market trend. See Elder "Come into my trading room"
-------------------------------------------------------------*/
r1 = Param( "Fast avg", 12, 2, 200, 1 );
r2 = Param( "Slow avg", 26, 2, 200, 1 );
r3 = Param( "Signal avg", 9, 2, 200, 1 );
ml = MACD(r1, r2);
sl = Signal(r1,r2,r3);
Hist = ml-sl;
MACUP = Hist > Ref(Hist,-1);
MACDN = Hist < Ref(Hist,-1);
BarColor = IIf(MACUP,colorGreen,IIf(MACDN,colorRed,colorBlue));
//Plot( Hist, "MACD Histogram", ParamColor("Histogram color", colorBlack ), styleNoTitle | ParamStyle("Histogram style", styleHistogram | styleNoLabel, maskHistogram ) );
Plot( Hist, "MACD Histogram", BarColor , styleHistogram );
Plot(0, "0", colorBlueGrey );0 comments
Leave Comment
Please login here to leave a comment.