pinescript
//version=5
indicator("Stochastic Oscillator", overlay=false)
kLength = input.int(14, title="K Length")
dSmoothing = input.int(3, title="D Smoothing")
kValue = ta.stoch(close, high, low, kLength)
dValue = ta.sma(kValue, dSmoothing)

plot(kValue, title="%K", color=color.blue, linewidth=2)
plot(dValue, title="%D", color=color.red, linewidth=2)
hline(80, "Overbought", color=color.green)
hline(20, "Oversold", color=color.red)
Trend Analysis

Aviso legal