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

2018issue C0748-55

Deviation-Scaled Moving Average construction from a two-bar difference

A Deviation-Scaled Moving Average is assembled from a two-bar close difference, a Super Smoother, a Lookback Period Root Mean Square, and an Adaptive Alpha applied to Close. The same construction is restated as a reusable overlay and as a two-average crossover rule.

  • The construction starts with a two-bar close difference that is intended to place zeros at DC and Nyquist and to produce a nominal zero-mean series before smoothing.
  • A Super Smoother whose coefficients come from the Lookback Period is applied to that difference, then a Period-length Root Mean Square rescales the smoothed series into standard-deviation units when the Root Mean Square is not zero.
  • Adaptive Alpha is the absolute Scaled Filter times 5 divided by Period and is used as the coefficient of a one-pole recursion on Close.
  • Vendor implementations treat Period as a required positive lookback, often shown at 40 bars, and a demonstration pair uses FastPeriod 40 and SlowPeriod 100 with next-bar market entries when the faster average crosses the slower average.
Entries in this reading2 entries

How the pieces fit

The July 2018 construction begins with a two-bar close difference, applies a Super Smoother to that difference, rescales the smoothed series with a Lookback Period Root Mean Square, and then forms an Adaptive Alpha for a one-pole recursion on Close. The finished series is the Deviation-Scaled Moving Average.

The same construction is restated across platforms as a reusable function plus a chart overlay, with alerts or plots on price crossing the average, so the filter can be rebuilt rather than only visually inspected.

A two-bar difference before smoothing

The construction begins with a two-bar close difference. That difference is intended to place zeros at DC and Nyquist and to produce a nominal zero-mean series before smoothing.

Super Smoother coefficients

A Super Smoother is then applied to that two-bar difference using coefficients a1, b1, c1, c2, and c3 derived from the Lookback Period.

The Super Smoother coefficients use a1 = exp(-1.414 * pi / (0.5 * Period)), b1 = 2 * a1 * cos(1.414 * 180 / (0.5 * Period)), c2 = b1, c3 = -a1 * a1, and c1 = 1 - c2 - c3.

Root Mean Square scaling

A Period-length Root Mean Square of the smoothed series is computed and used to rescale that series into standard-deviation units, provided the Root Mean Square is not zero. That rescaled series is the Scaled Filter.

Adaptive Alpha on Close

The adaptive coefficient is formed as the absolute Scaled Filter times 5 divided by Period, then used as Adaptive Alpha in a one-pole recursion on Close.

Inputs, overlays, and a two-average cross

Vendor implementations treat Period as a required positive lookback, with common demonstration defaults of 40 bars and a MetaStock input range of 2 to 200.

A demonstration strategy constructs two deviation-scaled averages with FastPeriod 40 and SlowPeriod 100 and issues next-bar market entries when the faster average crosses the slower average.

Daily SPY with a 40-period Deviation-Scaled Moving Average

Traders should see a 40-period DSMA tracking daily SPY from late 2016 through 2017: it stays close in quiet stretches and still climbs with the February and autumn advances instead of lagging far behind. Axis dates and the 23 Dec 2016 cursor bar (open 220.29, high 220.53, low 220.03, close 220.52) come from the spreadsheet overlay; the DSMA path and later closes were read off that plot.
Traders should see a 40-period DSMA tracking daily SPY from late 2016 through 2017: it stays close in quiet stretches and still climbs with the February and autumn advances instead of lagging far behind. Axis dates and the 23 Dec 2016 cursor bar (open 220.29, high 220.53, low 220.03, close 220.52) come from the spreadsheet overlay; the DSMA path and later closes were read off that plot.SPY · Daily · 2016-12-23T00:00:00.000Z to 2017-12-29T00:00:00.000Z

Period is 40 on 256 daily bars from 23 Dec 2016 to 29 Dec 2017. Super Smoother coefficients printed on the sheet are a1 0.8008, b1 1.5623, c2 1.5623, c3 -0.6413, c1 0.0790. Interior readings are approximate against a 10-point price grid.

Educational research material, not investment advice. Historical source context does not establish present-day performance.
39 of 39 in the Commodity Channel Index track
1988Track finished · Next track: Correlation analysisConstructing a lead-aware correlation coefficient74 readings
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