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"