2020issue C0748-56
Truncated bandpass construction as a finite-length trend filter
July 2020 teaching implementations rebuild a recursive bandpass over a finite lookback, force the two oldest stored states to zero, and compare that truncated reading with the untruncated baseline on the same close prices.
- The untruncated bandpass is computed from the two-bar close difference plus two lagged filter terms whose coefficients come from the period and bandwidth cosines.
- Truncation applies the same recursive coefficients over a finite lookback and forces the two oldest stored states to zero.
- A zero crossing of the truncated reading is the defined event for reversing the signed trend-filter state on the next bar.
- The construction limits the data range so temporary extremes have less lasting influence on the output than they do in the infinite-memory baseline.
What the construction rebuilds
The July 2020 implementations start from a recursive bandpass that isolates a chosen cycle length from ordered prices. That untruncated reading is the forecast baseline.
A finite-impulse-response reconstruction then applies the same bandpass over a finite lookback so older observations cannot keep driving the output. Length is the finite number of recent bars retained after truncation.
The untruncated bandpass baseline
The untruncated bandpass is computed from the two-bar close difference plus two lagged filter terms. The coefficients on those lagged terms come from the period and bandwidth cosines.
Period is the cycle length, in bars, that sets those cosine coefficients. Bandwidth is a fraction of the period that sets how narrow the passband is.
How truncation limits the memory window
The implementations reconstruct a truncated bandpass by applying the same recursive coefficients over a finite lookback and forcing the two oldest stored states to zero. That zeroing step is the truncation: filter state beyond the stated length is cleared so extreme past prices drop out of the calculation.
The construction is presented as a way to limit the data range so that temporary extremes have less lasting influence on the filter output than they do in the infinite-memory baseline.
The truncated reading as a trend filter
The teaching implementations treat a zero crossing of the truncated reading as the defined event for reversing the signed trend-filter state on the next bar.
The trend filter is a signed, zero-centered reading of the truncated bandpass. It marks a change of direction at a defined sampling interval.
Truncated versus recursive bandpass on daily SPY

Zorro snippet fixes Period 20, bandwidth 0.1, UnstablePeriod/truncation length 10, daily SPY from 2018-11-01. Mid-sample y-values are only to the nearest point because the traces overlap on a dark raster; 2019 wiggles are envelope readings, not exact peaks.
Default inputs in the teaching implementations
The supplied EasyLanguage construction uses Period 20, Bandwidth 0.1, and Length 10 as the default inputs for both the indicator and the strategy versions.
A companion platform reconstruction uses the same defaults of period 20, bandwidth 0.10, and length 10 when it instantiates the truncated series on close prices.
All readings on this track · 10 readings
- 1982An odd-length smoother from a cycle cutoff
- 1989Smoothing filters, cutoff, poles, and sample delay
- 1992Constructing a cycle-aware finite impulse response detrender
- 2002Rebuild a smoother by writing the lag into the coefficients
- 2002Timing market cycles with finite impulse response filters and FFT
- 2002Constructing the relative strength index with an even-order finite-impulse-response prefilter
- 2003Recursive and cascaded moving-average construction
- 2006One second-order transfer function, a family of trend filters
- 2019Constructing the Voss line from a bandpass and a short FIR sum
- 2020Truncated bandpass construction as a finite-length trend filter