What it measures
Take the highest high and the lowest low of the last 14 bars. That is the range the market has covered. The stochastic oscillator asks one question: how far up that range did the latest bar close?
A reading of 90 means the close is nine tenths of the way from the lowest low to the highest high. A reading of 10 means it is near the bottom. The idea, usually credited to George Lane in the 1950s, is that closes gather near the top of the range while a rise is under way and near the bottom during a fall.
Despite its name there is nothing random in it. And although it shares a 0 to 100 scale with RSI, it measures a different thing: RSI compares the sizes of rises and falls between closes, while the stochastic compares one close with a range of highs and lows.
How it is calculated, step by step
- 01
Find the highest high and lowest low of the last N bars.
N is usually 14, and the latest bar is included.
- 02
Place the close in that range.
Raw %K = 100 × (close − lowest low) ÷ (highest high − lowest low).
- 03
Smooth it.
%K = a simple average of the raw figure over a few bars, usually 3. With a smoothing of 1 nothing is averaged, and the result is called the fast stochastic.
- 04
Average it again.
%D = a simple average of %K, usually over 3 bars. It is the slower, later line.
The names are easy to confuse. The fast stochastic is the raw figure and its 3-bar average. The slow stochastic takes that average as its %K and averages it again for %D. A ‘full’ stochastic lets all three numbers be set, which is what the chart on this page does. If the highest high equals the lowest low the formula divides by zero; this page shows 50 for such a bar.
A worked example, by hand
Four bars, written high / low / close: 10 / 8 / 9, then 12 / 9 / 11, then 11 / 9 / 10, then 13 / 10 / 12. Length 3, no smoothing, %D over 2.
- Bar 3: highest high of bars 1 to 3 = 12; lowest low = 8
- %K = 100 × (10 − 8) ÷ (12 − 8) = 100 × 2 ÷ 4 = 50
- Bar 4: highest high of bars 2 to 4 = 13; lowest low = 9
- %K = 100 × (12 − 9) ÷ (13 − 9) = 100 × 3 ÷ 4 = 75
- %D at bar 4 = (50 + 75) ÷ 2 = 62.5
The last bar closed three quarters of the way up the range of the last three bars. %D, being an average, is behind it.
The numbers in this example were chosen to be easy to add up. They are not prices of anything.
How people read it
- The 80 and 20 lines. By convention, above 80 is called overbought and below 20 oversold: the close is near the top, or the bottom, of its recent range.
- %K against %D. %K crossing its own average means the close has moved up or down within the range faster than it had been.
- Divergence. The price makes a higher high while the oscillator makes a lower one.
- Together with the trend. In a steady rise the oscillator spends most of its time high; readers then pay attention to its dips, not to its peaks.
What it cannot tell you
- It cannot say a turn is due. A market making new highs bar after bar closes near the top of its range every time, and the oscillator stays above 80 throughout.
- It cannot tell you how big the range is. A reading of 90 in a range of 0.50 and in a range of 50 look identical.
- It cannot hold still. The range itself moves: when an old high drops out of the window, the reading can jump although the price has barely changed.
- It cannot be compared with RSI number for number. They share a scale and nothing else.
Common mistakes
- Reading above 80 as ‘sell’ and below 20 as ‘buy’. In a trend that reading repeats for a long time.
- Acting on every %K and %D crossing. With the usual settings they cross very often, and most crossings are followed by nothing in particular.
- Mixing up fast, slow and full versions when comparing two charts.
- Shortening the length to catch every wiggle. A short window makes the line swing from 0 to 100 on ordinary noise.
Questions people ask
- What is the difference between the fast and the slow stochastic?
- The fast stochastic uses the raw figure, 100 × (close − lowest low) ÷ (highest high − lowest low), as %K and its 3-bar average as %D. The slow stochastic takes that 3-bar average as its %K and averages it once more for %D. The slow version is smoother and later.
- What does a stochastic reading above 80 mean?
- That the latest closes are in the top fifth of the range between the lowest low and the highest high of the bars it looks back over. The convention is to call that overbought. It describes position in a recent range and does not mean a fall is due: in a steady rise the reading stays high.
- Is the stochastic oscillator the same as RSI?
- No. Both run from 0 to 100 and both are called momentum oscillators, but they measure different things. RSI compares the average size of rises between closes with the average size of falls. The stochastic places the latest close within the range of recent highs and lows. They can disagree.
The words on this page
An indicator is arithmetic on prices that have already happened. It describes what a price did; it does not predict what a price will do. The chart on this page is invented: a seeded random walk, not a market. This page is an explanation for study. It is not advice, a recommendation or a forecast, and nothing an indicator shows says anything certain about what a price will do next.
