MACD with BB for Amibroker (AFL)
jahan999 about 16 years ago Amibroker (AFL)
MACD with Bollinger Bands at the top and bottom. To define high and low range for the MACD
Screenshots
Indicator / Formula
Copy & Paste Friendly
_SECTION_BEGIN("MACD");
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " +WriteVal( V, 1.0 ) +" {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 )) ));
SetChartBkColor( ParamColor("background",colorBlack) );
A2 = Param("EMA1",12,200,1,0);
A3 = Param("EMA2",26,200,1,0);
A1=EMA(C,A2)-EMA(C,A3);
BBtop=BBandTop(A1,10,1);
BBbot=BBandBot(A1,10,1);
Color=IIf(a1<0 AND a1>Ref(a1,-1), colorLime,IIf(a1>0 AND a1>Ref(a1,-1),colorBrightGreen,IIf(a1>0 AND a1<Ref(a1,-1),colorCustom16,colorRed)));
Plot(a1,"MACD",color,styleDots+styleLine);
Plot(BBtop,"BBtop",colorDarkGreen,styleDashed);
Plot(BBbot,"BBbot",colorDarkRed,styleDashed);
Plot(0,"",31,1);
_SECTION_END();0 comments
Leave Comment
Please login here to leave a comment.