Stock Portfolio Organizer
The ultimate porfolio management solution.
Shares, Margin, CFD's, Futures and Forex
EOD and Realtime
Dividends and Trust Distributions
And Much More ....
WiseTrader Toolbox
#1 Selling Amibroker Plugin featuring:
Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
Macd with buy sell arrow credit to orginal owner for Amibroker (AFL)
Copy & Paste Friendly
Back
_SECTION_BEGIN("MACD1");
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 ) );
Buy= Cross(ml , sl);
Sell= Cross( sl, ml);
PlotShapes( Buy * shapeUpArrow + Sell * shapeDownArrow, IIf( Buy, colorGreen, colorRed ) );
_SECTION_END();
_SECTION_BEGIN("macd with color");
r1 = Param( "Fast avg", 12, 2, 200, 1 );
r2 = Param( "Slow avg", 26, 2, 200, 1 );
r3 = Param( "Signal avg", 9, 2, 200, 1 );
ml = MACD(r1, r2);
sl = Signal(r1,r2,r3);
Hist = ml-sl;
MACUP = Hist > Ref(Hist,-1);
MACDN = Hist < Ref(Hist,-1);
BarColor = IIf(MACUP,colorGreen,IIf(MACDN,colorRed,colorBlue));
//Plot( Hist, "MACD Histogram", ParamColor("Histogram color", colorBlack ),
styleNoTitle | ParamStyle("Histogram style", styleHistogram | styleNoLabel,maskHistogram );
Plot( Hist, "MACD Histogram", BarColor , styleHistogram );
Plot(0, "0", colorBlueGrey );
_SECTION_END();