stoch_d
Stochastic %D (Slow Stochastic - MA of %K)
stoch_d(k_period, d_period, matype="sma")
Parameters
| Name | Type | Description |
|---|---|---|
k_period |
int | Period for %K calculation |
d_period |
int | Period for smoothing %K into %D |
Formula
%D = MA(stoch_k(k_period), d_period)
Examples
stoch_d(14, 3); # Standard slow stochastic
stoch_d(5, 3); # Fast stochastic
stoch_d(14, 3, matype="ema"); # EMA-smoothed %D
k = stoch_k(14); d = stoch_d(14, 3); k > d; # Bullish crossover
Returns
float
Range
k_period must be 2-400; d_period is bound by matype's MA family: 2-210 ema, 2-105 wilder, or 2-400 windowed sma/wma (default)
Notes
Smoother than %K with fewer false signals; %K crossing above/below %D is a bullish/bearish signal, using the same 80/20 overbought/oversold levels
See Also
References
TradingView: ta.stoch() returns [k, d]; developed by George Lane