Skip to main content
Track Commodity Channel Index
4 / 39
Library

1987issue C041-8

Constructing scaled OHLC matrices for study overlays

Editorial view: a moving average, a commodity channel index, and a relative strength index can sit on the same chart only after date-aligned OHLC rows, dummy-record skipping, integer-to-price conversion, and a common range-scale are locked into one price-matrix.

  • Editorial view: the reserved overlays share a chart only after date-aligned OHLC rows, dummy-record skipping, conversion-factor pricing, and a common range-scale are locked.
  • Each daily record is a 40-character string unpacked into an eight-row price-matrix; the charting path uses date, high, low, and close.
  • The loader skips dummy-records, fills a working-window from the newest valid sessions backward, and applies a range-scale to a fixed pixel frame.
  • Study-row output stays in memory only, and the same chart already reserves later overlay commands for a moving average, a commodity channel index, and a relative strength index.
Entries in this reading3 entries

A shared input contract

Editorial view: a moving average, a commodity channel index, and a relative strength index can sit on the same chart only after date-aligned OHLC rows, dummy-record skipping, integer-to-price conversion, and a common vertical scale are locked in.

The archive facts describe a historical workflow that builds one price-matrix first. The reserved studies are scheduled as later overlays on that matrix.

Unpacking daily records

Each daily file record is a 40-character string unpacked into an eight-row by N-column working array. That array is the price-matrix: one column per session, holding date, prices, volume, open interest, and a study slot.

The charting path uses only date, high, low, and close. The remaining rows hold open, open interest, volume, and a study slot.

Conversion-factor and dummy-records

Open, high, low, and close are stored as integers that require a conversion-factor. When quotes are encoded in fractional ticks, a further divisor is applied after that header scale.

A dummy-record keeps a valid date but fills the data fields with nines so the loader can skip them. Dummy weekday records therefore stay in the file as skippable non-sessions.

Working-window and range-scale

A file must contain at least 50 records. The loader fills a 50-session working-window from the newest valid observations backward.

Highest high and lowest low over that window rescale high, low, and close onto a 120-pixel vertical range with a five-pixel top offset. Editorial view: that range-scale is the common vertical map later overlays use.

The plot frame is 120 pixels high by 200 pixels wide, with a horizontal mark for each trading day in the window.

Study-row and reserved overlays

Study output lives in memory only and is not stored on disk. The study-row is an in-memory indicator slot that is not written back to the daily file. Extra study series may overwrite unused price rows.

The same chart already reserves commands for a moving average, a commodity channel index, and a relative strength index, which are scheduled as later overlays on this price matrix.

Educational research material, not investment advice. Historical source context does not establish present-day performance.
4 of 39 in the Commodity Channel Index track
19871-7 pp.Next on Commodity Channel IndexConstructing the commodity channel, average directional, and relative strength indexes on a shared cycle scaleEditorial grouping: treat the three oscillators as one pipeline whose stages are increment, cycle average, guarded ratio, and mapped display.
All readings on this track · 39 readings
  1. 1982Three gates on a 1982 pork-belly short
  2. 1982Scale-free Commodity Channel Index construction
  3. 1986Constructing a commodity channel index and a regression price channel
  4. 1987Constructing scaled OHLC matrices for study overlays
  5. 1987Constructing the commodity channel, average directional, and relative strength indexes on a shared cycle scale
  6. 1992Eleven-bar commodity channel index from typical price and mean deviation
  7. 1992Evaluating Commodity Channel Index breakout versus range rules
  8. 1992Evaluating breakout and CCI rules as complete mechanical procedures
  9. 1993Constructing stochastic, RSI and CCI inputs for forecasts
  10. 1993Nested centered channels with a commodity channel index confirmation gate
  11. 1993Listed-option timing as three separable clocks
  12. 1994Constructing an eleven-period commodity channel index
  13. 1994Confirming Elliott wave turns with channels and the commodity channel index
  14. 1995Commodity Channel Index band rules lag zero-line timing
  15. 1995Building the commodity channel index from typical price
  16. 1995Staged reversal rules with commodity channel index and average channels
  17. 1995Commodity channel index construction from typical price to a smoothed zero line
  18. 2001Reader tests for unfinished lookback oscillators
  19. 2002Constructing the commodity channel index from typical price
  20. 2003Breadth-filtered commodity channel index entry and exit rules
  21. 2003Constructing the Commodity Channel Index from typical price and scaled deviation
  22. 2003A shallow, poorly participated advance is an unconfirmed trend
  23. 2003CCI and RSI parameter defaults as scaling conventions
  24. 2003A cost and capital audit of a Commodity Channel Index trade engine
  25. 2003Commodity channel index peak divergence as an exit after twin patterns
  26. 2004Constructing the Commodity Channel Index from typical price
  27. 2004Constructing the Commodity Channel Index from typical price and mean deviation
  28. 2006Building custom indicators from the Commodity Channel Index, a least squares moving average and a rule-based entry
  29. 2012Confirming breakouts and retracements with CCI, ADX, and averages
  30. 2012Stacking oscillator lookbacks into a heatmap mosaic
  31. 2013Constructing a consensus and volatility-normalized value oscillator
  32. 2013Walk-forward system evaluation with a commodity channel index and chandelier exits
  33. 2014Dual detrended oscillators and dual Bollinger Band channels
  34. 2014RSI, CCI, and moving-average trend-filter construction
  35. 2014Dual RSI, a moving average, and CCI as a confirmation stack
  36. 2017Constructing dual-average cross and channel-index filters
  37. 2018Treat CAM as a classification layer before confirmation becomes an entry
  38. 2018Four-state slope labels gated by a moving average and a commodity channel index
  39. 2018Deviation-Scaled Moving Average construction from a two-bar difference
All 40 readings tagged Commodity Channel Index
Also on Commodity Channel Index5 readings