//@version=4 study(title="Stochastic", shorttitle="Stoch", format=format.price, precision=2, resolution="") periodK = input(14, title="K", minval=1) periodD = input(3, title="D", minval=1) smoothK = input(3, title="Smooth", minval=1) k = sma(stoch(close, high, low, periodK), smoothK) d = sma(k, periodD) plot(k, title="%K", color=#0094FF) plot(d, color=change(d) >= 0 ? color.lime : color.red, linewidth=2) h0 =