Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*****************************************
- KH_MACD
- created by KelvinHand in 2012 Oct 6th
- MACD Option:
- * Classic 2 lines
- * MT4 Style
- *****************************************/
- _SECTION_BEGIN("KH_MACD");
- SetChartBkGradientFill( ParamColor("BgTop", colorBlack),ParamColor("BgBottom", colorBlack), colorBlack);
- iOpt = ParamList("MACD Option", "Classic|MT4", 1);
- cMACD = ParamColor("MACD Color", colorWhite);
- cSig=ParamColor("Signal color", colorRed );
- fastEMA = Param( "Fast EMA", 12, 1, 200, 1 );
- slowEMA = Param( "Slow EMA", 26, 1, 200, 1 );
- SigSMA = Param( "MACD SMA", 9, 1, 200, 1 );
- iMACD=EMA(C, fastEMA) - EMA(C,slowEMA);
- iSignal=MA(iMACD,SigSMA);
- Plot( iSignal, "", cSig, styleThick|styleNoLabel);
- _N(Title = StrFormat("MACD(%g, %g, %g) %g, %g", fastEMA, slowEMA, SigSMA, iMacd, iSignal));
- switch (iOpt)
- {
- case "MT4":
- Plot( iMACD, "", cMACD, styleThick|styleHistogram|styleNoLabel);
- break;
- default:
- Plot( iMACD, "", cMACD, styleThick|styleNoLabel);
- break;
- }
- Plot( 0, "", colorGrey40, styleNoLabel);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement