start learning →
intermediate12 min read

Stochastic oscillator explained: %K, %D, settings and how it differs from RSI

The stochastic oscillator shows where the latest close sits within the recent high-low range. Here is the %K and %D arithmetic, the fast, slow and full versions, and why overbought readings in a trend are not sell signals.

key takeaways
  1. The stochastic oscillator measures where the close sits within the high-low range of the last N bars, on a 0 to 100 scale.
  2. %K is the raw or smoothed position in the range; %D is a moving average of %K, usually over 3 periods.
  3. Fast, slow and full stochastics differ only in how much smoothing is applied; 14, 3, 3 is a common full setting, and MetaTrader defaults to 5, 3, 3.
  4. Readings above 80 or below 20 describe where price closed in its range, not that it must reverse; in trends the oscillator can stay pinned at an extreme.
  5. Stochastic and RSI are both built from past prices and often agree for the same reason, so using both is not independent confirmation.

The stochastic oscillator shows where the latest closing price sits within the high-low range of a recent window, usually 14 bars, on a scale from 0 to 100. A reading of 90 means price closed near the top of that range; 10 means it closed near the bottom. It is a momentum indicator built entirely from past highs, lows and closes, and its best-known signals, overbought, oversold, crossovers and divergence, describe what has happened rather than what will.

This guide assumes you have met momentum indicators before. If not, RSI and MACD explained is a good primer, and much of its scepticism applies here too.

Where the stochastic oscillator comes from

The stochastic oscillator was popularised by George Lane, a futures trader and educator, in the late 1950s. The idea behind it is simple: in a rising market, closes tend to be near the top of the recent range; in a falling market, near the bottom. If closes start drifting away from the extreme of the range, the push behind the move may be fading.

The name sounds mathematical, but there is nothing random or probabilistic in the calculation. It is a ratio of three prices.

How %K and %D are calculated

%K: the position in the range

For a look-back of N bars (14 by default):

  • %K = 100 × (current close − lowest low of the last N bars) / (highest high of the last N bars − lowest low of the last N bars)

The lowest low and highest high include the current bar. If the close equals the highest high, %K is 100. If it equals the lowest low, %K is 0. If it is exactly halfway, %K is 50.

%D: the signal line

  • %D = a 3-period simple moving average of %K

%D smooths %K and lags it slightly. Crossovers of %K and %D are one of the most commonly quoted stochastic signals, in the same way that MACD has its signal line.

Worked example: calculating %K

Illustrative EUR/USD bars, using a simplified 5-bar window so every number is visible:

  • Bar 1: high 1.0910, low 1.0860
  • Bar 2: high 1.0935, low 1.0880
  • Bar 3: high 1.0950, low 1.0905
  • Bar 4: high 1.0940, low 1.0890
  • Bar 5: high 1.0925, low 1.0870, close 1.0915

Step 1. Highest high of the five bars: 1.0950 (bar 3).

Step 2. Lowest low of the five bars: 1.0860 (bar 1).

Step 3. Range = 1.0950 − 1.0860 = 90 pips.

Step 4. Close minus lowest low = 1.0915 − 1.0860 = 55 pips.

Step 5. %K = 100 × 55 / 90 = 61.1.

Price closed a little above the middle of its five-bar range. That is everything %K says.

With the standard 14-bar window the method is the same, just with more bars to scan. Suppose that over the last 14 bars the highest high is 1.0950 and the lowest low is 1.0800, a 150-pip range:

  • If the close is 1.0920, %K = 100 × (1.0920 − 1.0800) / 150 pips = 100 × 120 / 150 = 80.
  • If the close is 1.0830, %K = 100 × 30 / 150 = 20.

Worked example: %D

If the last three %K readings are 80, 70 and 75, %D = (80 + 70 + 75) / 3 = 75. %K at 75 equals %D, so the two lines are touching. If the next %K is 65, it falls below %D, which some traders read as a bearish crossover. In plain terms, the close has moved down within its range compared with the last few bars. That may be the start of a decline or a pause in a rise.

Fast, slow and full stochastics

The three versions differ only in how much smoothing is applied.

Fast stochastic

The fast stochastic uses the raw %K described above and a 3-period %D. Because raw %K responds to every close, the fast version is jumpy: a single bar can move it from 20 to 80. Lane's original description is usually given as the fast version.

Slow stochastic

The slow stochastic smooths once more:

  • slow %K = a 3-period average of fast %K (which is the same as fast %D)
  • slow %D = a 3-period average of slow %K

Illustrative: if the last three fast %K readings are 85, 72 and 90, slow %K = (85 + 72 + 90) / 3 = 82.3. The jump from 72 to 90 is softened. Most traders who say "stochastic" mean the slow version, because the fast one produces so many crossovers.

Full stochastic

The full stochastic lets you choose all three numbers: the look-back for the high-low range, the smoothing applied to %K, and the length of %D. It is usually written as three numbers, such as 14, 3, 3:

  • 14: look-back for the highest high and lowest low
  • 3: smoothing applied to raw %K
  • 3: moving average of the smoothed %K, giving %D

Full 14, 1, 3 is the fast stochastic; full 14, 3, 3 is the slow stochastic. The full version is just a general form of the other two.

Settings on common platforms

Platforms use different defaults and different names for the same inputs. MetaTrader's built-in stochastic defaults to 5, 3, 3, labelled %K period, %D period and slowing, and lets you choose the type of moving average and whether to use high/low or close/close prices. Other platforms default to 14 bars. Before comparing readings with someone else's chart or with a guide, check the look-back, the smoothing and the averaging method; the same price data can give quite different readings.

Shorter look-backs make the oscillator swing to extremes more often. Longer look-backs and more smoothing make it calmer and slower. There is no best setting. Picking the one that would have produced the cleanest signals on last year's chart is a classic way to overfit; how to backtest a strategy explains why that tends to disappoint on new data.

Overbought and oversold

Readings above 80 are conventionally called overbought and below 20 oversold. As with RSI, the labels promise more than they deliver. A stochastic above 80 means the close is in the top fifth of its recent range. In a rising market, that is exactly where you would expect closes to be.

Why the stochastic pins in trends

Because the stochastic is bounded by the recent range, a steady trend can hold it near the extreme for a long time. Illustrative scenario: in a strong EUR/USD uptrend, each bar makes a new high and closes near it. The highest high of the last 14 bars keeps rising with price, and the close keeps landing near it, so %K stays between 85 and 100 for days or weeks. Selling every time it crosses 80 means selling into strength again and again.

The same happens in downtrends near zero. An oversold stochastic in a falling market is a description of the fall, not a reason for it to stop.

Traders adapt in a few ways, none of which turns the indicator into a forecast:

  • Trade only in the direction of a broader trend. For example, in an uptrend defined by a rising long moving average, only consider oversold readings as possible entries, and ignore overbought ones. Trend following and moving averages covers how traders define the trend.
  • Wait for the oscillator to leave the extreme. Rather than acting when %K crosses above 80, some wait for it to fall back below 80, accepting a later entry for fewer cases of fighting a trend.
  • Use the extremes as a strength gauge. A stochastic that keeps returning to 90 to 100 describes a market where closes are consistently strong.

The glossary entry on overbought and oversold summarises the general idea across oscillators.

Stochastic vs RSI

Both are bounded 0 to 100 momentum oscillators with overbought and oversold zones, and they often look similar on a chart. They are calculated differently and answer slightly different questions.

  • What they measure. RSI compares the size of recent up closes with recent down closes. Stochastic compares the latest close with the recent high-low range.
  • Inputs. RSI uses closes only. Stochastic uses highs and lows as well as the close.
  • Sensitivity. Stochastic usually swings more often and more quickly to its extremes. RSI with a 14-period setting moves more slowly and reaches 70 or 30 less often.
  • Behaviour in quiet markets. This is the clearest difference. Illustrative: if a pair has traded in a 20-pip range for 14 bars and closes at the top of it, %K is 100, the most overbought reading possible, even though price has hardly moved. RSI in the same quiet market might sit near 55. The stochastic measures position in the range, however small the range is.
  • Conventional levels. Stochastic uses 80 and 20; RSI uses 70 and 30.

Which to use is a matter of preference and testing, not of one being better. What does not work is treating them as two independent votes. When price has risen strongly for two weeks, RSI will be high and stochastic will be near the top almost automatically. Agreement between them is mostly mechanical. If you want information that is genuinely different, look at things these indicators cannot see: the economic backdrop, the calendar of scheduled releases and the levels on the chart. The same point applies to pairing the stochastic with Bollinger Bands, which are also built from recent closes.

Crossovers

A %K cross above %D is commonly read as bullish, especially if it happens below 20; a cross below %D, especially above 80, as bearish. Because %D is a 3-period average of %K, these crosses happen often, particularly on the fast stochastic. Many are noise. In sideways markets crossovers alternate quickly and produce a stream of small losses once spreads and commissions are included; in trends, crosses against the trend tend to fail repeatedly. A crossover is a small change in where the close sits within the range. On its own it carries very little information.

Divergence

Divergence is when price and the oscillator disagree:

  • Bearish divergence: price makes a higher high, but the stochastic makes a lower high.
  • Bullish divergence: price makes a lower low, but the stochastic makes a higher low.

Illustrative scenario: GBP/USD rallies to 1.2800 with slow %K at 95, pulls back, then rallies to 1.2830. At the new high, slow %K reaches only 84. The closes around the second peak sat lower within their 14-bar range than the closes around the first peak did, for example because bars finished well below their highs or because the pullback lowered the bottom of the range. That is bearish divergence.

What it shows is that the latest push closed less strongly within its range. It does not show that price will fall. Trends commonly produce several divergences as they continue, and the stochastic, being bounded at 100, is especially prone to it: once %K has hit the ceiling, later peaks can only match it or fall short. Divergence also depends on which peaks you choose to compare, which makes it look more reliable on a chart reviewed with hindsight than in real time. The glossary entry on divergence gives the general definition.

If you trade divergence, the decisions that determine what being wrong costs are the stop and the position size. A trader who sold the 1.2830 high with a stop at 1.2870 and a USD 100 risk limit, at roughly USD 10 per pip per standard lot, could trade 100 / (40 × 10) = 0.25 lots. If the trend continued, the loss would be limited to about USD 100 plus any slippage, however strong the divergence looked. Position sizing explains the method and where to put a stop-loss covers placement.

A worked rule and how to judge it

Illustrative only. A trader writes this rule for the four-hour EUR/USD chart:

  1. Trend filter: price above a rising 200-period moving average.
  2. Entry: slow stochastic (14, 3, 3) falls below 20 and then %K crosses back above %D, with both lines climbing above 20.
  3. Stop: beyond the most recent swing low, plus a small buffer.
  4. Exit: stop hit, or %K crosses below %D above 80.

This is specific enough to test. It might produce a few trades a month. Before forming a view, the trader would need dozens of recorded outcomes, including spreads and slippage, on data that was not used to design the rule, and then a period of live trading at small size. Expect the results to vary a lot by period and pair. The point of writing it down is not that stochastics predict anything; it is that a precise rule can be tested and followed consistently, which a vague feeling cannot. Recording each trade in a trading journal makes the review possible.

Limits of the stochastic oscillator

  • It is derived from past prices. Highs, lows and closes are already on the chart. The stochastic presents them differently.
  • It is range-relative. In a very quiet market, tiny moves produce extreme readings. In a very volatile one, large moves can produce middling readings.
  • It is bounded. At 0 or 100 it cannot show further strength or weakness, which distorts divergence.
  • It is sensitive to settings and data. Different platforms, look-backs, smoothing methods and session times give different values.
  • It does not see news. A reading of 15 says nothing about a central bank decision due in an hour.

Common mistakes

  • Selling because the stochastic is above 80. In a trend that is where it lives.
  • Trading every crossover. Most are noise, and each trade pays the spread.
  • Stacking oscillators. Stochastic, RSI and CCI on one chart are three views of the same prices.
  • Treating divergence as a reversal signal. It is a momentum observation that can persist.
  • Comparing readings across different settings. A 5, 3, 3 stochastic and a 14, 3, 3 stochastic can disagree on the same bar.
  • Using leverage to make small swings worthwhile. Leverage magnifies losses as well as gains, and most retail CFD accounts lose money. See leverage and margin and why most retail CFD traders lose.

For a short definition, see the glossary entry for the stochastic oscillator.

Frequently asked questions

What does the stochastic oscillator measure?

It measures where the latest close sits within the highest high and lowest low of a recent window, usually 14 bars, on a 0 to 100 scale. A high reading means price closed near the top of its recent range; a low reading means near the bottom.

What is the difference between %K and %D?

%K is the position of the close within the recent range, raw or smoothed depending on the version. %D is a moving average of %K, usually over 3 periods, which makes it a slower signal line. Crossovers between the two are common but often noisy.

What are the best stochastic settings?

There are no best settings. Full 14, 3, 3 is a common choice and MetaTrader defaults to 5, 3, 3. Shorter settings swing to extremes more often; longer ones are calmer and slower. Any setting should be tested on data that was not used to choose it.

What is the difference between fast and slow stochastic?

The fast stochastic uses raw %K, which reacts to every close. The slow stochastic averages raw %K over 3 periods before calculating %D, so it is smoother and gives fewer crossovers. The full stochastic lets you set all three parameters.

Is the stochastic oscillator better than RSI?

Neither is better in general. Stochastic compares the close with the recent high-low range and reaches its extremes more often; RSI compares the size of recent gains and losses and moves more slowly. Both describe past prices and both fail often.

Does an overbought stochastic mean price will fall?

No. Above 80 means the close is near the top of its recent range. In a strong uptrend the stochastic can stay above 80 for a long time while price continues to rise, so overbought readings are not sell signals on their own.

Not investment advice. This is general information and education, written without knowledge of your circumstances. It is not a recommendation to buy or sell any instrument. Past performance is not a reliable indicator of future results. Trading leveraged products carries a high risk of losing money. Risk warning