Sorry Kumudhan ji i saw your post late. This is the afl for macd.
_SECTION_BEGIN("MACD1");
r1 = Param( "Fast avg", 36, 2, 200, 1 );
r2 = Param( "Slow avg", 200, 2, 200, 1 );
Plot( ml = MACD(r1, r2), StrFormat(_SECTION_NAME()+"(%g,%g)", r1, r2), ParamColor("MACD color", colorRed ), ParamStyle("MACD style") );
Buy= Cross(ml , 0);
Sell= Cross( 0 , ml);
PlotShapes( Buy * shapeUpArrow + Sell * shapeDownArrow, IIf( Buy, colorGreen, colorRed ) );
_SECTION_END();
r3 = Param( "Fast avg", 4, 2, 200, 1 );
r4 = Param( "Slow avg", 12, 2, 200, 1 );
Plot(k = MACD(r3, r4), StrFormat(_SECTION_NAME()+"(%g,%g)", r3, r4), ParamColor("MACD color", colorGreen ), ParamStyle("MACD style") );
Buy=Cross(k,0);
Sell=Cross(0,k);
PlotShapes( Buy * shapeUpArrow + Sell * shapeDownArrow, IIf( Buy, colorYellow, colorYellow ) );
_SECTION_BEGIN("macd with color");
Plot(0, "0", colorBlueGrey );
_SECTION_END();