Stochastic Oscillator
- Category
- Technical Analysis
- Level
- Professional
Simple definition
A 0 to 100 gauge of where the latest close sits inside the recent high-low range. Near 100 means it closed near the top of that range, near 0 near the bottom.
Professional definition
Lane's oscillator. %K locates the close within the highest high and lowest low of a lookback, usually 14 periods, on a 0 to 100 scale; %D is a short moving average of %K, conventionally 3 periods, and the crossover of the two is the classic signal. Above 80 and below 20 are the usual thresholds.
Technical definition
%K is 100 times the close minus the lowest low, divided by the highest high minus the lowest low over the lookback; %D is an m-period moving average of %K, and the slow variant smooths %K once before %D is taken. The denominator is an extreme-value range, so one spike governs it for the whole window, the reading is undefined when the range is zero, and it saturates at 0 or 100 whenever the close is the window extreme — which happens continuously in a trend.
Academic definition
A bounded oscillator expressing the current closing price as its relative position within the empirical high-low range of a fixed lookback window, together with a smoothed signal line derived from that series.
Mechanism
The reading is a ratio of two distances on the same price scale, so it is dimensionless and bounded by construction. Because the denominator is the window's full extreme range, a single outlier bar can hold it wide for n periods and flatten the oscillator; and in a trend the close keeps printing at the window extreme, pinning the line near 0 or 100 while price continues on its way.
In practice
- Who uses it
- Technical analysts and systematic developers screening for momentum extremes, crossovers and divergence, mostly in range-bound markets.
- Why it matters
- It puts position-in-range on one fixed scale, so a single threshold can be applied across instruments and the close is compared with the range that contained it.
- Limitations
- It saturates in trends, so 80 and 20 are not reversal levels. Fast, slow and full variants smooth differently and give different numbers from the same prices.
Common mistakes
- Buying every cross back above 20 inside a downtrend.
- Treating fast and slow stochastic readings as one scale.
- Reading saturation at 100 as proof that a reversal is due.
Examples
In a steady uptrend the close prints near the window's high day after day, so %K sits in the 90s for weeks. Every cross back down looked like a sell signal and every one of them was inside a continuing trend.
Over the lookback the highest high is 120 and the lowest low 100, and the close is 115. %K is 75. With the two prior %K values 65 and 70, a three-period %D is 70.
- n = 14
- highest high over n = 120
- lowest low over n = 100
- close = 115
- previous %K values = 65 and 70
- m = 3
- close - lowest low = 115 - 100 = 15
- highest high - lowest low = 120 - 100 = 20
- %K = 100 x 15 / 20 = 75
- %D = (65 + 70 + 75) / 3 = 70
A reading of 75 says the close sat three quarters of the way up the window's range. It is a position, not a probability.
Mathematical foundation
Variables
| C_t | Current close | price units |
| H_n, L_n | Highest high and lowest low over the n-period lookback | price units |
| \%K | Raw stochastic: position of the close within the range | 0 to 100 |
| \%D | Signal line: m-period moving average of %K | 0 to 100 |
| n, m | Lookback and signal lengths; 14 and 3 are the common defaults | periods |
Procedure
Take the highest high and lowest low of the last n bars. Subtract the lowest low from the close, divide by the range, multiply by 100 to get %K. Average the last m values of %K to get %D. In the slow variant, smooth %K first and treat that smoothed series as %K.
Worked example
- n = 14
- H_n = 120
- L_n = 100
- C_t = 115
- m = 3 with previous %K of 65 and 70
- numerator = 115 - 100 = 15
- denominator = 120 - 100 = 20
- %K = 100 x 0.75 = 75
- %D = (65 + 70 + 75) / 3
Interpretation
A reading describes where the close fell inside the recent range: 50 is the middle of the range, not a balance of gains and losses. The crossover of %K and %D is a statement about the short-term direction of that position, nothing more.
Assumptions
- n = 14 and m = 3 are common defaults, not constants.
- The slow and full variants smooth %K before computing %D, so the same prices give different values under fast, slow and full settings; a level is only comparable within one fixed configuration.
- If the highest high equals the lowest low the ratio is undefined; platforms substitute a fixed value, commonly 50 or the previous reading.
- Highs and lows are taken from the bar extremes, which include wicks, so the measure depends on the data feed's handling of spikes.
- Bounded and range-based, so it saturates in trends and stays at an extreme while price continues; level-based reversal signals fail there.
- The denominator is an extreme-value statistic, so one spike dictates the scale for the whole lookback.
- It carries no information about the size of the moves inside the range, only about where the close ended up.
Related terminology
- related
- Relative Strength Index Overbought and Oversold Divergence Moving Average Convergence Divergence Timeframe Support and Resistance
Relative Strength Index
The stochastic asks where the close sits inside the high-low range. RSI asks how large average gains have been relative to average losses. Both run from 0 to 100 and answer different questions, so their extremes do not coincide.
Sources
New York Institute of Finance · 1999 · chapter on oscillators, including the stochastic and its %K and %D lines
Print source
CMT Association · discussion of momentum oscillators and threshold conventions
https://cmtassociation.org/wp-content/uploads/2019/01/Technical-Analysis-Modern-Perspectives-CMT-Association.pdf URL verified
Editorial status
Flagged by the editor as uncertain on a linguistic, mathematical or regulatory point.
