Contents
- abs
- add
- all_time_high
- all_time_low
- and
- approx
- aroon_down
- aroon_osc
- aroon_up
- atr
- bb_lower
- bb_upper
- bb_width
- cci
- change
- cond
- count
- cross
- crossover
- crossunder
- cumsum
- days_since
- dev
- deviation
- div
- ema
- eq
- falling
- floordiv
- gain
- gt
- gte
- highest
- highest_bars_ago
- hma
- kc_lower
- kc_middle
- kc_upper
- kcw
- loss
- lowest
- lowest_bars_ago
- lt
- lte
- macd_histogram
- macd_line
- macd_signal
- max
- mean
- median
- mfi
- min
- mod
- mom
- months_since
- mul
- ne
- obv
- offset
- or
- pct_change
- percentrank
- pivothigh
- pivotlow
- pow
- range
- rising
- roc
- rsi
- sma
- sqrt
- stdev
- stoch_d
- stoch_k
- streak
- sub
- sum
- swma
- true_range
- universe_percentile
- variance
- vwma
- weeks_since
- wilderma
- williams_r
- wma
- years_since
No matches
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