I saw this code on tradingview that I am trying to ode in prorealcode without luck. Please help
//@version=4
study(“Chart Traders: PivotBoss – Oscillator”, overlay=false)
shortPEMA = input(8)
medPEMA = input(13)
longPEMA = input(21)
smaPeriods = input(1)
fPivot = hlc3
fPEMADiff1 = (ema(fPivot, shortPEMA) – ema(fPivot, longPEMA))
fPEMADiff2 = (ema(fPivot, medPEMA) – ema(fPivot, longPEMA))
fPEMADiff3 = (ema(fPivot, shortPEMA) – ema(fPivot, medPEMA))
fPEMASep = ((fPEMADiff1 + fPEMADiff2 + fPEMADiff3) / fPivot) * 5
fPSepSMA = sma(fPEMASep, smaPeriods)
col = if fPEMASep > 0 and fPEMASep > fPEMASep[1]
color.gray
else
if (fPEMASep < fPEMASep[1]) or (fPEMASep < 0 and fPEMASep < fPEMASep[1])
color.red
else
if fPEMASep > fPEMASep[1]
color.gray
else
color.new(color.black, 100)
plot(fPEMASep, title=”PEMASep”, color=col, linewidth=3, style=plot.style_columns)
plot(fPSepSMA, title=”PSepSMA”, color=color.gray, linewidth=2)
plot(0, title=”ZERO”)