Skip to content
Indicators 8 min read

Stochastic oscillator: %K, %D and how to read them

How the stochastic oscillator’s %K and %D are calculated, fast and slow versions, a worked crossover example, overbought and oversold levels and limits.

Hypothetical daily chart: price swings down, up and down, then advances steadily, with the slow stochastic %K and %D lines in the pane below between the 20 and 80 levels.Above 80Cross upCross downCross up2080Slow stochastic (14, 3, 3)
Daily candles on hypothetical data with the slow stochastic (14, 3, 3): %K solid, %D dashed. In the swings on the left, the lines cross near 20 and 80 close to the turns. In the final advance (shaded), %K stays above 80 for 23 consecutive sessions and crosses below %D 3 times while price keeps rising.

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.

The stochastic oscillator at a glance
PropertyStochastic oscillator
InputsDaily highs, lows and closes
Common settings14, 3 and 3: the lookback, the %K smoothing and the %D smoothing
Scale0 to 100
Common reference levels80 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 %K
lowest 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.

The four stochastic lines
LineCalculationSpeed
Fast %KRaw %K from the formulaFastest
Fast %D3-session average of fast %KSmoothed
Slow %KThe same values as fast %DSmoothed
Slow %D3-session average of slow %KSlowest

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.

Fast and slow versions
Version%K line%D lineCrossovers
Fast (14, 3)Raw %K3-session average of raw %KEarlier and more frequent
Slow (14, 3, 3)Fast %D3-session average of slow %KLater 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.

Hypothetical daily highs, lows and closes, sessions 1–23
SessionHigh ($)Low ($)Close ($)
130.4029.7030.10
230.8030.0030.65
331.2030.5031.05
431.4530.8530.95
531.1030.4030.55
630.7029.9530.05
730.3529.6029.80
830.1029.3529.95
930.5529.8030.40
1030.9030.2530.75
1131.3030.6031.15
1231.6030.9531.40
1331.7531.0531.20
1431.6530.9031.50
1531.7031.1031.35
1631.4030.6030.75
1730.8530.0030.10
1830.2529.4529.60
1930.2029.5030.05
2030.7529.9530.65
2131.3530.5531.25
2231.9031.1531.75
2332.0531.4031.55
Stochastic (14, 3, 3), sessions 14–23
SessionHighest high ($)Lowest low ($)Close ($)Fast %KFast %D (slow %K)Slow %D
1431.7529.3531.5089.58
1531.7529.3531.3583.33
1631.7529.3530.7558.3377.08
1731.7529.3530.1031.2557.64
1831.7529.3529.6010.4233.3356.02
1931.7529.3530.0529.1723.6138.19
2031.7529.3530.6554.1731.2529.40
2131.7529.3531.2579.1754.1736.34
2231.9029.4531.7593.8875.7453.72
2332.0529.4531.5580.7784.6071.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.

  1. Check the settings: fast or slow, and the lookback.
  2. Read the position. Above 50, the close is in the upper half of the recent range.
  3. Watch %K against %D. Crossovers mark turns in the close’s position, and the gap between the lines shows how fast it is moving.
  4. Check the trend on the price chart. In a trend the oscillator can stay near one extreme.
  5. 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.

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.

Follow your curiosity

One good question leads to another.

All guides
Make room for better research

Put your curiosity to work.

Build a scan with filters or CleverScan rules. Explore the results. Find your next idea.

Open a stock chart