Skip to main content
Track Highpass filter
3 / 7
Library

2014issue C0161-62

Constructing a roofed stochastic from highpass and lowpass stages

A historical workflow links a two-pole lowpass smoother, a roofing filter that highpass-filters closes and then reapplies that lowpass, and a stochastic oscillator computed on the roofed series.

  • The construction presents three linked stages: a two-pole lowpass smoother, a roofing filter that runs a highpass stage before that same lowpass, and a stochastic oscillator on the roofed series.
  • Lowpass recursive coefficients are formed from an exponential-cosine pair at period 10 and arranged so the three weights form a unity-gain recursion.
  • After the highpass stage, the roofing construction reapplies the same period-10 two-pole lowpass to the highpass series rather than to raw closes.
  • The stochastic stage defaults to length 20, initializes its range from the highest already-filtered value, and both filter stages return zero when fewer than two historical samples are present.
Entries in this reading3 entries

Three linked stages

The construction presents three linked stages: a two-pole lowpass smoother, a roofing filter that runs a highpass stage before that same lowpass, and a stochastic oscillator computed on the roofed series.

A lowpass-filter is a two-pole recursive smoother whose weights come from an exponential-cosine pair at a chosen period and are applied to averaged adjacent samples. A highpass-filter is a recursive stage that attenuates slow drift by combining a second difference of closes with lagged highpass outputs. A roofing-filter is a two-stage construction that highpass-filters a price series and then lowpass-smooths that highpass output, leaving a mid-band residual. A stochastic-oscillator is a range-normalized transform that locates the current filtered value between the highest and lowest filtered values over a chosen lookback.

Lowpass coefficients and the standalone smoother

Lowpass coefficients are formed from an exponential of -1.414 times 3.14159 divided by 10 and a cosine of 1.414 times 180 divided by 10, then arranged so the three weights form a unity-gain recursion. Each recursive-coefficient is a fixed weight computed from trigonometric and exponential expressions of a period, then reused at every bar.

The standalone lowpass stage applies its feedforward weight to the average of the current and previous close and then adds two lagged outputs of the filter. The lowpass implementation returns zero when fewer than two historical samples are present, encoding a minimum lookback for the recursive terms.

Roofing highpass, then the same lowpass

The roofing highpass first computes an alpha from cosine and sine of 0.707 times 360 divided by 48, then combines a second difference of closes with two recursive highpass lags.

After the highpass stage, the roofing construction reapplies the same period-10 two-pole lowpass to the highpass series rather than to raw closes. The roofing implementation also returns zero when fewer than two historical samples are present.

Stochastic stage on the roofed series

The stochastic stage accepts a length input that defaults to 20 and initializes its range from the highest value of the already-filtered series. The oscillator then locates the current filtered value between the highest and lowest filtered values over that lookback.

A worked chart example plots the roofing filter together with the stochastic oscillator on a single price series.

Roofed MESA Stochastic on daily Google, 2012–2013

On daily Google the 20-bar MESA Stochastic, built on the roofed close, spends long stretches pinned near 0 or 1 and only flips when the band-passed swing turns. A trader should read those dwells as the last stage of the highpass-then-lowpass pipeline, not as a conventional fast oscillator. Values were read from the bottom pane of the Tradecision sample (Figure 12); the printed axis labels months only, so turning-point dates are approximate.
On daily Google the 20-bar MESA Stochastic, built on the roofed close, spends long stretches pinned near 0 or 1 and only flips when the band-passed swing turns. A trader should read those dwells as the last stage of the highpass-then-lowpass pipeline, not as a conventional fast oscillator. Values were read from the bottom pane of the Tradecision sample (Figure 12); the printed axis labels months only, so turning-point dates are approximate.GOOG · Daily · 2012-09-15T00:00:00.000Z to 2013-11-15T00:00:00.000Z

The Tradecision listing fixes the roofing highpass at 48 bars, the two-pole lowpass at 10 bars, and the stochastic lookback at 20. Y readings are to the nearest 0.05 because the pane is scaled 0–1 with 0.2 grid lines.

Educational research material, not investment advice. Historical source context does not establish present-day performance.
3 of 7 in the Highpass filter track
201457-58 pp.Next on Highpass filterThe dual-K highpass roofing filter is unfinished until three choices are written togetherPlace the two-pole highpass roofing filter first so longer-wavelength components of the price wave are removed before any trend readout is formed.
All readings on this track · 7 readings
  1. 2006Constructing lowpass, highpass, and finite impulse response filters from one recurrence
  2. 2006Constructing a trend filter from a cycle-length moving average and a highpass residual
  3. 2014Constructing a roofed stochastic from highpass and lowpass stages
  4. 2014The dual-K highpass roofing filter is unfinished until three choices are written together
  5. 2015Constructing a decycler from high-pass cancellation
  6. 2015Constructing decycler oscillators from highpass and bandpass filters
  7. 2020Finite-memory truncation for cycle filters
All 7 readings tagged Highpass filter
Also on Highpass filter5 readings