Hello all,
I am looking for a MACD with colour on the bars. So if one bar is lower than the previous, then it would be a different shade colour. If it raises above the previous bar, then the colour would go back to the original shade. The same goes for the bars below the base line (0 line). I have found one here, which I downloaded, but the data it displays does not match the MACD on the prorealtime platform. Can anyone refer one to me?
Thanks in advance.
Thank you JC_Bywan. That is the one I found earlier, but the data shows different to the default on the platform. Is there a way to correct this?
I see, yes, that’s because it’s a histogram display of the “macdline”, you want the classic macd histogram. No problem, it can be easily adapted as follows to display the modified histogram instead:
fast = 12
slow = 26
signalP = 9
myMACDline=exponentialaverage[fast]-exponentialaverage[slow]
signal=exponentialaverage[signalP](myMACDline)
myMACD=myMACDline-signal
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", myMACDline coloured(0,255,255) style(line) as "MACD line"
I corrected a typo in the last line of code of my previous message, more or less at the same time as you posted, so it might be worth refreshing the topic with ctrl+F5 to make sure you have used the edited correct version.
Thanks. Much appreciated.