Skip to main content
Track Price-indicator divergence
2 / 16
Library

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.
Entries in this reading2 entries

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.

Educational research material, not investment advice. Historical source context does not establish present-day performance.
2 of 16 in the Price-indicator divergence track
19901-2 pp.Next on Price-indicator divergenceBuild a weekly leading sector composite from scaled transports and financialsAssemble the leading sector composite from four listed equity-group series: a transportation average, a bank index, an insurance index, and a financial index.
All readings on this track · 16 readings
  1. 1989Volume confirmation windows and exponential average construction
  2. 1990Constructing stochastic %K and %D from range position
  3. 1990Build a weekly leading sector composite from scaled transports and financials
  4. 1990Constructing stochastic K and D lines and divergence cues
  5. 1993Relative strength index events depend on the chosen input combination
  6. 1995Constructing a dual-horizon force index
  7. 1996Building a range-normalized divergence index from relative strength index
  8. 1998Treat RSI as a testable filter rather than a trigger
  9. 1999Primary-cycle windows, then stochastic confirmation
  10. 1999Stochastic rules versus buy and hold
  11. 2001Constructing confirmation filters for RSI overbought and oversold extremes
  12. 2003Constructing divergence-equivalent relative strength index and stochastic oscillators
  13. 2003Reverse-engineered RSI as a next-close projection
  14. 2003Scoring open versus resolved relative strength divergences
  15. 2003Bull-and-bear-balance from OHLC bar patterns
  16. 2003Constructing bull and bear balance from session paths
All 19 readings tagged Price-indicator divergence
Also on Price-indicator divergence5 readings