MACD histogram code with color green and red

Viny

New Member
#1
Hey Guys,
I wondering if anyone have MACD histogram with green and red color code please.
I have try few code from google but most of then is getting me error and also i am not a programmer.

Kind Regards
Viny
 

suri112000

Well-Known Member
#2
Hey Guys,
I wondering if anyone have MACD histogram with green and red color code please.
I have try few code from google but most of then is getting me error and also i am not a programmer.

Kind Regards
Viny
Here you go

copy the code paste in amibroker editor and save it as macd histogram.

/*-----------------------------------------------------------
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 );
 

suri112000

Well-Known Member
#4
Dear suri112000,
Thank you for your post and the code but i am using Metastock pro 11.
Thanks
Oh.......you should be clear about software when you ask thing.....:D
 

Similar threads