This is a TradingView Pinescript Indicator that I would like to run on ProRealTime in a separate pane and be able to adjust the EMA length please:
study(title=”Volume Based Buy and Sell Momentum by 2tm”, shorttitle=”VBSM”)
EMA_Len = input(25, title=”Lenth”, minval=1)
xROC = roc(close, 1)
nRes1 = iff(volume < volume[1], nz(nRes1[1], 0) + xROC, nz(nRes1[1], 0))
nRes2 = iff(volume > volume[1], nz(nRes2[1], 0) + xROC, nz(nRes2[1], 0))
nRes3 = nRes1 + nRes2
nResEMA3 = sma(nRes1, EMA_Len) + sma(nRes2, EMA_Len)
PNVI = plot(nRes3, color=blue, title=”PVI + NVI”)
PEMA = plot(nResEMA3, color=red, title=”EMA”)
pCol = nRes3 > nResEMA3 ? blue : red
fill (PNVI, PEMA, pCol)