The stochastic oscillator: where price closes in its range
The stochastic oscillator on a real chart
The stochastic oscillator shows where price closed relative to the high and low of the last few sessions. It reads 100 when the close sits on the high of the range and 0 when it sits on the low. It is drawn as two lines, %K and %D, running between 0 and 100.
Below the price, %K in blue and %D in amber. The dots mark the crossovers: green when %K moves above %D, red when it moves below. The amber band on the price is the longest run with %K above 80.
InteractiveClick any session: the page tells you where it closed in its range, what %K and %D read, and what they say together.
George Lane's idea: where price closes
George Lane started from a simple observation: when price rises, closes sit near the highs of the last few sessions; when it falls, near the lows. The stochastic measures that position on a scale from 0 to 100. The name is misleading: nothing in the calculation is random, it is a proportion.
Fig. 1 · Where price closes, rising and falling
- In a rise the close sits high in the range. Each new high lifts the ceiling and price stays close to it, so the reading climbs toward 100.
- In a fall it sits low. It is the same calculation seen from the other side: new lows lower the floor and the close follows it toward 0.
- It does not measure how far price has moved. A small rise and a large one can give the same number: only the place inside the range counts.
The stochastic oscillator formula: %K and %D
Each session needs three numbers: the close (C), the highest high of the last 14 sessions (HH) and the lowest low of the same sessions (LL). %K is the distance of the close from the floor, divided by the height of the range.
Fig. 2 · The range is a ruler
- The 14-session range works as a ruler. The lowest low reads 0 and the highest high reads 100: the close is read on that scale.
- In the figure the close sits at 7 out of a height of 10. The ratio is 70 out of 100, and that is all the raw %K is.
- The result always stays between 0 and 100. A close sits between the high and the low of its session, so it cannot leave the range.
slow %K = 3-session average of raw %K
%D = 3-session average of slow %K
C = close · HH = highest high of the 14 sessions · LL = lowest low of the 14 sessions
Fast and slow stochastic
The fast version uses %K as it comes out of the formula, and %D is its average. The slow version smooths once more: fast %D becomes slow %K, and the new %D is its average. Writing 14-3-3 means: a 14-session range, %K smoothed over 3, %D over 3. The 14-1-3 button on the chart at the top shows the fast one.
Fig. 3 · Fast %D becomes slow %K
- The fast one is jumpy. A single close can move it by tens of points, because beyond its range it has no memory.
- The slow one is the same line, one step later. It adds no information: it removes some noise and adds some lag.
- Before comparing two charts, check the three numbers. Platforms do not all start from the same settings, and the same session can read differently.
The 80 and 20 zones: overbought does not mean sell
Above 80 is called overbought, below 20 oversold. The names are misleading: they say where price closed in its range, not that it has to turn.
Fig. 4 · In a sideways market
- When price goes back and forth, the stochastic touches both zones on every swing. The range stays put and the close travels from one end to the other.
- Above 80 means βhigh in the rangeβ, nothing more. Here price turns early because the market is sideways, not because the line touched that number.
The same reading, in a strong trend, says something very different.
Fig. 5 · In a strong trend it stays stuck at the top
- In a strong trend it stays above 80 for weeks. Each new high also lifts the ceiling of the range and the close stays near it, so the reading has to stay high.
- Price keeps rising with the stochastic overbought. The level where %K first moved above 80 is soon left far below.
- The opposite holds on the way down. In a strong decline it can stay below 20 for a long time, for the same reason.
Fig. 6 · The same on Microsoft, with real sessions
- %K stayed above 80 for 25 sessions in a row. From to the close went from $459.07 to $490.32. That is the amber band on the chart at the top.
- For the whole stretch the reading says βoverboughtβ. The close, meanwhile, ends higher than where it started: the two facts live side by side.
The crossover between %K and %D
%D is the average of %K, so it arrives later. When %K turns, it cuts through %D: that is the crossover. Upward if %K moves above, downward if it moves below. Where it happens also matters.
Fig. 7 · Three crossovers in three different places
- From below 20, upward. The close climbs off the floor of the range faster than its average. It is the most often quoted crossover, and the one in the exercise.
- From above 80, downward. The mirror case. In a strong trend it happens often, and price can resume rising right afterwards.
- Between 20 and 80 it says little. In the middle of the scale the two lines cross all the time, and in a directionless stretch that is mostly noise.
Divergences on the stochastic indicator
There is a divergence when price and the stochastic do not tell the same story: price makes a higher high and the stochastic a lower one, or the opposite on the lows.
Fig. 8 · Bearish and bullish divergence
- Bearish: a higher high on price, a lower one on the stochastic. Price has risen again, but the close sits less high in its range than it did at the previous high.
- Bullish: a lower low on price, a higher one on the stochastic. The same calculation on the lows: price is falling again, but closing less near the floor.
- A divergence is not a reversal. It says the move is losing thrust. It can end with price going sideways, and a strong trend can show several in a row.
The arithmetic, step by step
The first 18 Microsoft sessions of the period, to two decimals. Session 14 has the first raw %K, session 16 the first slow %K, session 18 the first %D. In bold, the high and the low that make the first range. Anyone can redo it all by hand.
| Session | High | Low | Close | HH | LL | Raw %K | Slow %K | %D |
|---|---|---|---|---|---|---|---|---|
| 422.95 | 411.81 | 415.51 | — | — | — | — | — | |
| 420.92 | 416.47 | 420.25 | — | — | — | — | — | |
| 431.14 | 422.36 | 424.72 | — | — | — | — | — | |
| 427.50 | 417.72 | 419.28 | — | — | — | — | — | |
| 423.84 | 418.45 | 421.45 | — | — | — | — | — | |
| 421.60 | 411.98 | 415.88 | — | — | — | — | — | |
| 415.44 | 409.27 | 414.14 | — | — | — | — | — | |
| 416.67 | 407.71 | 412.63 | — | — | — | — | — | |
| 425.01 | 415.20 | 423.19 | — | — | — | — | — | |
| 426.34 | 421.28 | 421.47 | — | — | — | — | — | |
| 431.30 | 425.03 | 425.89 | — | — | — | — | — | |
| 427.74 | 422.48 | 425.36 | — | — | — | — | — | |
| 443.99 | 432.81 | 442.93 | — | — | — | — | — | |
| 443.48 | 438.27 | 443.44 | 443.99 | 407.71 | 98.48 | — | — | |
| 443.38 | 438.17 | 440.81 | 443.99 | 407.71 | 91.23 | — | — | |
| 432.01 | 420.40 | 431.38 | 443.99 | 407.71 | 65.24 | 84.99 | — | |
| 445.10 | 428.22 | 443.93 | 445.10 | 407.71 | 96.87 | 84.45 | — | |
| 443.61 | 437.18 | 439.09 | 445.10 | 407.71 | 83.93 | 82.01 | 83.82 |
: (98.48 + 91.23 + 65.24) / 3 = 84.99 slow %K
: (84.99 + 84.45 + 82.01) / 3 = 83.82 %D
The numbers are rounded to two decimals: an average redone by hand can differ by one in the last digit. Click on the chart at the top, with 14-3-3: the page writes the same values.
Stochastic settings: 14-3-3, 5-3-3, 21-5-5
The three numbers do two different jobs. The first is the range: the shorter it is, the more the line jumps from one extreme to the other. The other two are the smoothing: the longer it is, the fewer crossovers there are. No setting is best in absolute terms, and 14-3-3 is the most common. The buttons at the top of the page show it on the real chart.
Fig. 9 · The same move with three settings
- 5-3-3 has a short ruler. A few sessions are enough to go from one zone to the other: it sees small turns earlier, and also takes for turns some that are not.
- 14-3-3 sits in the middle. It is the most common compromise between speed and noise.
- 21-5-5 is slow. A long range and more smoothing: few crossovers, and by the time they come part of the move has already happened.
| Setting | Crossovers | Sessions above 80 | Sessions below 20 | Longest run above 80 |
|---|---|---|---|---|
| 14-3-3 | 67 | 69 | 44 | 25 |
| 14-1-3 · fast | 101 | 76 | 47 | 19 |
| 5-3-3 | 66 | 47 | 30 | 9 |
| 21-5-5 | 41 | 72 | 56 | 61 |
These are counts, not results: the table does not say which setting is better. It says one thing: 14-1-3, with little smoothing, has many more crossovers than 14-3-3; 5-3-3, which changes only the range, has about the same number and shorter runs above 80.
Interactive exerciseFind the crossover that starts below 20
Microsoft, 2025 sessions, 14-3-3- In the panel, look for where %K (blue) is below 20 and below %D (amber).
- Find the session where %K moves above %D: it is a green dot.
- Click it: the page tells you whether it is the right one and why.
The most common mistakes with the stochastic indicator
1βAbove 80, sellβ
- 80 says where the close sits, not where price will go.
- In a strong trend the reading stays high for weeks.
2βEvery crossover is a signalβ
- On Microsoft, with 14-3-3, there are 67 crossovers in 249 sessions.
- In the middle of the scale they are mostly noise.
3βI tweak the numbers until it fitsβ
- On a past chart you can always find the setting that looks perfect.
- It says nothing about the sessions still to come.
Stochastic, RSI and SMI: what is the difference
The stochastic and the RSI both run between 0 and 100, but they measure different things. The stochastic looks at where the close sits inside the range of highs and lows. The RSI compares gains and losses from one close to the next, and does not look at highs and lows.
That is why the stochastic reacts faster: beyond its range it has no memory, while the RSI smooths all the history behind it. On the same day the two can say different things, and neither is wrong.
The SMI (Stochastic Momentum Index) starts from the same idea, but measures the distance of the close from the center of the range instead of from the floor. That is why it runs between −100 and +100.
Deeper dives: the RSI · the SMI · the MACD · the ADX · the trend · divergences.
Where to go from here
The indicators · Momentum and oscillatorsThe other indicators in the Β«Momentum and oscillatorsΒ» family
RSI β Relative Strength Index
- an oscillator from 0 to 100: the strength of gains against losses
- 70 and 30, the 50 line, divergences
- find overbought on the real chart and change the settings
MACD
- It is the distance between a fast average and a slow one.
- The signal line and the histogram are there to read it.
- It is made of averages: it moves after price, never before.
Relative Vigor Index (RVI)
- It compares the close with the open, relative to the range.
- It is read on two lines, RVI and signal, around zero.
- Same abbreviation as the Relative Volatility Index: a different indicator.
Stochastic Momentum Index
- It measures the close from the middle of the range, not from the low.
- It runs from β100 to +100: at zero the close is halfway up the range.
- It is smoothed twice: it is calm, and it comes after price.
Frequently asked questions
What is the stochastic oscillator?
It is an oscillator between 0 and 100 that shows where price closed relative to the high and low of the last few sessions, usually fourteen. It is drawn as two lines: %K, the position of the close, and %D, its average. It reads near 100 when the close sits high in the range and near 0 when it sits low.
How do you read the stochastic indicator?
You watch three things: the zones above 80 and below 20, the crossovers between %K and %D, and divergences with price. Above 80 does not mean sell: in a strong trend the reading can stay there for weeks, because each new high also lifts the ceiling of the range.
What are the best settings for the stochastic oscillator?
The most common is 14-3-3: a fourteen-session range, %K smoothed over three, %D an average of three. 5-3-3 is jumpier, 21-5-5 slower. None is best in absolute terms: a shorter range sees small turns earlier, a longer one arrives later.
What is the difference between the stochastic and the RSI?
The stochastic looks at where the close sits inside the range of highs and lows. The RSI compares gains and losses from one close to the next. Both run between 0 and 100, but they measure different things, and on the same day they can say different things.
Method and sources
| Source |
|---|
| George C. Lane, Lane's Stochastics, Technical Analysis of Stocks & Commodities, 1984 |
| John J. Murphy, Technical Analysis of the Financial Markets, chapter 10 (oscillators and contrary opinion) |
The chart uses Microsoft sessions from our archive from to , adjusted for dividends and corporate actions. We calculate the stochastic ourselves on highs, lows and closes to two decimals; the sessions before the start get the calculation going and are not shown. The numbered figures are diagrams drawn to explain, not prices. This guide explains how the tools work: it does not contain investment recommendations and promises no returns. Our method · license · report an error.
DOMINA’s stock pages, indices and commodities are rebuilt every night. Leave your email: we write to you when the picture changes.
No third-party advertising. Unsubscribe with one click. Go to the platform →With your consent we use Google Analytics cookies to count visits. If you decline, the page works the same and no measurement cookie is set. Cookie policy