The MACD color histogram indicator is the classic MACD but with histogram coloured according to their directions : converging or diverging.
This indicator has been coded by a request on French forum.
The colours could modified by changing the Red, Green and Blue values in the code.
MACD settings are external variables and may be changed according to your needs.
//PRC_MACD color histogram | indicator
//03.04.2017
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
//translated from MT4 code
// --- settings
//fast = 12
//slow = 26
//signalP = 9
// --- end of settings
myMACD=exponentialaverage[fast]-exponentialaverage[slow]
signal=exponentialaverage[signalP](myMACD)
if myMACD>0 then
if myMACD>myMACD[1] then
r=0
g=100
b=0
else
r=255
g=69
b=0
endif
else
if myMACD>myMACD[1] then
r=50
g=205
b=50
else
r=255
g=0
b=0
endif
endif
RETURN myMACD coloured(r,g,b) style(histogram) as "MACD histogram", signal coloured(255,0,255) style(line,2) as "signal line", myMACD coloured(0,255,255) style(line) as "MACD line"
You must be logged in to post a comment.
Hello, I was looking for a MACD Histogram with red and green bars according to the value of the previous bar and not only if above/below zero, thus I installed your version on Prorealtime. However it behaves completely different from the normal MACD.installed your MACD but it behaves completely different form the plain MACD. Can you help?
Hi, it's great to have this option of having a histogram coloured based on rising or falling slope... but i have the same question as leo above from 6 years ago... this macd has very very different signals from the standard macd ??? Would be great if someone could clarify how to get this to behave the same way as the standard macd. Merci beaucoup :-)