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.
Skrip sumber terbuka

Dalam semangat TradingView yang sebenar, penulis skrip ini telah menerbitkannya dengan menggunakan sumber terbuka supaya pedagang-pedagang dapat memahami dan mengesahkannya. Sorakan kepada penulis! Anda dapat menggunakannya secara percuma tetapi penggunaan semula kod ini dalam penerbitan adalah dikawalselia oleh Peraturan Dalaman. Anda boleh menyukainya untuk menggunakannya pada carta.

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.

Ingin menggunakan skrip ini pada carta?
// 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")