The stochastic oscillator measures where the current close sits within the high-low range of a recent period, on a 0-100 scale. A high reading means price is closing near the top of its range (strong momentum); a low reading means near the bottom. Like RSI, it's a momentum gauge, not a price gauge.
%K and %D
It has two lines: %K (the raw stochastic) and %D (a smoothed moving average of %K, the "signal line"). Traders watch for %K crossing %D, and for readings above 80 ("overbought") or below 20 ("oversold"). Crossovers in the extreme zones are the traditional signals.
Why it whipsaws in trends
The stochastic is a range tool. In a strong trend, it pins in the extreme zone (above 80 in an uptrend) and throws constant false "overbought" signals while price keeps climbing. It shines in choppy, mean-reverting conditions and fails badly in trending ones — so the regime matters more than the reading.
In a range, the stochastic is useful. In a trend, it's a whipsaw machine.
The disciplined use
Use the stochastic as a mean-reversion context tool in ranges, and largely ignore its extremes in trends. Divergence — price making a new high while the oscillator doesn't — can hint momentum is fading, but it's a warning, not a timer. Combined with structure and regime, it's one honest input.