2006issue C081-9
Constructing a trend filter from a cycle-length moving average and a highpass residual
A market series can be rebuilt as an instantaneous trendline plus a smoothed Highpass filter residual. The cycle-length Moving average cancels the dominant cycle so price is reconstructed from explicit trend and cycle parts.
- A simple Moving average whose length equals the measured dominant cycle is constructed to cancel that cycle and its harmonics while passing lower-frequency components.
- The instantaneous trendline is assembled as that cycle-length simple Moving average plus half of a three-bar-weighted momentum or slope term.
- The Highpass filter residual uses a stated alpha and a first-difference recursion, then a three-bar weighting, with a first-difference fallback when fewer than four bars are available.
- The market-model series is the sum of the instantaneous trendline and the smoothed Highpass filter residual, with default inputs of median or mid-range price and a length of 20 bars.
A constructed market series
The archive workflow builds a market-model series from two explicit parts. One part is an instantaneous trendline that starts from a cycle-length Moving average. The other is a Highpass filter residual that is smoothed and added back to that trendline.
The sum reconstructs price from explicit trend and cycle parts. The Trend filter in this workflow is the assembled instantaneous trendline, not a separate unexplained series.
The cycle-length moving average
A simple Moving average whose length equals the measured dominant cycle is constructed to cancel that cycle and its harmonics while passing lower-frequency components.
The instantaneous trendline
The instantaneous trendline is assembled as the cycle-length simple Moving average plus half of a three-bar-weighted momentum or slope term.
The highpass residual
The Highpass filter residual uses an alpha of (1 - sin(360 / Length)) / cos(360 / Length) and a first-difference recursion of the form 0.5 * (1 + alpha) * (Price - Price[1]) + alpha * HP[1].
The Highpass filter output is then three-bar weighted as (HP + 2*HP[1] + 2*HP[2] + HP[3]) / 6, with a first-difference fallback when fewer than four bars are available.
Reconstructing the series
The market-model series is the sum of the instantaneous trendline and the smoothed Highpass filter residual, reconstructing price from explicit trend and cycle parts.
Default construction inputs in the supplied implementations include median or mid-range price and a length of 20 bars.
E-mini S&P 500 rebuilt from the instantaneous trendline and highpass residual

Interior points are digitized from the raster to the nearest few index points. The model and trend use median price (H+L)/2 and length 20. The cyclic-component pane on the same figure uses length 15 and is omitted because it is on a different scale.
All readings on this track · 7 readings
- 2006Constructing lowpass, highpass, and finite impulse response filters from one recurrence
- 2006Constructing a trend filter from a cycle-length moving average and a highpass residual
- 2014Constructing a roofed stochastic from highpass and lowpass stages
- 2014The dual-K highpass roofing filter is unfinished until three choices are written together
- 2015Constructing a decycler from high-pass cancellation
- 2015Constructing decycler oscillators from highpass and bandpass filters
- 2020Finite-memory truncation for cycle filters