ktuimala

KT_Smooth_Stochastic

I normally don't publish my indicators. However, I couldn't find a smoothed stochastic on TradingView officially or unofficially. This is a standard implementation of a smoothed Fast Stochastic where %K and %D are calculated and then smoothed by n periods. This helps to reduce chop and gives better extreme signals.

I have defaulted the indicator to use commonly used settings where %K is over 14 periods, %D is over 7 period, and the smoothing factor is 3 periods. I have also defaulted the extreme lines to an upper band of 80, mid band of 50, and lower band of 20. However, my favorite settings are %K = 10, %D = 10, Smooth = 3, upper band = 75, mid band = 50, and lower band = 25.
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?
// Title: Smooth Stochastic
// Author: Kaleb Tuimala
// Date: 06/25/2016
//
// Description: A standard implementation of a smoothed Fast Stochastic.
//              The %K and %D are smoothed n periods after they are calculated.
//
//@version=2
study(title="KT_Smooth_Stochastic", shorttitle="Smooth Stochastic")
periodK = input(14, minval=1, title="%K")
periodD = input(7, minval=1, title="%D")
smooth = input(3, minval=1, title="Smooth")

k = stoch(close, high, low, periodK)
d = sma(k, periodD)

sK = sma(k, smooth)
sD = sma(d, smooth)

uL = hline(80, color=black, linestyle=solid, linewidth=2, title="Upper Line")
mL = hline(50, color=green, linestyle=solid, linewidth=2, title="Middle Line")
lL = hline(20, color=purple, linestyle=solid, linewidth=2, title="Lower Line")

fill(uL, lL, color=gray, transp=80, title="Shaded Region")

plot(sK, color=blue, linewidth=2, title="%K")
plot(sD, color=red, linewidth=2, title="%D")