// Downloaded From https://www.WiseStockTrader.com
_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();