STOCHF
STOCHF
Summary
Fast Stochastic Oscillator: the raw %K line and its moving-average-smoothed %D line. Unlike STOCH (which slows both lines), STOCHF returns the unsmoothed FastK and FastD. Oscillates 0-100; >80 overbought, <20 oversold.
Formula
FastK = 100 * (Close - LowestLow) / (HighestHigh - LowestLow), over the last FastK_Period bars (incl. today)
FastD = MA(FastK, FastD_Period, FastD_MAType)
Notes
- When the high-low range over the window is zero, %K is set to 0 instead of being undefined.
Inputs
inHigh— High price of each barinLow— Low price of each barinClose— Close price of each bar
Outputs
outFastK— Raw %K stochastic lineoutFastD— MA-smoothed %K (signal line)
Parameters
| Parameter | Type | Default | Accepted values | Description |
|---|---|---|---|---|
optInFastK_Period | integer | 5 | 1–100000 | Lookback window for the highest-high/lowest-low of Fast-K |
optInFastD_Period | integer | 3 | 1–100000 | Smoothing period for the Fast-D line |
optInFastD_MAType | MAType | SMA (0) | any MAType | Moving-average type used to smooth Fast-D |
MAType values: 0 SMA · 1 EMA · 2 WMA · 3 DEMA · 4 TEMA · 5 TRIMA · 6 KAMA · 7 MAMA · 8 T3 · 9 HMA · 10 DISABLED
Properties
Numerical Stability: Depends on MA Type — This function's default, SMA, is start-independent.
| Display Flags |
|---|
| ☐ Overlap Input |
| ✅ Independent Y-Axis i |
| ☐ Candlestick |
Implementation
TA-Lib Definition: stochf.c · stochf.yaml
| Native | File |
|---|---|
| C | ta_STOCHF.c |
| Rust | stochf.rs |
| Java | Core_STOCHF.java |
TA-Lib is also available for Python, R and more using a wrapper.
Aliases
Stochastic Fast, Fast Stochastic Oscillator