MACD histogram color

mortenso

New Member
Joined
Jan 20, 2008
Messages
15
Likes
0
#1
Is it possible to color the MACD histogram bars red when above zero and green when below zero.

I am able to color the price bars based on MACD by creating an Expert Advisor. But how do I color the MACD histogram bars?
 
Last edited:

mortenso

New Member
Joined
Jan 20, 2008
Messages
15
Likes
0
#2
Anyone know for if color coding of indicators on a general basis is possible in Metastock. I have done this in AmiBroker, but I can't figure out how to do it in Metastock.
 

alferns

New Member
Joined
Mar 13, 2010
Messages
6
Likes
6
Location
Bangalore
#3
Also if someone could throw some light on how to color the rising histogram bars green and falling bars red.

This will be beneficial for other oscillators too.
 

THE LORD

Active Member
Joined
Nov 22, 2008
Messages
198
Likes
79
#4
'have very nice trading

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);
dd= Signal(r1,r2,r3);
ColorT=IIf(ml>0 AND ml>Ref(ml,-1),colorRed,colorGreen);
Plot(ml-dd ,"MACD Histogram",ColorT,styleHistogram|styleThick);
Plot(0,"",colorWhite,styleLine+styleThick);
 

alferns

New Member
Joined
Mar 13, 2010
Messages
6
Likes
6
Location
Bangalore
#6
Thank you Mortenso.

As you rightly said we need Metastock Code for coloring MACD Histogram bars!!

I'm trying another thread also on the same subject, if I get the answer I'll put it over here.
 

aryan.

Active Member
Joined
Mar 27, 2010
Messages
527
Likes
203
Location
Pune
#7
Also if someone could throw some light on how to color the rising histogram bars green and falling bars red.

This will be beneficial for other oscillators too.
Search google colored macd histogram metastock. You will find plently of links.
 
Joined
Aug 3, 2010
Messages
50
Likes
17
#9
This is the AmiBroker AFL code.
The question is how to do it in Metastock.

create 2 indicator

indicator 1:

If(Mov(C,12,E)-Mov(C,26,E)-Mov(Mov(C,12,E)-Mov(C,26,E),9,E)<0,Mov(C,12,E)-Mov(C,26,E)-Mov(Mov(C,12,E)-Mov(C,26,E),9,E),0)


========
indicator 2:

If(Mov(C,12,E)-Mov(C,26,E)-Mov(Mov(C,12,E)-Mov(C,26,E),9,E)>0,Mov(C,12,E)-Mov(C,26,E)-Mov(Mov(C,12,E)-Mov(C,26,E),9,E),0)

========
put both in same window. set color 1 for red, color 2 for blue

you can make this idea with volume and anything, have fun
 

Similar threads

Broker Special Offers