Hi, I can't understand why e and maxmacd have different values. They should be equal.
Can someone help me?:(
study(My Script
)
a = input(26, title=slow average
)
b = input(12, title=fast average
)
c = input(9, title=Macd average
)
slow_average=ema(close,a)
fast_average=ema(close,b)
Macd=fast_average-slow_average
aMacd=ema(Macd,c)
var float maxmacd=0
if crossunder(Macd,aMacd)
maxmacd:=highest(high,5)
e=valuewhen(crossunder(Macd,aMacd),highest(high,5),0)
plot(maxmacd)
plot(e)