# Roofing Filter

Roofing Filter is an indicator on [Vela](https://vela.luxalgo.com/chart), our next-generation charting platform, written in Pine Script®.

The Roofing Filter chains Ehlers' two published stages: a two-pole high-pass keyed to 48 bars strips trend and drift, then a 10-bar SuperSmoother removes noise and aliasing. The surviving cycle band plots as a zero-mean line colored by sign with a gradient fill, and alerts fire on zero crosses and slope turns. For traders who want oscillator inputs freed from spectral dilation.

- Indicator in the LuxAlgo Library, by LuxAlgo, published Mar 19, 2026.
- Access: free.
- Concepts: [Roofing Filter](https://www.luxalgo.com/library/concept/roofing-filter/) (primary)
- Open on Vela: https://vela.luxalgo.com/chart?pineScriptCodeId=dupv19wtp8iiwjvedoxj7oiw
- Page: https://www.luxalgo.com/library/indicator/roofing-filter/

**Roofing Filter** runs price through Ehlers' two published stages back to back: a two-pole high-pass keyed to 48 bars removes everything slower (trend and drift), then a SuperSmoother keyed to 10 bars removes everything faster (aliasing and bar-to-bar noise). The residue plots as a zero-mean line holding only the cycle band bracketed by the two cutoffs. This pane is the [roofing filter](https://www.luxalgo.com/library/concept/roofing-filter/) in its definitive clean form, published coefficients intact, the output colored by its sign, and a gradient fill anchoring every swing to zero.

## How to Trade the Roofing Filter?

- **Zero crosses**: the roofed output crossing zero marks a cycle-scale swing shift, the events the two zero-cross alerts fire on.
- **Turns**: slope reversals flag cycle crests and troughs as they form, ahead of the next zero cross, and both carry matching alerts.
- **As preprocessing**: the pane's larger job is upstream hygiene. An oscillator fed the roofed series works from a zero-mean, cycle-only input, so its extremes stay meaningful even while price trends.

The intermediate high-pass stage is exposed in the data window for inspection.

## Roofing Filter Settings

- **Source** (default close): series the filter preprocesses.
- **High-Pass Period** (default 48): upper cutoff of the passband. Components with longer periods are stripped, keeping the output zero-mean through trends. Keep it well above the low-pass period.
- **Low-Pass Period** (default 10): lower cutoff. Components with shorter periods are treated as noise. Squeeze the two cutoffs together and the output begins ringing.
- **Gradient Fill** (default enabled) and **Zero-Cross Markers** (default disabled); the Bullish and Bearish inputs set the two sign colors.

## Frequently Asked Questions

### How does this differ from using the SuperSmoother alone?

The [Ehlers SuperSmoother](https://www.luxalgo.com/library/indicator/ehlers-supersmoother/) is only the low-pass half: it removes fast noise but leaves trend and drift in place, so its output follows price. The roofing filter adds the high-pass stage in front, which is what makes the output zero-mean and cycle-scaled rather than a smoothed price line.

### Why 48 and 10 bars?

They are the published defaults, sized so the passband brackets the swing lengths most oscillator work targets. The practical rule: keep the high-pass period comfortably above your target swing's length and the low-pass period below it.

### Does the filter lag or miss anything?

A few bars of lag (the toll every filter pays) and deliberate blindness to everything outside the passband. Anything slower than the high-pass cutoff or faster than the low-pass cutoff is gone by design; that selectivity is the point.

## Related indicators

- [Adaptive Momentum Oscillator](https://www.luxalgo.com/library/indicator/adaptive-momentum-oscillator/) (Adaptive-parameter Technique): markdown at https://www.luxalgo.com/library/indicator/adaptive-momentum-oscillator.md
- [Adaptive Harmonic Forecast](https://www.luxalgo.com/library/indicator/adaptive-harmonic-forecast/) (Dominant Cycle Measurement): markdown at https://www.luxalgo.com/library/indicator/adaptive-harmonic-forecast.md
- [Correlated Sine Oscillator](https://www.luxalgo.com/library/indicator/correlated-sine-oscillator/) (Sinewave Indicator): markdown at https://www.luxalgo.com/library/indicator/correlated-sine-oscillator.md
- [Swiss Army Knife Filter](https://www.luxalgo.com/library/indicator/swiss-army-knife-filter/) (Ehlers Bandpass Filter): markdown at https://www.luxalgo.com/library/indicator/swiss-army-knife-filter.md
- [Variable Sine Wave Fit](https://www.luxalgo.com/library/indicator/variable-sine-wave-fit/) (Dominant Cycle Measurement): markdown at https://www.luxalgo.com/library/indicator/variable-sine-wave-fit.md
- [Normalized Resonator](https://www.luxalgo.com/library/indicator/normalized-resonator/) (Dominant Cycle Measurement): markdown at https://www.luxalgo.com/library/indicator/normalized-resonator.md
- [Even-better Sinewave](https://www.luxalgo.com/library/indicator/even-better-sinewave/) (Statistics): markdown at https://www.luxalgo.com/library/indicator/even-better-sinewave.md
- [Decycler](https://www.luxalgo.com/library/indicator/decycler/) (Statistics): markdown at https://www.luxalgo.com/library/indicator/decycler.md

---

Source: https://www.luxalgo.com/library/indicator/roofing-filter/ (LuxAlgo Library). Free to use with attribution: https://www.luxalgo.com/library/license/
