Stochastic
Where the close sits in the recent high-low range.
indicator("Stochastic", shorttitle="Stoch", precision=2)
periodK = input.int(14, "%K length", minval=1)
smoothK = input.int(1, "%K smoothing", minval=1)
periodD = input.int(3, "%D smoothing", minval=1)
k = ta.sma(ta.stoch(close, high, low, periodK), smoothK)
d = ta.sma(k, periodD)
plot(k, "%K", linewidth=2)
plot(d, "%D")
top = hline(80, "Upper band")
bottom = hline(20, "Lower band")
fill(top, bottom, color.new(color.violet, 92))