.

Bollinger Band MACD Triple Indicator - Amibroker AFL Code

Click Image To Enlarge. Please Rate And Comment.

Bollinger Band MACD Triple Indicator

_SECTION_BEGIN("MACD");
r1 = Param( "Fast avg", 3, 3, 30, 1 );
r2 = Param( "Slow avg", 11, 5, 35, 1 );
r3 = Param( "Signal avg", 16, 3, 30, 1 );
ml = MACD(r1, r2);
sl = Signal(r1,r2,r3);
Hst = ml-sl;
Color = IIf (Hst > Ref(Hst,-1),colorBlue,colorRed);

//Plot( ml = MACD(3, 11), StrFormat(_SECTION_NAME()+"(%g,%g)", r1, r2), ParamColor("MACD color", colorRed ), ParamStyle("MACD style") );
//Plot( sl = Signal(3,11,16), "Signal" + _PARAM_VALUES(), ParamColor("Signal color", colorBlue ), ParamStyle("Signal style") );
Plot( Hst, "MACD Histogram",  color , styleThick  );
bbtop = BBandTop( Hst, 9, 1 );
bbbot = BBandBot( Hst, 9,1 );
Plot( BBandTop( Hst, 10, 1 ), "BBTop", colorYellow, styleDashed ); 
Plot( BBandBot( Hst, 10,1 ), "BBBot", colorYellow, styleDashed ); 

Buy = Cross (Hst,bbtop);
//Sell = Cross (bbtop,Hst);
Short = Cross (bbbot,Hst);
//Cover = Cross (Hst,bbbot);
Sell = Short;
Cover = Buy;
PlotShapes (Buy*shapeUpArrow,colorYellow);
PlotShapes (Short*shapeDownArrow,colorYellow);
//PlotShapes (Sell*shapeHollowSmallDownTriangle,colorRed);
//PlotShapes (Cover*shapeHollowSmallUpTriangle,colorGreen);

Plot(6, "ribbon", Color, styleOwnScale| styleArea|styleNoLabel,-0.5,100);
_SECTION_END();
Previous Post Next Post