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.
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.
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