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.
开源脚本

本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?
// 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")