Could you please add buy/sell signal as per picture (
http://s22.postimg.org/67yf8s8u9/MACD.jpg) for auto analysis on following afl, thanks in advance.
/*****************************************
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);
K = Plot(MACD(),"MACD",colorGrey40,styleThick| styleOwnScale);
Plot( Volume, "Volume", IIf( C > O, ParamColor("Up Color", colorYellow ), ParamColor("Down Color", colorBlack ) ), ParamStyle( "Style", styleHistogram | styleThick | styleLeftAxisScale, maskHistogram ) );
Title = EncodeColor(colorWhite) + Name() +
EncodeColor(colorBlue)+ " KRA Line= "+ EncodeColor(colorYellow)+ WriteVal(K,format=1.2) ;