Concept

Stochastic Oscillator

Stochastic Oscillator, also known as fast/slow/full, %K/%D, stochastic cross, is a Momentum & Oscillators concept. The Library holds 16 implementations, each one a working definition you can pull into Quant.

Top Stochastic Oscillator indicators

16 total

What is the Stochastic Oscillator?

The Stochastic Oscillator, developed by George Lane in the 1950s, measures where the latest close sits inside the recent high-low range. Its %K line equals 100 times (close minus the lowest low of the lookback) divided by (highest high minus lowest low), so a reading of 80 puts the close in the top fifth of the last 14 bars' range (14 being the common length). %D, the signal line, is a 3-period simple moving average of %K.

Lane's premise was that momentum turns before price: in an advance, closes cluster near the top of the range and begin slipping toward the middle before the highs stop coming. Three variants trade speed for smoothness. Fast stochastic plots raw %K; slow stochastic uses a 3-period average of raw %K as its %K and smooths %D again; full stochastic exposes the lookback, the slowing, and the %D length as separate parameters.

The oscillator matters because its grammar became a template: 80/20 overbought/oversold zones, %K/%D crossovers, and divergence reads all generalize across the oscillator family, and descendants such as the Stochastic RSI and the Stochastic Momentum Index reuse the core calculation. It is fast, bounded, and blunt: strong trends pin it at the extremes, so regime context decides how it should be read.

How to calculate the Stochastic Oscillator

The calculation needs only highs, lows, and closes over a lookback window.

  1. 1Choose a lookback N (14 is conventional) and find the highest high and lowest low across those N bars.
  2. 2Compute raw %K: 100 times (close minus the lowest low) divided by (highest high minus the lowest low). The result is bounded between 0 and 100 by construction.
  3. 3Smooth if desired: the slow version uses a 3-period SMA of raw %K as its %K line, and %D is a 3-period SMA of whichever %K you plot. The full version makes all three lengths adjustable.
  4. 4Read the result through three lenses: position against the 80/20 zones, %K crossing %D, and divergence between oscillator swings and price swings.

How traders use it

  • As a pullback trigger inside trends: with a higher-timeframe trend filter pointing up, an oversold %K/%D cross back above 20 times entries in the trend's direction instead of fighting it.
  • As a mean-reversion gauge inside a trading range, fading excursions past 80/20 as the close's position in the range rotates; this is the read that fails when a breakout turns the range into a trend.
  • As a divergence engine: Lane himself emphasized divergence, price making a new swing extreme that %K does not confirm, with the crossover then serving as the trigger.
  • As a continuation read: Stochastic Pop style approaches buy a push above 80 and hold while the reading stays pinned, the deliberate inverse of the reversion interpretation.

Stochastic Oscillator vs related oscillators

RSI: RSI averages the size of up closes against down closes; the stochastic locates the close inside the high-low range. One responds to the magnitude of changes, the other to position within the range, so a quiet drift near the top of the range can keep the stochastic pinned while RSI eases back.

Williams %R: %R is the same range-location arithmetic measured from the top of the range: it equals %K minus 100, plotted on a 0 to -100 scale, traditionally without smoothing or a signal line. The information content is identical.

Stochastic RSI: The Stochastic RSI feeds RSI values, not prices, through this same formula, making it an indicator of an indicator: faster, pinned at its boundaries more often, and two derivations removed from price.

Stochastic Momentum Index: The SMI measures the close relative to the midpoint of the high-low range rather than to its extremes, then double-smooths the result, so it oscillates around zero and reads like a calmer, centered cousin.

More Stochastic Oscillator implementations

Related concepts · Stochastics

Concept family

Momentum & Oscillators

91 concepts mapped · 72 in the Library

Stochastic Oscillator FAQ

What do %K and %D mean on the Stochastic Oscillator?

%K is the main line: the close's position inside the lookback range, scaled 0 to 100. %D is a 3-period simple moving average of %K that serves as the signal line, so %K crossing %D is the classic trigger. In slow and full variants, %K is itself pre-smoothed before %D is computed.

What is the difference between fast, slow, and full stochastic?

Fast plots raw %K with a 3-period average as %D and reacts quickest. Slow shifts everything one smoothing step: its %K is the fast version's %D, and its %D smooths that line again. Full generalizes both by exposing lookback, slowing, and %D length as parameters, so fast and slow are special cases of full.

What are the best stochastic oscillator settings?

There is no best. The common default is 14,3,3; shorter lookbacks such as 5,3,3 trade smoothness for speed, longer ones fire less often, and heavier slowing suppresses whipsaw at the cost of lag. Settings interact with the instrument's volatility and your holding period, so they are choices to test, not answers to copy.

Is the Stochastic Oscillator a leading indicator?

Lane described it that way, arguing momentum fades before price turns, and divergences do sometimes precede swing turns. But every value is computed from past prices, and in trends the oscillator issues early warnings repeatedly without a turn arriving. Treat readings as evidence about the current swing, not as a forecast.

Why does the stochastic stay above 80 in a strong uptrend?

Because the formula measures exactly what a persistent advance does: closes keep finishing near the top of the recent range. A pinned reading signals one-way pressure rather than a broken indicator. Fading it without a regime check is the standard mistake; many trend systems act only on the eventual cross back below 80, if at all.

Build Stochastic Oscillator your way.

Quant writes, tests, and refines it with you — then it runs on LuxAlgo charting or ports to TradingView.