+91-0000000000

}

Monday – Friday : 9:00 AM – 6:30 PM

Indicator Macd Colour

This Amibroker AFL, known as Indicator Macd Colour, enhances the visual representation of the MACD indicator by assigning specific colors to different MACD components like the MACD line, signal line, or histogram. It utilizes historical price data obtained from an Amibroker data feed to calculate the MACD values. 

/_SECTION_BEGIN("MACD");
r1 = Param( "Fast avg", 12, 2, 200, 1 );
r2 = Param( "Slow avg", 26, 2, 200, 1 );
r3 = Param( "Signal avg", 9, 2, 200, 1 );
Plot( ml = MACD(r1, r2), StrFormat(_SECTION_NAME()+"(%g,%g)", r1, r2), ParamColor("MACD color", colorRed ), ParamStyle("MACD style") );
Plot( sl = Signal(r1,r2,r3), "Signal" + _PARAM_VALUES(), ParamColor("Signal color", colorBlue ), ParamStyle("Signal style") );
Plot( ml-sl, "MACD Histogram", ParamColor("Histogram color", colorBlack ), styleNoTitle | ParamStyle("Histogram style", styleHistogram | styleNoLabel, maskHistogram ) );


_SECTION_END();


if(StrToNum(NumToStr(MA( C, 3 )> MA(C,15))))bgColor = ColorRGB(0,66, 2);
else bgColor = ColorRGB(66,2, 0);
SetChartBkGradientFill( colorBlack, bgColor); 






Buy= Cross(ml,sl );
Sell=Cross(sl,ml);
shape = Buy * shapeUpArrow+ Sell * shapeDownArrow;
PlotShapes( shape, IIf( Buy, colorBrightGreen, colorRed ), 0, IIf( Buy, sl,sl ) );

Open chat
1
Hi, how can I help you?