The stochastic oscillator shows where the latest close sits within the recent high–low range. Readings near 100 or 0 describe closes at the edge of that range, which a strong trend can sustain for many sessions.
What the stochastic oscillator measures
The stochastic oscillator, developed by George C. Lane in the late 1950s, measures where the latest close falls within the range between the highest high and the lowest low of a lookback, usually 14 sessions. A reading of 100 means the close is at the top of that range, 0 means it is at the bottom and 50 means it is in the middle.
| Property | Stochastic oscillator |
|---|---|
| Inputs | Daily highs, lows and closes |
| Common settings | 14, 3 and 3: the lookback, the %K smoothing and the %D smoothing |
| Scale | 0 to 100 |
| Common reference levels | 80 and 20 |
| Lines | %K and its average, %D |
| First values | %K after 14 sessions; each 3-session average needs 2 more |
Lane’s observation was that in an advance closes tend to settle near the top of the recent range, and in a decline near the bottom. The oscillator turns that observation into a number. It ignores how far price moved from one session to the next and looks only at position within the range.
Stochastic oscillator calculation
The main line, %K, is a ratio of two distances: from the lowest low to the close, and from the lowest low to the highest high.
%K = (close − lowest low) ÷ (highest high − lowest low) × 100
%D = 3-session simple moving average of %Klowest low, highest high- The lowest session low and the highest session high of the last n sessions, including the current one; usually n = 14.
Because the current session is part of the window, its own high and low count. The close can never be above the highest high or below the lowest low, so %K always stays between 0 and 100.
Edge case: if the highest high equals the lowest low, every session in the window traded at a single price and the denominator is 0. %K is undefined for that session. Software that shows a number is applying its own convention, such as 50 or the previous reading, not the formula.
%K and %D explained
%K is the position of the close; %D is its 3-session average. %D moves more smoothly and lags %K, so the two lines cross whenever %K turns sharply enough.
When %K is above %D, the close has recently moved up within the range compared with the past few sessions; when %K is below %D, it has moved down. The gap between the lines shrinks before a crossover, much as the MACD histogram shrinks before its two lines cross.
| Line | Calculation | Speed |
|---|---|---|
| Fast %K | Raw %K from the formula | Fastest |
| Fast %D | 3-session average of fast %K | Smoothed |
| Slow %K | The same values as fast %D | Smoothed |
| Slow %D | 3-session average of slow %K | Slowest |
Slow stochastic versus fast stochastic
The fast stochastic plots raw %K with its 3-session average as %D. The slow stochastic smooths once more: its %K is the fast %D, and its %D is a 3-session average of that. The slow version is common because raw %K can swing sharply from one session to the next.
A full stochastic generalizes both with three settings: the lookback, the smoothing of %K and the smoothing of %D. Full (14, 1, 3) is the fast stochastic and full (14, 3, 3) the slow one.
| Version | %K line | %D line | Crossovers |
|---|---|---|---|
| Fast (14, 3) | Raw %K | 3-session average of raw %K | Earlier and more frequent |
| Slow (14, 3, 3) | Fast %D | 3-session average of slow %K | Later and less frequent |
In the worked example below, the fast lines cross upward at session 19 and the slow lines one session later, at session 20.
A stochastic crossover example
The tables use 23 hypothetical sessions and the standard 14-session lookback, so session 14 is the first with a full window.
| Session | High ($) | Low ($) | Close ($) |
|---|---|---|---|
| 1 | 30.40 | 29.70 | 30.10 |
| 2 | 30.80 | 30.00 | 30.65 |
| 3 | 31.20 | 30.50 | 31.05 |
| 4 | 31.45 | 30.85 | 30.95 |
| 5 | 31.10 | 30.40 | 30.55 |
| 6 | 30.70 | 29.95 | 30.05 |
| 7 | 30.35 | 29.60 | 29.80 |
| 8 | 30.10 | 29.35 | 29.95 |
| 9 | 30.55 | 29.80 | 30.40 |
| 10 | 30.90 | 30.25 | 30.75 |
| 11 | 31.30 | 30.60 | 31.15 |
| 12 | 31.60 | 30.95 | 31.40 |
| 13 | 31.75 | 31.05 | 31.20 |
| 14 | 31.65 | 30.90 | 31.50 |
| 15 | 31.70 | 31.10 | 31.35 |
| 16 | 31.40 | 30.60 | 30.75 |
| 17 | 30.85 | 30.00 | 30.10 |
| 18 | 30.25 | 29.45 | 29.60 |
| 19 | 30.20 | 29.50 | 30.05 |
| 20 | 30.75 | 29.95 | 30.65 |
| 21 | 31.35 | 30.55 | 31.25 |
| 22 | 31.90 | 31.15 | 31.75 |
| 23 | 32.05 | 31.40 | 31.55 |
| Session | Highest high ($) | Lowest low ($) | Close ($) | Fast %K | Fast %D (slow %K) | Slow %D |
|---|---|---|---|---|---|---|
| 14 | 31.75 | 29.35 | 31.50 | 89.58 | ||
| 15 | 31.75 | 29.35 | 31.35 | 83.33 | ||
| 16 | 31.75 | 29.35 | 30.75 | 58.33 | 77.08 | |
| 17 | 31.75 | 29.35 | 30.10 | 31.25 | 57.64 | |
| 18 | 31.75 | 29.35 | 29.60 | 10.42 | 33.33 | 56.02 |
| 19 | 31.75 | 29.35 | 30.05 | 29.17 | 23.61 | 38.19 |
| 20 | 31.75 | 29.35 | 30.65 | 54.17 | 31.25 | 29.40 |
| 21 | 31.75 | 29.35 | 31.25 | 79.17 | 54.17 | 36.34 |
| 22 | 31.90 | 29.45 | 31.75 | 93.88 | 75.74 | 53.72 |
| 23 | 32.05 | 29.45 | 31.55 | 80.77 | 84.60 | 71.50 |
Session 18 closes near the bottom of its range, with %K at 10.42. Session 19 lifts %K to 29.17, above fast %D at 23.61: the fast lines cross upward near the 20 level, and the slow lines follow at session 20. By session 22, %K is 93.88. At session 23 the close slips, and %K (80.77) drops below fast %D (84.60), a downward crossover above 80.
Watch the window roll. At session 22, the low of session 8 (29.35) leaves the 14-session window, so the lowest low rises to 29.45, the low of session 18. Because the range is measured over a moving window, an old extreme dropping out can move %K as much as the latest close does.
The example shows how the lines move, not an outcome. In this hypothetical series price rose after the upward crossover; the same crossover can just as easily be followed by further losses.
Stochastic oscillator overbought and oversold levels
Readings above 80 are commonly called overbought and readings below 20 oversold. They say the close is in the top or bottom fifth of the recent range, nothing more.
Because a close at the highest high of the window gives exactly 100, the oscillator reaches its extremes easily. In a steady advance, each close near the top of a rising range keeps it above 80. In the illustration on this page, slow %K stays above 80 for 23 consecutive sessions during the final advance and crosses below slow %D 3 times along the way, while price keeps climbing.
Many readers therefore treat the levels as context rather than triggers: an oversold reading in an established advance describes a pullback to the low end of the recent range, and an overbought reading in a sideways market describes a test of its top. Lane’s own writing gives much attention to divergences between %D and price, not only to level crossings.
How to read the stochastic oscillator on a stock chart
The stochastic is drawn in a pane below price on a 0 to 100 scale, usually with lines at 80 and 20, %K as one line and %D as a second, often dashed, line.
- Check the settings: fast or slow, and the lookback.
- Read the position. Above 50, the close is in the upper half of the recent range.
- Watch %K against %D. Crossovers mark turns in the close’s position, and the gap between the lines shows how fast it is moving.
- Check the trend on the price chart. In a trend the oscillator can stay near one extreme.
- Compare swings for divergence, as described below.
TradeClever’s Stock Charts show the daily highs, lows and closes the oscillator is built from. To check a reading by hand, find the highest high and lowest low of the last 14 candles and see where the latest close sits between them. For candle basics, see reading a stock chart.
Stochastic divergence
A stochastic divergence compares two price swings with the oscillator at the same sessions. A lower price low with a higher %D low is bullish; a higher price high with a lower %D high is bearish.
Because the oscillator is bounded and reaches its extremes often, divergences are easier to read when both swings sit away from 0 and 100 and are several sessions apart. As with RSI and MACD, a divergence describes momentum and can persist through several swings.
Limitations of the stochastic oscillator
The stochastic reduces each session to one position within a range, and that simplicity is the source of its limits.
- It ignores the size of moves between sessions; only the close’s position within the range matters.
- It pins at the extremes in trends, producing repeated overbought or oversold readings and crossovers against the trend.
- The window can shift abruptly. When an old extreme leaves the 14-session window, the range changes and %K can jump without a large move in the latest close.
- Settings vary between platforms (fast, slow and full), so two sources may not match.
- A window without any range makes the ratio undefined.
- Crossover rules need their own evidence; nothing in the formula makes a crossover predictive.
Continue with
- Williams %RA close-in-range oscillator on an inverted scale.
- Ultimate oscillatorBuying pressure over three lookbacks.
- Compare technical indicatorsHow common indicators differ.
Sources
- George C. Lane, “Lane’s Stochastics,” Technical Analysis of Stocks & Commodities (May/June 1984)
Read our data and methodology notes for calculation context. This guide explains research tools and observations. It does not recommend a trade or investment.