Momentum

Stochastic Oscillator (%K and %D)

The stochastic oscillator explained: %K and %D, the 20/80 zones, crossovers, how it differs from RSI and stochastic alerts.

4 min readUpdated

The Stochastic Oscillator answers a simple question: where did the price close within its recent range? 100 means at the very top of the range of the last N bars, 0 at the very bottom. Its idea, by George Lane: in uptrends prices close near their highs, in downtrends near their lows, and momentum changes before price does.

What it measures

where and are the highest high and lowest low of the last N bars (the same channel as Donchian), and is the current close. If the range is zero (a flat market) %K is 50.

Unlike RSI, Stochastic uses highs and lows, not only closes, and it has no memory beyond its window: as soon as an old extreme leaves the window, the range changes.

Try it

Notice how %K touches 100 or 0 easily and then snaps back, and how %D trails it.

Price%K%DExample market · hover to read values
Price, %K, %D on an example market: a rise, a sideways range, a sharp drop and a recovery.113.1highlow8020

How Subtrigger computes it

OutputStream (ETH on Bybit)Meaning
kind:stoch_14_3_1m@bybit.spot:ETHUSDT:k%K, the fast line
dind:stoch_14_3_1m@bybit.spot:ETHUSDT:d%D, the 3-bar average of %K

Highs and lows come from the bars Subtrigger builds from ticks, the forming bar included. A first value needs 16 bars (14 for the range, plus 2 more for three values of %K). Stocks use 5-minute bars: ind:stoch_14_3_5m@nasdaq.stocks:MSFT:k.

How to read it

ReadingMeaning
%K above 80closing near the top of the 14-bar range
%K below 20closing near the bottom
%K crosses above %D below 20bullish turn from oversold
%K crosses below %D above 80bearish turn from overbought
%K pinned near 100 for many barsstrong trend: the price keeps making new highs

Alert ideas

Oversold on a crypto pair:

Alert idea

ETHUSDT Stochastic 14 %K · 1m · Bybit < 20

Create this alert

The fast line crossing above the slow line:

Alert idea

ETHUSDT Stochastic %K · 1m · Bybit > ETHUSDT Stochastic %D · 1m · Bybit

Create this alert

Stochastic vs RSI

StochasticRSI
Useshigh, low, closeclose
Questionwhere is the close in the range?how much of the movement was up?
Speedfast, hits extremes oftenslower, smoother
Memoryonly its windowfades exponentially
Zones20 / 8030 / 70

Many traders use both: Stochastic for timing, RSI for the bigger momentum picture.

For pros

  • Range sensitivity. A single spike sets the high or low of the window for N bars and compresses %K for all of them. After big wicks, read Stochastic with care.
  • Bull/bear setups. Lane's own favourite signal was a divergence between %D and price at extremes, not the plain zone cross.
  • Combine with a channel. %K is the position of the close inside the Donchian channel of the same period.
  • RSI: the smoother oscillator.
  • Donchian Channels: the range Stochastic measures against.
  • Bollinger %B: position inside a volatility band instead of a high–low range.

FAQ

What do 14 and 3 mean?

14 is the number of bars of the high–low range, 3 is the number of %K values averaged into %D.

Why is %K exactly 100 sometimes?

The current close is the highest price of the last 14 bars, i.e. at the very top of the range.

Should I alert on %K or %D?

%K for speed, %D for fewer false signals. For "slow stochastic" strategies, use %D.