так должна выглядеть формула:
study(title="Stoch-RSI")
band1 = hline(20)
band0 = hline(80)
fill(band1, band0, color=purple,transp=90)
smoothK = input(3, minval=1)
smoothD = input(3, minval=1)
lengthRSI = input(14, minval=1)
lengthStoch = input(14, minval=1)
src4 = input(close, title="RSI Source")
rsi1 = rsi(src4, lengthRSI)
k = sma(stoch(rsi1, rsi1, rsi1, lengthStoch), smoothK)
d = sma(k, smoothD)
plot(k, color=blue)
plot(d, color=red)
h0 = hline(80, linestyle=dotted)
h1 = hline(20, linestyle=dotted)