What Is the Stochastic Oscillator? Formula and How to Use It
By Forex & Brokers DeskUpdated Nov 10, 2026

Definition
The stochastic oscillator is a momentum indicator that shows where the latest close sits within the high-low range of recent periods, on a scale from 0 to 100.
Key takeaways
- The stochastic oscillator measures the close's position within the recent high-low range, not the size or speed of price changes.
- %K = (Close − Lowest Low) ÷ (Highest High − Lowest Low) × 100, usually over 14 periods; %D is its 3-period average.
- Above 80 is traditionally overbought and below 20 oversold, but strong trends can hold the indicator in either zone for long stretches.
- Signals come from zone readings, %K/%D crossovers and divergence.
- It works best in ranges and misfires in strong trends and choppy markets, so it is usually paired with a trend filter.
The stochastic oscillator is a momentum indicator that shows where the latest closing price sits within the high-to-low range of a set number of recent periods, expressed on a scale from 0 to 100. A reading of 100 means the close equals the highest high of the lookback window. A reading of 0 means it equals the lowest low. The default lookback is 14 periods. The indicator is drawn as two lines: %K, the raw reading, and %D, a three-period moving average of %K that serves as a signal line.
The underlying idea is simple. In a rising market, closes tend to cluster near the top of the recent range; in a falling market, near the bottom. When closes stop pressing toward the edge of the range, momentum is fading.
How the stochastic oscillator works
The oscillator is range-bound by construction. Because the close of any bar must fall somewhere between the lowest low and highest high of the window that includes it, %K can never go below 0 or above 100. That fixed scale is what makes overbought and oversold thresholds possible.
The %K formula
The stochastic formula for the main line is:
%K = (C − Ln) ÷ (Hn − Ln) × 100
where:
- C = the most recent closing price
- Ln = the lowest low over the last n periods
- Hn = the highest high over the same n periods
- n = the lookback, 14 by default
A “period” is one bar on whatever chart you are using. On a daily chart, a 14-period stochastic covers 14 trading days. On a one-hour chart it covers 14 hours, and on a five-minute chart it covers 70 minutes. The math is identical; only the time span changes.
Note that the formula uses the highest high and lowest low, not the highest and lowest closes. A long wick that sets a new extreme widens the range and pulls subsequent readings toward the middle. When the high and low of the window are equal (no price movement at all), the denominator is zero and the formula is undefined.
The %D line and the fast, slow and full versions
%D = 3-period simple moving average of %K
Because %D averages the last three %K values, it moves more smoothly and lags slightly behind %K. Crossovers between the two lines are the indicator’s most common trade signals.
The stochastic indicator comes in three common configurations:
- Fast stochastic. %K is the raw formula above, and %D is its three-period average. It reacts quickly but is noisy.
- Slow stochastic. The raw %K is first smoothed with a three-period moving average, and that smoothed line becomes the plotted %K. The plotted %D is then a three-period average of the smoothed %K. In effect, the slow stochastic’s %K line is the same as the fast stochastic’s %D line.
- Full stochastic. Lets you set all three values: the lookback, the %K smoothing period and the %D period. It is often written as Stochastic (14, 3, 3). Setting the %K smoothing to 1 reproduces the fast stochastic; setting it to 3 reproduces the standard slow stochastic.
Terminology varies. Some sources call %K the fast stochastic and %D the slow stochastic. Check which version and parameters a chart uses before comparing readings across platforms, because a “%K of 80” on a fast stochastic and on a slow one are not the same number.
Worked example (hypothetical)
The following figures are invented to show the mechanics. Assume a EUR/USD daily chart with a 14-period fast stochastic.
Day 1. Over the last 14 sessions, the highest high is 1.1050 and the lowest low is 1.0900. Today’s close is 1.1020.
- Distance above the low: 1.1020 − 1.0900 = 0.0120
- Range: 1.1050 − 1.0900 = 0.0150
- %K = 0.0120 ÷ 0.0150 × 100 = 80
The close sits 80% of the way up the 14-day range, right at the traditional overbought threshold.
Days 2 and 3. Assume the range is unchanged and the closes are 1.1005 and 1.0990.
- Day 2: (1.1005 − 1.0900) ÷ 0.0150 × 100 = 70
- Day 3: (1.0990 − 1.0900) ÷ 0.0150 × 100 = 60
%D on day 3 = (80 + 70 + 60) ÷ 3 = 70
On day 3, %K (60) is below %D (70). If %K had been above %D on the prior days, this would be a bearish crossover: closes are drifting away from the top of the range faster than the three-day average. Under the slow stochastic, that 70 would itself be the plotted %K, which shows why the slow version reacts later.
The same mechanics apply to stocks. A 14-day high of $150, low of $125 and close of $145 give (145 − 125) ÷ (150 − 125) × 100 = 80.
How to read the stochastic oscillator
Overbought and oversold zones
Above 80, the close is near the top of its recent range; below 20, it is near the bottom. These levels are conventions, not rules, and some traders use 70 and 30 instead.
“Overbought” describes position, not a forecast. In a strong uptrend, price keeps making new highs, so the close keeps landing near the top of the range and the stochastic can stay above 80 for weeks while price continues higher. Selling every time the line crosses 80 in that environment means fighting the trend. A more cautious reading is to wait for the oscillator to leave the zone (drop back below 80 or rise back above 20) as evidence that momentum has actually turned.
%K and %D crossovers
- Bullish crossover: %K crosses above %D. Traders give it more weight when it happens below 20.
- Bearish crossover: %K crosses below %D. It carries more weight above 80.
Crossovers in the middle of the scale occur often and say less, because neither side has reached an extreme. The fast stochastic generates many more crossovers than the slow version, which is the main reason most traders default to the slow or full stochastic.
Divergence
George Lane, who developed the indicator, regarded divergence as the first and most important signal it produces.
- Bullish divergence: price makes a lower low, but the stochastic makes a higher low. The new price extreme came with less downside momentum, which can mean sellers are losing force.
- Bearish divergence: price makes a higher high, but the stochastic makes a lower high, a sign that upward momentum is weakening.
Divergence can persist through several swings before price turns, or never lead to a reversal at all, so traders usually wait for a confirming event such as a crossover, a break of a trendline or a move back through a support or resistance level.
The 50 midline
Some traders treat 50 as a dividing line: readings above it mean closes are in the upper half of the range, readings below mean the lower half. It is a rough gauge of short-term bias rather than a signal on its own, and it appears in rule-based strategies like the one below.
Using stochastics with other indicators
Because its main weakness is false signals against a trend, the stochastic oscillator is most often combined with a tool that establishes direction.
- Trend filters. A moving average, such as a 50- or 200-period exponential moving average, or the average directional index can set a directional bias. A common rule is to take only bullish stochastic signals when price is above the average and only bearish ones when it is below.
- Support and resistance. An oversold crossover that forms at a known support level has a logical place for a stop just beyond the level.
- Other momentum tools. Requiring agreement with RSI or MACD filters out weaker signals, though these indicators all derive from price, so agreement is not independent confirmation.
- Volume tools. On-balance volume can help assess whether a divergence is backed by participation.
- Multiple timeframes. A higher-timeframe trend can define direction while the stochastic on a lower timeframe times entries.
A VWAP and stochastics strategy
One approach pairs the stochastic with the volume-weighted average price, using VWAP as the trend filter and the stochastic for timing, originally on a four-hour stock chart. The buy rules are:
- %K crosses above %D while both are below 20, and the close is above VWAP.
- %K and %D are between 50 and 80, and the close crosses above VWAP.
- %K crosses above %D with both below 80, and the close is above VWAP.
The sell rules mirror them:
- %K crosses below %D while both are above 80, and the close is below VWAP.
- %K and %D are between 20 and 50, and the close crosses below VWAP.
- %K crosses below %D with both above 20, and the close is below VWAP.
A long position opens when any buy rule is met and a short when any sell rule is met, closing the opposing position. Exits also trigger when price crosses back through VWAP or the stochastic signal reverses. Like any rule set, it should be tested on the market and timeframe where it will be used, for example by paper trading in a stock market simulator.
Choosing settings for different markets and timeframes
The lookback length controls sensitivity. Shorter lookbacks make the range narrower and more responsive, so the line swings between extremes more often and produces faster but noisier signals. Longer lookbacks smooth the line and produce fewer, later signals.
Common practice falls roughly into three bands:
| Lookback | Typical use | Trade-off |
|---|---|---|
| 5 to 9 periods | Day trading and scalping in volatile markets such as crypto, commodities and some forex pairs | Fast signals, more false signals |
| 14 periods (default) | Swing trading and range-bound markets | Balance of speed and noise |
| 21 to 28 periods | Trend-following on steadier assets such as large-cap stocks and major indexes | Fewer signals, more lag |
Increasing the %K smoothing or %D period has a similar effect to lengthening the lookback: fewer crossovers, later timing.
Readings can also differ slightly between platforms trading the same instrument, because the highs, lows and closes in the window depend on the price feed and on when each platform’s daily bar closes.
Origin of the stochastic oscillator
George Lane, a technical analyst, developed the indicator in the late 1950s. He said the stochastic follows not price or volume but the speed, or momentum, of price, and that momentum changes direction before price does, which is why he put divergence at the center of his method. The fast, slow and full variants grew out of his work as traders sought different levels of sensitivity, and the indicator is now built into most charting platforms.
Limitations of the stochastic oscillator
- False signals in strong trends. The indicator can stay overbought throughout an uptrend and oversold throughout a downtrend. Treating zone readings as reversal calls in those conditions produces repeated losing trades.
- Whipsaws in choppy markets. In volatile, directionless conditions, %K and %D can cross back and forth frequently, generating buy and sell signals that price never follows through on.
- Lag. The indicator is calculated from past highs, lows and closes, and %D and the slow version add more smoothing. Despite its reputation for anticipating turns, every reading describes bars that have already closed.
- No information about magnitude. A reading of 90 says the close is near the top of the range; it says nothing about how wide that range is. A 90 inside a narrow range and a 90 inside a wide one represent very different price moves. A volatility measure such as the average true range fills that gap.
The indicator also provides no risk control: stop placement and position sizing decide what a false signal costs.
Stochastic oscillator vs. RSI and other oscillators
RSI. The relative strength index and the stochastic both run from 0 to 100 and both mark overbought and oversold zones, so they are often confused. They measure different things. The stochastic looks at where the close sits within the high-low range. RSI compares the average size of up closes to the average size of down closes, so it reflects the speed and magnitude of price changes. A market that grinds higher by small amounts can show a high stochastic reading (closes near the top) while RSI stays moderate. RSI is generally considered better suited to trending markets, and the stochastic to sideways ones. RSI’s conventional thresholds are 70 and 30 rather than 80 and 20.
Williams %R. This uses the same inputs as the stochastic but measures the close’s distance from the highest high: %R = (Hn − C) ÷ (Hn − Ln) × −100. It runs from 0 to −100 and equals the raw %K minus 100, so it is essentially the fast %K on an inverted scale without a signal line.
KDJ indicator. A stochastic variant that adds a third line, J, usually calculated as J = 3 × K − 2 × D. The J line exaggerates the gap between K and D and can move outside the 0 to 100 range.
Commodity channel index (CCI). CCI measures how far price has deviated from its average relative to typical deviation. It is not bounded, so it has no fixed ceiling or floor.
Stochastic RSI. This applies the stochastic formula to RSI values instead of prices, measuring where RSI sits within its own recent range. It is more sensitive than either parent indicator.
FAQs
What does "stochastic" mean in trading?
It is simply the name of this indicator, not a reference to random processes in the statistical sense. Traders often shorten it to stochastics or stoch, and "Stochastics (14)" means the indicator calculated with a 14-period lookback.
The Bottom Line
Traders who time entries in sideways markets get the most use from the stochastic oscillator, since it tracks where closes land within a recent range. In strong trends it can stay overbought or oversold for weeks, so pairing it with a trend filter such as a moving average or VWAP reduces false signals. Its readings lag, say nothing about the size of moves, and offer no risk control, so stops and position sizing still decide outcomes.














