/*-----------------------------------------------------------
MTR Investors Group -
www.MTRIG.com
Color MACD Histogram Bars. Use on weekly chart to determine
market trend. See Elder "Come into my trading room"
-------------------------------------------------------------*/
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, "Banknifty Booster", BarColor , styleHistogram );
Plot(0, "0", colorBlueGrey );