LoginEnter the platform free
DOMINA › Technical analysis › The indicators › Stochastic oscillator

The stochastic oscillator: where price closes in its range

InteractiveFind the right crossoverclick the session where %K moves above %D starting below 20: the page tells you whether it is the right oneTry it →

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.

stochastic oscillator
Microsoft, price and stochastic
Example: Microsoft, 2025 sessions · stochastic 14-3-3, slow · 67 crossovers · 69 sessions out of 249 with %K above 80 · adjusted prices
Try the settings: the panel redraws
volumeperiod start 415.51541.06352.67487.48Jan 2, 2025Apr 3, 2025Jul 3, 2025Oct 1, 2025Dec 30, 2025
overbought80%K 81.1%D 79.020oversold
Sessions249crossovers67sessions above 8069sessions below 2044longest run above 8025

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

rising: closes near the highhigh of the 14 sessionslow of the 14 sessions1000%K = 87falling: closes near the lowhigh of the 14 sessionslow of the 14 sessions1000%K = 13
  • 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

high of the 14 sessions (HH): 20low of the 14 sessions (LL): 10close (C): 17C − LL = 7HH − LL = 10%K = 100 × 7 / 10 = 70
  • 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.
raw %K = 100 × (C − LL) / (HH − LL)
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

fast8020raw %K%D: avg of 3slow8020slow %K%D: avg of 3fast %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

overbought8020oversold%K%Dprice goes back and forth between two levels
  • 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

overbought8020oversold%K%Dprice when %K moves above 80price keeps rising%K stays above 80 for weeks
  • 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

overbought8020oversold%K%D$459.07$490.3225 sessions with %K above 80: May 27, 2025 – July 1, 2025
  • %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

overbought8020oversold%K%D%K moves above %D starting below 20%K moves below %D from above 80mid-scale: says little
  • 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

8020bearish divergenceprice: higher highstochastic: lower high8020bullish divergenceprice: lower lowstochastic: higher low
  • 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.

The first 18 Microsoft sessions, with 14-3-3
SessionHighLowCloseHHLLRaw %KSlow %K%D
422.95411.81415.51—————
420.92416.47420.25—————
431.14422.36424.72—————
427.50417.72419.28—————
423.84418.45421.45—————
421.60411.98415.88—————
415.44409.27414.14—————
416.67407.71412.63—————
425.01415.20423.19—————
426.34421.28421.47—————
431.30425.03425.89—————
427.74422.48425.36—————
443.99432.81442.93—————
443.48438.27443.44443.99407.7198.48——
443.38438.17440.81443.99407.7191.23——
432.01420.40431.38443.99407.7165.2484.99—
445.10428.22443.93445.10407.7196.8784.45—
443.61437.18439.09445.10407.7183.9382.0183.82
: 100 × (443.44 − 407.71) / (443.99 − 407.71) = 98.48   raw %K
: (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-3swings end to end14-3-3in the middle21-5-5slow: few crossovers
  • 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.
The 2025 Microsoft sessions with four settings
SettingCrossoversSessions above 80Sessions below 20Longest run above 80
14-3-367694425
14-1-3 · fast101764719
5-3-36647309
21-5-541725661

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
  1. In the panel, look for where %K (blue) is below 20 and below %D (amber).
  2. Find the session where %K moves above %D: it is a green dot.
  3. Click it: the page tells you whether it is the right one and why.
click a session
Click a session on the chart or on the panel.

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 oscillators

The 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

The sources of this page: the books are cited, the text is ours
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.

Cookie preferences