Stochastic oscillator: formula, 80 and 20 levels, and SMI

The stochastic oscillator is a momentum indicator. It shows where today’s closing price sits inside its recent high-to-low range, on a scale from 0 to 100. A reading of 80 means the close is near the top of the range, and 20 means it is near the bottom. George Lane made it popular, and William Blau later built a smoother version called the stochastic momentum index.

Key points#

  • The main line is called %K. A 3-day average of it, called %D, is the signal line.
  • The usual setting looks back 14 days.
  • Above 80 is often called overbought. Below 20 is often called oversold.
  • The stochastic momentum index (SMI) measures the close against the middle of the range and runs from −100 to +100.
  • Like most chart tools, it describes the past. Strong trends can keep it pinned near 100 or 0 for weeks.

What is the stochastic oscillator?#

The stochastic oscillator compares a closing price with the range of prices over a set number of days. If the close is right at the highest price of the last 14 days, it reads 100. If the close is at the lowest price, it reads 0.

George C. Lane wrote about it in Lane’s Stochastics, an article in Technical Analysis of Stocks & Commodities in 1984. StockCharts says he developed it in the late 1950s. Lane’s idea was that in an uptrend, prices tend to close near the top of their range. In a downtrend, they tend to close near the bottom.

It is one of many common chart tools. Our guide to the best indicators for trading compares it with moving averages, MACD and others.

The stochastic oscillator formula#

The formula has two lines, %K and %D.

  • %K = (today’s close − lowest low) ÷ (highest high − lowest low) × 100
  • %D = the average of the last 3 days of %K

The lowest low is the lowest price of the last 14 days. The highest high is the highest price over the same days.

A worked example with round numbers#

Say that over the last 14 days, a stock’s highest price was $60 and its lowest was $40. Today it closed at $55.

  • Close minus lowest low: $55 − $40 = $15
  • Highest high minus lowest low: $60 − $40 = $20
  • %K = $15 ÷ $20 × 100 = 75

Now say %K was 65 two days ago, 70 yesterday and 75 today.

  • %D = (65 + 70 + 75) ÷ 3 = 70

The close is three quarters of the way up its 14-day range. %K is above %D, so the close has been moving up within the range.

How to read the stochastic oscillator#

Traders usually watch three things: the level, the crossover, and divergence.

What you seeWhat it saysHow traders often read it
%K above 80Close is near the top of its rangeOverbought
%K below 20Close is near the bottom of its rangeOversold
%K crosses above %DThe close is rising within the rangePossible upturn
%K crosses below %DThe close is falling within the rangePossible downturn
Price makes a new high, %K does notLess force behind the riseBearish divergence

The 80 and 20 lines are a habit that traders can move. StockCharts notes that some change them to fit the stock.

Fast vs slow stochastic#

The fast and slow versions differ in how much smoothing they use. More smoothing means fewer false signals but later ones.

  • Fast stochastic: %K is the raw formula. %D is a 3-day average of %K. This is Lane’s original form.
  • Slow stochastic: %K is smoothed first with a 3-day average. So slow %K equals fast %D. Slow %D is a 3-day average of slow %K.

The fast version jumps around a lot, which is why many traders prefer the slow one. A “full” stochastic lets you pick each of the three settings yourself.

What is the stochastic momentum index?#

The stochastic momentum index (SMI) is a smoother version of the stochastic oscillator. William Blau introduced it in Technical Analysis of Stocks & Commodities in January 1993, according to TC2000’s indicator guide. Blau later wrote about his momentum tools in the book Momentum, Direction, and Divergence (Wiley, 1995).

The SMI differs from the classic stochastic in two ways:

  1. It measures from the middle. It compares the close with the midpoint of the high-to-low range, not with the low.
  2. It is smoothed twice. It applies two exponential moving averages to both the distance and the range before dividing.

That gives a scale from −100 to +100, centered on zero. TC2000 notes that readings above +40 are usually called overbought and below −40 oversold.

Same example, SMI style. The range is $40 to $60, so the midpoint is $50. The close of $55 is $5 above the middle. Half the range is $10. Before smoothing, the reading is $5 ÷ $10 × 100 = 50. The smoothing then spreads that out over several days.

Stochastic vs RSI#

Both indicators run from 0 to 100, and both try to show when a move has gone far. They measure different things.

  • The stochastic compares the close with the recent high and low.
  • The RSI indicator compares the size of recent gains with recent losses.

A stock can close near its 14-day high while its up days and down days are about the same size. Then the stochastic is high and RSI is near the middle.

Does the stochastic oscillator work?#

The evidence for the stochastic oscillator on its own is thin. Careful tests of it alone, after trading costs, are hard to find.

Oversold and overbought readings rest on an idea called mean reversion: stretched prices tend to drift back toward normal. That can be true in a sideways market. In a strong trend, it can be wrong for a long time. A trend tool such as a moving average has been tested more, and even those results are mixed.

Common mistakes#

  • Selling only because it is above 80. In a strong uptrend, the stochastic can sit above 80 for weeks.
  • Trading every crossover. The fast version crosses often. Many crossovers lead nowhere.
  • Mixing up the versions. Fast, slow and full stochastics give different numbers. Check which one your chart uses.
  • Tuning settings to one chart. Settings that fit last year may not fit next year. Our page on why past results mislead explains why.

Try it on Tactfolio#

Tactfolio’s builder does not offer the stochastic oscillator or the SMI today. You can test the ideas behind it. The strategy builder reads RSI, moving averages, returns and volatility over a lookback you choose. For example, hold a fund while it trades above its 200-day average, or buy when its RSI drops below 30. The backtest shows every year, including the bad ones. Strategies on US stocks and ETFs run on daily prices and hold long positions only.

Common questions#

What is the stochastic momentum index?#

It is William Blau’s 1993 version of the stochastic oscillator. It compares the close with the middle of the recent range and smooths the result twice. It runs from −100 to +100, with ±40 often used as overbought and oversold lines.

What are the best settings for the stochastic oscillator?#

The common default is 14 days for %K and 3 days for %D, often with 3 more days of smoothing in the slow version. Shorter settings react faster and give more false signals. No setting is best for every stock.

Is the stochastic oscillator better than RSI?#

Neither is better in general. The stochastic tracks where the close sits in its range. RSI tracks the size of gains against losses. Many traders look at one and use the other only to confirm.

What does it mean when the stochastic is above 80?#

The close is in the top fifth of its recent high-to-low range. That says the price has been strong. It does not say the price must fall.

What is the difference between %K and %D?#

%K is the main line, showing today’s close within the range. %D is a 3-day average of %K. It moves more slowly and acts as a signal line.

The details#

  • Fast %K (n): 100 × (close − lowest low over n) ÷ (highest high over n − lowest low over n). The usual n is 14.
  • Fast %D: 3-period simple moving average of fast %K.
  • Slow %K: fast %D. Slow %D: 3-period simple moving average of slow %K.
  • Full stochastic: a lookback, a %K smoothing length and a %D length, all chosen by the user.
  • SMI: 200 × EMA(EMA(close − midpoint)) ÷ EMA(EMA(high − low)), where the midpoint is (highest high + lowest low) ÷ 2. Smoothing lengths vary by charting tool.

Sources