Skip to main content
Track Exponential smoothing
27 / 41
Library

1997issue C071-4

Construct a nested-average rainbow band and oscillator

A moving-average of a close price-basis can be nested up to ten times at the same length, then turned into a visual consensus band and a range-scaled rainbow-oscillator. Students can name each input, rebuild both the plot and spreadsheet forms, and compare the trend-filter with a simple moving-average baseline.

  • The rainbow stack takes a moving-average of a price-basis and then averages that result repeatedly, up to ten nested levels, each using the same length.
  • A single-level rainbow function returns only the nested-average that matches a chosen level, while rainbow-bandwidth is 100 times the spread of the nested averages divided by the highest-minus-lowest price over the same level window, and is left undefined when that range is zero.
  • The rainbow-oscillator is 100 times the close minus the mean of the selected nested averages, divided by the high-low price range over the level window, and can be read as a signed trend-filter around that consensus.
  • Default plotted inputs are a close price-basis, a length of 2 bars, and 10 average levels, and deeper nested-average lines are withheld until the current bar exceeds length times 10.
Entries in this reading3 entries

The nested-average stack

The rainbow stack begins with a moving-average of a price-basis. A moving-average is a lookback mean of ordered price observations, and it is the base smoother at each nesting level. That first result is then averaged again, and the same length is reused at every step, up to ten nested levels. A nested-average is an average whose input is a prior average of the same length, so each deeper level adds lag.

A single-level rainbow function returns only the nested-average that matches a chosen level rather than the entire stack. Level is how many nested averages enter the consensus, the rainbow-bandwidth, and the rainbow-oscillator. The plotted-line defaults shown in the archive are a close price-basis, a length of 2 bars, and 10 average levels.

Rainbow-bandwidth and the rainbow-oscillator

Rainbow-bandwidth is the spread between the highest and lowest nested averages, scaled by the high-low range of price over a matching lookback. In this construction it equals 100 times the spread of the nested averages divided by the highest-minus-lowest price over the same level window. When that price range is zero, rainbow-bandwidth is left undefined.

The rainbow-oscillator is a range-normalized reading of the gap between the latest close and the mean of the nested averages. It equals 100 times the close minus the mean of the selected nested averages, again divided by the high-low price range over the level window. Used as a trend-filter, that signed value is a range-normalized reading of whether price is above or below the nested-average consensus.

Plot timing and the oscillator panel

Line plots of the deeper nested averages are withheld until the current bar exceeds length times 10, matching the depth of the full stack. Until that bar count is reached, only the shallower lines that already have enough history should be drawn.

The oscillator panel plots an upper bandwidth, a mirrored lower bandwidth, and a histogram whose color depends on whether the oscillator is above or below zero.

Spreadsheet form

An equivalent spreadsheet construction uses ten successive two-bar averages, a signed pair of bandwidth series, and an oscillator that subtracts the ten-average mean from the close before scaling by an eleven-bar close range.

Editorial note: keep the two scalings distinct when you rebuild each form. The plotted rainbow-oscillator uses the high-low price range over the level window. The spreadsheet oscillator uses an eleven-bar close range.

Compare a moving-average baseline

Editorial classroom test: rebuild the stack on the same price-basis and length, then compare the nested-average consensus with a single moving-average of that same length. The extra nesting is the only construction change you are isolating.

Exponential-smoothing is a recursive smoother that can be compared with successive nested averages when students contrast alternative forecast-style baselines on the same series. The comparison is a construction check, not a claim about returns.

Educational research material, not investment advice. Historical source context does not establish present-day performance.
27 of 41 in the Exponential smoothing track
19981-3 pp.Next on Exponential smoothingFilter stacks that combine a moving average with exponential smoothingA moving average is complete only after the sampling interval closes, so an order staged before the next session cannot sit on the exact finished average.
All readings on this track · 41 readings
  1. 1984Matching average age across price filters
  2. 1984Residual-impact construction of exponential smoothers
  3. 1988Constructing simple and exponential moving averages as specified filters
  4. 1989Evaluating smoothed free reserves and funds-discount spreads
  5. 1990Integer construction of moving averages and exponential smoothing
  6. 1990Constructing incremental moving average filters
  7. 1991Constructing a double-smoothed stochastic oscillator
  8. 1991Constructing an exponential average from a smoothing weight
  9. 1991Constructing a double-smoothed momentum oscillator family
  10. 1991Competing certainty rules from exponential-average conditions
  11. 1991Hybrid construction of a mechanical timing system from smoothed signals
  12. 1991Constructing an exponential smoother from a moving-average length
  13. 1991Equivalent relative-strength-index constructions from a ratio and from smoothed momentum
  14. 1991Constructing the true strength index from double-smoothed momentum
  15. 1991True strength index from signed, double-smoothed momentum
  16. 1992Constructing exponential averages from simple lookbacks
  17. 1992Constructing exponential averages by the smoothing constant, startup length and lag
  18. 1992Nested range smoothing and windowed high-low damping
  19. 1992A weekly equity stance from the discount-bill spread
  20. 1993Double-smoothed stochastics momentum index construction
  21. 1993Constructing the true strength index with double exponential smoothing
  22. 1994Polarized fractal efficiency with a shared exponential smoother
  23. 1994Five-interval exponential smoothing of ten-interval signed path-efficiency
  24. 1994Hand-ranked price-volume series with stacked smoothing and stochastic
  25. 1995Range expansion filter on multi-horizon averages
  26. 1995The exponential smoothing constant from averaging lag
  27. 1997Construct a nested-average rainbow band and oscillator
  28. 1998Filter stacks that combine a moving average with exponential smoothing
  29. 2002Smoothed relative-strength construction from wilder-averaging and a price prefilter
  30. 2003Reverse-engineered RSI price targets
  31. 2004Piecewise trend quality from moving-average reversals
  32. 2004Nested smoothing recipes versus unaudited oscillator experiments
  33. 2008Weight construction beyond the N-day label
  34. 2010A consensus filter for objective RSI and smoothing construction
  35. 2012Sentiment-zone oscillator from signed closes
  36. 2012Classic RSI one-over-N smoothing versus the standard exponential average
  37. 2013Why exponential smoothing uses two over n plus one
  38. 2015Constructing ratio indicators with moving-average and exponential-smoothing weights
  39. 2015Slow relative-strength index from an exponentially smoothed price
  40. 2017Rebuilding the relative strength index as open-scale buy-sell pressure
  41. 2017Comparing Wilder and exponential smoothing inside a relative-strength index
All 183 readings tagged Exponential smoothing
Also on Exponential smoothing5 readings