My System - My trades.

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();
 
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();
Use code tags to post the AFL...
Code:
_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();
This will remove the copy/ paste error if any...
 
MBJI,please rename the second macd as 4,12. applying the afl yoou posted the title says 36,200 for both....
Thanks to Ankur07090
Code:
r1 = 36;
r2 = 200;
//r3 = 9;
Plot( ml = MACD(r1, r2), StrFormat(_SECTION_NAME()+"(%g,%g)", r1, r2), colorRed , styleThick );
mid=0;
Plot(mid,"mid", colorWhite ,styleLine);

r1 = 4;
r2 = 12;

Plot( m2 = MACD(r1, r2), StrFormat(_SECTION_NAME()+"(%g,%g)", r1, r2), colorYellow , styleThick );
 

Similar threads