1987issue C061-7
Constructing the commodity channel, average directional, and relative strength indexes on a shared cycle scale
Rebuild the commodity channel index, the average directional index, and the relative strength index as one pipeline. Each model chooses a price increment, averages it on a cycle-linked window, forms a guarded ratio, and maps the result onto the same 140-to-190 band.
- Editorial grouping: treat the three oscillators as one pipeline whose stages are increment, cycle average, guarded ratio, and mapped display.
- The commodity channel index starts from typical price and a full dominant-cycle lookback. The other two start from increment series and a quarter-dominant cycle.
- Guarded ratios write 165 or one half when both component averages are zero, so the routine does not form a ratio from an empty sum.
- Display clipping and a shared band from 140 to 190 keep all three traces on the same vertical scale, with interior guide lines.
A shared construction pipeline
Editorial reading: TradersWeek treats the commodity channel index, the average directional index, and the relative strength index as one construction pipeline with interchangeable inputs.
The shared stages are: choose a price increment, average it over a cycle-linked window, form a guarded ratio, then smooth and map the result onto a shared scale.
The teaching aim, also editorial, is to rebuild each stage so the three models differ by what they feed the pipeline, not by unexplained formulas.
What the work matrix holds
A work matrix stores temporary columns before the final ratio is formed.
Those columns hold typical prices for the commodity channel index, directional increments for the average directional index, or close-to-close changes for the relative strength index.
Commodity channel index
The commodity channel index is a cycle-window residual of typical price, divided by the mean absolute deviation of that residual and then scaled for display.
Commodity-channel construction first replaces each bar with typical price, the mean of its high, low, and close, then replaces that series with a moving average whose length is the dominant cycle.
That full-cycle window is the dominant-cycle lookback. It averages typical price and the absolute deviations of the residual.
The commodity-channel residual is divided by that dominant-cycle average of absolute deviations, scaled so the interval from minus two to plus two occupies the vertical band from 140 to 190, and clipped at those band edges.
Display clipping forces the unbounded ratio to stay inside the fixed vertical band so extreme readings do not leave the plot.
Average directional index
Here the average directional index is built as a directional-trend oscillator: successive high and low increments are separated, averaged, and turned into a signed, guarded ratio.
Average-directional construction compares the change in successive highs with the change in successive lows, keeps only the larger increment, and writes zeros to both sides when neither extreme expands.
The plus and minus directional increment series are each averaged over a quarter-dominant-cycle window before any ratio is formed. That shorter window is one fourth of the dominant cycle.
If both directional averages are zero, the routine writes the midpoint display value 165 instead of computing a ratio. Otherwise the signed ratio of their difference to their sum is mapped into the 140-to-190 band and averaged again over the quarter-dominant cycle.
Relative strength index
The relative strength index is a twice-smoothed ratio of averaged up closes to the sum of averaged up and down closes.
Relative-strength construction records successive close-to-close changes and accumulates the up moves and the down moves as two separate quarter-dominant-cycle averages.
When both relative-strength component averages are zero, the interim ratio is set to one half. Otherwise it is the up average divided by the sum of the two averages.
A second quarter-cycle average is then mapped from the unit interval onto the shared 140-to-190 band.
One display band and two lookbacks
All three oscillators share one vertical display region from 140 to 190 with interior guide lines.
They differ in the lookback the operator supplies: a full dominant-cycle length for the commodity channel index versus a shorter cycle or day count for the directional-trend and relative-strength routines.
All readings on this track · 39 readings
- 1982Three gates on a 1982 pork-belly short
- 1982Scale-free Commodity Channel Index construction
- 1986Constructing a commodity channel index and a regression price channel
- 1987Constructing scaled OHLC matrices for study overlays
- 1987Constructing the commodity channel, average directional, and relative strength indexes on a shared cycle scale
- 1992Eleven-bar commodity channel index from typical price and mean deviation
- 1992Evaluating Commodity Channel Index breakout versus range rules
- 1992Evaluating breakout and CCI rules as complete mechanical procedures
- 1993Constructing stochastic, RSI and CCI inputs for forecasts
- 1993Nested centered channels with a commodity channel index confirmation gate
- 1993Listed-option timing as three separable clocks
- 1994Constructing an eleven-period commodity channel index
- 1994Confirming Elliott wave turns with channels and the commodity channel index
- 1995Commodity Channel Index band rules lag zero-line timing
- 1995Building the commodity channel index from typical price
- 1995Staged reversal rules with commodity channel index and average channels
- 1995Commodity channel index construction from typical price to a smoothed zero line
- 2001Reader tests for unfinished lookback oscillators
- 2002Constructing the commodity channel index from typical price
- 2003Breadth-filtered commodity channel index entry and exit rules
- 2003Constructing the Commodity Channel Index from typical price and scaled deviation
- 2003A shallow, poorly participated advance is an unconfirmed trend
- 2003CCI and RSI parameter defaults as scaling conventions
- 2003A cost and capital audit of a Commodity Channel Index trade engine
- 2003Commodity channel index peak divergence as an exit after twin patterns
- 2004Constructing the Commodity Channel Index from typical price
- 2004Constructing the Commodity Channel Index from typical price and mean deviation
- 2006Building custom indicators from the Commodity Channel Index, a least squares moving average and a rule-based entry
- 2012Confirming breakouts and retracements with CCI, ADX, and averages
- 2012Stacking oscillator lookbacks into a heatmap mosaic
- 2013Constructing a consensus and volatility-normalized value oscillator
- 2013Walk-forward system evaluation with a commodity channel index and chandelier exits
- 2014Dual detrended oscillators and dual Bollinger Band channels
- 2014RSI, CCI, and moving-average trend-filter construction
- 2014Dual RSI, a moving average, and CCI as a confirmation stack
- 2017Constructing dual-average cross and channel-index filters
- 2018Treat CAM as a classification layer before confirmation becomes an entry
- 2018Four-state slope labels gated by a moving average and a commodity channel index
- 2018Deviation-Scaled Moving Average construction from a two-bar difference