src=input(close, title="RSI Source")
rsi1=ta.rsi(src, 14)
k=ta.sma(ta.stoch(rsi1, rsi1, rsi1, 14), 3)
d=ta.sma(k, 3)
I've tried converting this into Ninjascript with this, but keep getting errors
OnBarUpdate
-----
//RSI
double rsi = RSI(14, 3)[0];
//Stoch
stoch[0] = Stochastics(rsi, 14, 14, 3)[0];
//Stochastics
k[0] = SMA(stoch, 3)[0];
d[0] = SMA(k, 3)[0];
Before I keep trying to fix any error that appears. Is this even the correct way of doing it?

Comment