//PRC_MACD Platinum indicator 29.09.2016
//Nicolas @ www.prorealcode.com Sharing ProRealTime knowledge
EMAshort1 = exponentialaverage[short](close)
EMAshort2 = exponentialaverage[short](EMAshort1)
DifferenceShort = EMAshort1 - EMAshort2
ZeroLagShort = EMAshort1 + DifferenceShort
EMAlong1 = exponentialaverage[long](close)
EMAlong2 = exponentialaverage[long](EMAlong1)
DifferenceLong = EMAlong1 - EMAlong2
ZeroLagLong = EMAlong1 + DifferenceLong
ZeroLagMACD = ZeroLagShort - ZeroLagLong
signal1=ExponentialAverage[signal](ZEROLAGMACD)
signal2=ExponentialAverage[signal](signal1)
DIFFERENCE2=signal1-signal2
SignalMACD=signal1+DIFFERENCE2
if signalMACD>=zerolagMACD then
r=255
g=0//69
b=55//0
else
r=0//54
g=255//224
b=72//208
endif
//drawbarchart(signalMACD,zerolagMACD,signalMACD,zerolagMACD) coloured(r,g,b)
if zerolagMACD crosses over signalMACD or zerolagMACD crosses under signalMACD then
drawtext("●",barindex,signalMACD,Dialog,Bold,25) coloured(r,g,b)
endif
RETURN ZeroLagMACD style(line,4) as "Zero Lag MACD", ZeroLagMACD style(point ,5 ) as "Zero Lag MACD", 0 as "zero line"
// Variables :
// short = 12
// long = 26
// signal = 9