I am new to TradingView Pine scripting. I am seeking for help with a pine script which is on version 2 right now but I am trying convert it into Version 5 and is having so many compilation errors. I would really appreciate any help. Thank you all in advance.
//@version=2
study(title="test", shorttitle="Positive")
EMA_Len = input(255, minval=1)
xROC = roc(close, 1)
nRes = iff(volume > volume[1], nz(nRes[1], 0) + xROC, nz(nRes[1], 0))
nResEMA = ema(nRes, EMA_Len)
plot(nRes, color=red, title="PVI")
plot(nResEMA, color=blue, title="EMA")