Stochastic Oscillator¶
Difficulty beginner
Definition¶
The Stochastic Oscillator compares a closing price to its price range over a given period. It's based on the observation that in uptrends, prices tend to close near their highs, and in downtrends, near their lows.
Calculation¶
%K = (Current Close - Lowest Low over n) / (Highest High over n) × 100
%D = SMA(%K, m) (typically m=3)
Default parameters: n=14, m=3
where:
Current Closemost recent closing price ·Lowest Low over nminimum low across the lastnbars ·Highest High over nmaximum high across the same window ·%Kraw stochastic value on a 0–100 scale showing where the close sits inside the range ·%Dm-period SMA of%K, the signal line ·n / mlookback and signal-smoothing periods. does: measures the close's position within the recent high-low range — closes near the top push%Ktoward 100, closes near the bottom toward 0. Range-bound traders take longs on%Kcrossing above%Dwhile both are below 20, shorts on the reverse above 80, and watch divergence between price and%Kto anticipate reversals. In strong trends the oscillator can pin at the extreme — pair with a trend filter so signals are taken only with the dominant bias.
Types¶
| Type | %K | %D |
|---|---|---|
| Fast | Raw %K | SMA of Fast %K |
| Slow | SMA of Fast %K | SMA of Slow %K |
| Full | Custom smoothed %K | SMA of Full %K |
Slow Stochastic is most commonly used (reduces whipsaws).
Trading Signals¶
Overbought/Oversold¶
Above 80 = Overbought
Below 20 = Oversold
Entry Long: %K crosses above 20 (exiting oversold)
Entry Short: %K crosses below 80 (exiting overbought)
Crossover¶
Bullish: %K crosses above %D (especially in oversold zone) Bearish: %K crosses below %D (especially in overbought zone)
Divergence¶
Same concept as RSI divergence — price makes new extreme but stochastic doesn't confirm.
Stochastic RSI¶
where:
RSIcurrent RSI value ·Min(RSI) / Max(RSI)rolling minimum and maximum of RSI over the lookback window ·StochRSInormalized in [0, 1], indicating where RSI sits inside its own recent range. does: stacks the stochastic transformation on top of RSI — first RSI compresses price into momentum, then the stochastic step compresses momentum into a fast 0–1 oscillator that frequently touches both extremes. Traders use it like a turbocharged stochastic for short-horizon mean-reversion (buy<0.2, sell>0.8) and read%K/%Dcrossovers as entry triggers, accepting that the extra sensitivity produces more false signals in strong trends — best paired with a trend filter on a higher timeframe.
Practical Guidelines¶
- Trending Markets — Stochastic stays overbought/oversold in strong trends
- Best in Ranges — Most reliable in sideways markets
- Combine with Trend — Only take signals in trend direction
- %D is Smoother — %D crosses are more reliable than %K crosses
- Failure Swings — Similar to RSI, can signal reversals
Next Steps¶
- Volume Analysis — Confirming signals
- MACD — Complementary momentum indicator