1990issue C011
Constructing stochastic %K and %D from range position
The stochastic oscillator maps the latest close onto a 0-100 scale inside a chosen high-low window. This archive note builds the raw %K line and the companion %D line from that range position, then treats a zone-conditioned cross and price-indicator divergence as separate signal designs.
- The stochastic oscillator reports the latest close as a percentage of the high-low range over a chosen lookback, scaled from 0 to 100.
- %K is the raw range-position reading over lookback n, commonly five bars, and %D is a three-period form of the same calculation.
- A zone-conditioned cross treats a %K move through %D as a change signal only after both lines have entered the overbought zone or the oversold zone.
- Price-indicator divergence, a mismatch between the path of price and the path of %D, is a separate reversal hypothesis from the cross rule.
The close as a range percentage
The stochastic oscillator is a two-line indicator that locates the latest close inside a chosen high-low window and maps that position onto a 0-100 scale. It reports the latest close as a percentage of the high-low range over a chosen lookback.
The construction is motivated by the observation that falling markets tend to close near period lows and rising markets near period highs. The same close-versus-range construction is described as usable on monthly, weekly, or intraday bars, not only daily bars.
How %K and %D are built
The raw line, labeled %K, uses the current close, the lowest low, and the highest high over lookback n. Lookback n is the number of bars that define those extremes and is commonly set to five. %K is the unsmoothed range-position reading, also called the raw value.
The companion line, labeled %D, is a three-period form of the same range-position calculation used for %K. The two lines are plotted together as the stochastic oscillator.
A zone-conditioned cross
A %K cross through %D is treated as a change signal only when both lines have already entered an overbought zone or an oversold zone. That zone-conditioned cross counts the intersection only after both lines are in an extreme zone.
Price-indicator divergence as a second design
A second construction tracks whether price and %D move out of step. That price-indicator divergence is a mismatch between the path of price and the path of %D, and it is treated as a separate reversal hypothesis.
All readings on this track · 16 readings
- 1989Volume confirmation windows and exponential average construction
- 1990Constructing stochastic %K and %D from range position
- 1990Build a weekly leading sector composite from scaled transports and financials
- 1990Constructing stochastic K and D lines and divergence cues
- 1993Relative strength index events depend on the chosen input combination
- 1995Constructing a dual-horizon force index
- 1996Building a range-normalized divergence index from relative strength index
- 1998Treat RSI as a testable filter rather than a trigger
- 1999Primary-cycle windows, then stochastic confirmation
- 1999Stochastic rules versus buy and hold
- 2001Constructing confirmation filters for RSI overbought and oversold extremes
- 2003Constructing divergence-equivalent relative strength index and stochastic oscillators
- 2003Reverse-engineered RSI as a next-close projection
- 2003Scoring open versus resolved relative strength divergences
- 2003Bull-and-bear-balance from OHLC bar patterns
- 2003Constructing bull and bear balance from session paths