Stochastic Oscillator: %K and %D Explained

How the close-versus-range calculation works, what the %K and %D lines actually tell you, and where the signal stops working.

How Stochastic Works (%K + %D)

George Lane built the stochastic oscillator in the late 1950s on a single observation about market behavior: in uptrends, prices tend to close near the top of the recent range; in downtrends, they close near the bottom. Everything the indicator does follows from that premise. It measures where today's close sits inside the recent high-low band and returns a number between 0 and 100.

The fast line is %K. Its formula is direct:

%K = (Close − LowestLown) / (HighestHighn − LowestLown) × 100

The default lookback period n is 14 bars. If the close sits at the top of the 14-bar range, %K reads 100. If it sits at the bottom, %K reads 0. A close exactly in the middle of the range produces 50. The line moves quickly because the lookback window is short and any one close can push the reading toward an extreme.

The slow line is %D. It's a 3-period simple moving average of %K. Smoothing %K removes the worst of the bar-to-bar jitter and gives you a trigger line that crosses underneath the faster reading. When chartists talk about a "stochastic crossover," they mean %K crossing %D.

Fast vs slow stochastic

The original Lane construction is now called the fast stochastic. It's %K and %D as described above. In live trading it's noisy. Most platforms default instead to the slow stochastic, which adds one extra smoothing pass: the raw %K is replaced with a 3-period SMA of itself, and the new %D becomes a 3-period SMA of that smoothed %K. The standard parameter string you'll see on most charts is (14, 3, 3): a 14-bar lookback, 3-period smoothing on %K, 3-period smoothing for the %D average.

The slow stochastic produces fewer signals but cleaner ones. Unless you're explicitly trying to scalp very short timeframes, slow is the version you want.

AAPL - Stochastic (14, 3) Open full chart →

The chart above plots a stochastic oscillator pane on AAPL. Watch how %K hugs the upper and lower bounds more tightly than a smoother oscillator would, because the close-to-range formula saturates faster than the gain-loss ratio that the Relative Strength Index uses.

Standard parameters: 14, 3, 3 on daily charts. Range is bounded 0 to 100. Overbought above 80. Oversold below 20. The %K line is the fast one. %D is the smoothed trigger. Crossovers between %K and %D are the primary signal.

Stochastic vs RSI

The Relative Strength Index (RSI) and the stochastic oscillator are both bounded momentum oscillators that share the 0-100 scale and both label extremes as overbought or oversold. That's where the similarity ends. They measure different things, behave differently at extremes, and produce different kinds of usable signals.

What each formula measures

The RSI Indicator computes the ratio of average gains to average losses over the lookback window. It cares about the magnitude of up-moves versus down-moves. Stochastic ignores the size of individual moves entirely and only asks where the close sits inside the recent high-low envelope. Two stocks that produced identical daily ranges over the past 14 bars but closed in different parts of the range will print very different stochastic readings and very similar RSI readings.

Sensitivity at the extremes

Stochastic saturates earlier and harder. Because the formula is bounded by the literal highest high and lowest low in the window, a single close at a new period high pins %K to 100. RSI, which averages gains and losses, takes longer to reach 70 and rarely touches 90 even on strong moves. In practical terms: stochastic spends more time above 80 and below 20 than RSI spends above 70 and below 30. The thresholds aren't directly comparable.

Smoothness and signal type

RSI is a smoother line, which makes it the better tool for divergence work. Tracing a clean lower high on RSI against a higher high on price is straightforward. Stochastic whips around enough that drawing the same divergence often produces ambiguous swing points. The flip side: stochastic crossovers between %K and %D give you a discrete trigger that RSI doesn't have. RSI's "centerline crossover" through 50 is the closest equivalent and it fires much less often.

When to pick which

Stochastic earns its place for crossover-driven entries inside ranges or at well-defined support and resistance levels. RSI earns its place for divergence detection on extended trends and for centerline trend filters. Traders who use both don't treat them as redundant. They're solving different problems.

MSFT - Stochastic (14, 3) Open full chart →

On MSFT, notice how the stochastic pane spends extended periods pinned above 80 during multi-month rallies. That's the saturation effect in action: the close keeps printing near the top of every new 14-bar window because the window itself is sliding up with price.

Trading Overbought/Oversold

The textbook rules are simple: above 80 is overbought, below 20 is oversold. The textbook then implies you should sell overbought and buy oversold. The textbook is wrong about the second step, and this is the single biggest source of losses for new stochastic traders.

Why straight reversion fails in trends

Stochastic measures close position inside the recent range. In a strong uptrend, the close keeps printing near the top of every new 14-bar window because the window itself is sliding up with price. The reading stays pinned above 80 for as long as the trend holds. During an established multi-week uptrend on a large-cap name, %K can sit above 80 for thirty or forty consecutive bars. Shorting every reading above 80 in that environment is a steady drip of losses.

The mirror case is identical. A stock making fresh lows day after day will park %K below 20 for weeks. Buying every dip into oversold territory in a downtrend is catching a series of falling knives.

The setup that works: range-bound reversion

Stochastic reversion works when the underlying price action is range-bound. A stock that's been chopping between a clear floor and ceiling for several weeks gives stochastic the conditions it was designed for. Each time price approaches the range floor, %K dips below 20. Each time price approaches the ceiling, %K pushes above 80. The reading and the level confirm each other.

A practical filter: only take stochastic reversion trades when the stock is below its 50-day Simple Moving Average and above its 200-day Simple Moving Average (the "no man's land" regime where neither trend dominates), or when price is visibly bracketing a well-defined horizontal level. If the 50 SMA is rising steeply and price is well above it, the regime is trending and stochastic reversion will fail.

The setup that works: trend-aligned pullbacks

A different way to use the extremes in a trending market: only take stochastic signals that line up with the larger trend. In a confirmed uptrend, wait for stochastic to pull back to oversold (below 20) on a normal retracement, then enter long when %K crosses back above 20. The trend is still up, momentum has just cooled, and you're buying the pause rather than fighting the direction.

The reverse works in confirmed downtrends. Stochastic rallies to overbought, %K crosses back below 80, and you have a setup that aligns with the dominant direction. The single most important mental shift here: in a trend, an extreme reading is a pullback, not a reversal. Trade it as a pullback.

NVDA - Stochastic (14, 3) Open full chart →

NVDA during its multi-quarter rallies shows the trap clearly. The stochastic pane stays pinned above 80 for stretches that last a month or longer. The trader who took the first overbought reading as a short signal would have been stopped out before the trend even reached its first meaningful pause.

The overbought/oversold rule of thumb: use the extremes as filters, not triggers. Wait for the cross back out of the extreme zone. Above 80 and pulling back below 80 is the signal, not the touch of 80 itself. Same for 20 in reverse. The cross out is the moment momentum actually shifts.

See an oscillator pane live on any stock

Add momentum indicators to your charts with one click. Real data, no paywall.

Open SPY chart

Stochastic Crossovers

The crossover between %K and %D is what distinguishes stochastic from a single-line momentum indicator. Two lines means two interactions: %K crossing above %D is bullish, %K crossing below %D is bearish. The crossover is the trigger most stochastic-based systems are actually built around.

The bullish cross

A bullish stochastic crossover happens when the fast %K line crosses up through the slower %D line. The reading is rising faster than its own smoothed average, which means recent closes are pushing higher inside the range. Momentum is turning up.

The crossover's location determines its weight. A bullish cross below 20 — inside the oversold zone — is the strongest version of the signal. It says momentum has been weak, price has been closing near range lows, and now that weakness is reversing. A bullish cross in the middle of the range (say between 40 and 60) is a much weaker event. The stochastic has wandered up from neutral, the %K has caught the %D from underneath, and almost nothing about the underlying balance has actually shifted.

The bearish cross

The mirror: %K crosses down through %D. Strongest when it happens above 80, weakest in the middle of the range. A bearish cross above 80 says the stock has been closing near range highs, buyers have been in control, and now that control is slipping. That's the timing signal swing traders use to short a stretched rally or trim long exposure.

Crossovers in the middle

Most stochastic crossovers happen in the 30-70 zone, and most of those crossovers don't matter. They're the indicator drifting back and forth across its own smoothed line while price wiggles inside a normal trading range. Treating every mid-range crossover as a trade signal is how new traders burn through commissions and account equity in flat markets.

A simple filter that cuts most of the noise: only act on crossovers that occur in the outer 20% of the range. Above 80 or below 20. Crossovers between 20 and 80 are observations, not triggers. This rule alone typically eliminates two-thirds of the signals stochastic produces while preserving most of the high-quality ones.

Pairing crossovers with price structure

The highest-conviction version of the trade combines a stochastic crossover with a meaningful price-structure level. A bullish %K/%D cross below 20 that occurs as price taps a multi-week horizontal support is a confluence trade. The level says buyers have stepped in here before. The crossover says momentum is turning up right now. Each signal validates the other.

Without the level, the crossover is just a number-on-a-line event. Stochastic on its own is rarely enough. Combined with horizontal support or resistance, prior swing points, or a moving average, the same crossover becomes a setup worth sizing into.

QQQ - Stochastic (14, 3) Open full chart →

On QQQ, the cleanest momentum reversals happen where an oversold extreme coincides with a tap of horizontal support that's been tested several times before. A stochastic crossover at exactly that point is what swing traders mean when they say a setup "lines up."

Set stochastic-style alerts in Risen

Build momentum-based alerts and combine them with price, volume, and trend filters in one rule.

Create free account

Common Mistakes

Trading every overbought and oversold reading

Stochastic spends real time pinned at its extremes during trends. A reading above 80 is not a sell signal. A reading below 20 is not a buy signal. They're observations about where the close sits inside the recent range, and in a strong trend that position is exactly where you'd expect it to be. The trader who shorts every overbought reading in a bull market produces a consistent losing strategy.

Ignoring the trend regime

Stochastic is a range-friendly indicator in a market that alternates between range and trend regimes. The single most useful filter you can add is a trend check. A long-term moving average (the 200 SMA works) and a medium-term one (the 50 SMA) tell you which regime you're in. Stochastic reversion trades belong in range regimes. Trend-aligned pullback entries belong in trend regimes. Mixing them up is the most common reason stochastic strategies underperform.

Using the fast stochastic on intraday charts

The original fast stochastic on a 1-minute or 5-minute chart fires constantly. Most of those signals are noise. If you're using stochastic on intraday timeframes, use the slow version with (14, 3, 3) parameters at minimum, and consider stretching the lookback to 21 or even 25 bars to cut the whipsaw rate. The point of an oscillator is to compress information about recent momentum into one number. If the number changes meaning every two bars, the compression isn't working.

Forcing stochastic into divergence work

People see divergence patterns on stochastic because the indicator is bounded and any series of swings creates highs and lows you can connect with a line. But stochastic's whippiness makes divergence ambiguous. Two analysts looking at the same chart will frequently draw the divergence between different swing points and reach different conclusions. If you want to trade divergence, use the RSI Indicator or MACD. Stochastic is built for crossover timing, not for divergence.

Skipping confirmation on the cross out

The cleanest trigger isn't %K hitting 20. It's %K crossing back up through 20 from below. The cross out is the moment the buying actually starts. Acting on the touch of the threshold rather than the exit from the threshold gets you in too early and gives the trade more room to grind against you before it turns. Wait for the cross out. The extra bar or two of patience costs almost nothing and dramatically improves entry quality.

Risen lets you build alert rules that combine an oscillator threshold with a confirmation cross, a moving-average filter, and a volume condition in a single rule so you don't have to watch the chart manually.

Keep Learning

Set stochastic alerts in Risen

Get notified on %K/%D crossovers and threshold breaks on any U.S. stock or ETF. Free to start.

Create free account