Ehlers Bandpass Filter
The Ehlers bandpass filter is a second-order recursive filter, published by John Ehlers, that is tuned to one cycle period and a bandwidth around it. Ehlers Bandpass Filter, also known as Band-pass filter, Digital resonator, is a Statistics concept. The Library holds 2 implementations, each one ready to run on Vela.
Top Ehlers Bandpass Filter indicators
The top custom implementations, built on the original standard Ehlers Bandpass Filter formula.
2 total
See the top Ehlers Bandpass Filter implementation below on Vela, our next-generation charting platform, then ask Quant to turn it into a strategy you can backtest.
What is the Ehlers bandpass filter?
The Ehlers bandpass filter is a second-order recursive filter, published by John Ehlers, that is tuned to one cycle period and a bandwidth around it. Price components near the chosen period pass with little attenuation (exactly none at the center), while slower ones (trend) and faster ones (bar-to-bar noise) are attenuated, so the output is a zero-mean oscillator tracing the selected cycle. In signal-processing terms it is a resonator, a two-pole filter whose response peaks at the center period.
Ehlers published the code in 'Corona Charts' (Technical Analysis of Stocks & Commodities, November 2008) and reused it in 'Empirical Mode Decomposition' with Ric Way (March 2010), with the bar midpoint as input, a 20-bar center period and a half-bandwidth of 0.1, which passes cycles of roughly 18 to 22 bars. It reappears in his later work, including Cycle Analytics for Traders (2013).
Bandwidth is the central tradeoff. A narrow band is selective but has a long memory: in Ehlers' words it can 'ring out like a bell' once energized. A wider band follows a changing cycle faster but admits more trend and noise. At the center period the filter adds no phase shift; off-center components are attenuated and shifted, so when the market's cycle drifts from the tuned period, the output's turns drift from price's.
How it's calculated
One recursion with coefficients derived from the center period and the bandwidth (angles in degrees, as in Ehlers' code):
The x_t - x_(t-2) term zeroes the response to a constant level, so the output centers on zero; 0.5 × (1 - α) scales the gain to exactly 1 at the center period.
Some code takes the full bandwidth BW = 2δ, with γ = 1 / cos(360 × BW / P); the filter is the same. LuxAlgo's Normalized Resonator uses this full-width input.
Seed BP at 0 for the first two bars; narrow bands need many warm-up bars.
How traders use it
- Cycle timing: turns and zero crossings of the output mark the swings of the tuned cycle, used when the market is ranging and a cycle is actually present.
- Normalized for fixed thresholds: raw output swells and shrinks with volatility. LuxAlgo's Normalized Resonator runs the filter on the bar midpoint (100-bar center period and 0.5 bandwidth by default), divides it by its highest absolute value over a window tied to the center period, adds a 9-period EMA signal line, and labels signal-line crosses beyond ±0.8.
- Side-by-side comparison: the band-pass row of the Swiss Army Knife filter is this filter, so the Library's Swiss Army Knife Filter build can run it next to other responses on identical code.
- With honest limits: in strong trends the tuned cycle carries little of the move, and the oscillator can swing while price trends.
Ehlers bandpass filter vs related cycle tools
Roofing Filter: Also a bandpass, but a wide one built from a high-pass stage and a SuperSmoother to prepare data for other indicators. The Ehlers bandpass is a narrow resonant filter that isolates one cycle and is read directly.
Swiss Army Knife Filter: The general second-order recursion with swappable coefficients. Its band-pass row is this filter; the dedicated version fixes that row and exposes period and bandwidth.
Dominant Cycle Measurement: Measurement estimates which period is strongest; the bandpass isolates a period once chosen. Filter-bank estimators run many bandpasses and keep the one with the most power.
Ehlers Bandpass Filter FAQ
Turn Ehlers Bandpass Filter into a trading strategy.
Open the top implementation from this page in Vela. Quant, our coding agent, builds the strategy with you and backtests it on real data.
Browse this familyStatistics45 concepts mapped · 45 in the Library
- Adaptive-parameter Technique
- ARIMA Forecasts
- Autocorrelation
- Autocorrelation Periodogram
- Beta
- Change-point Detection
- Cointegration
- Correlation
- Decycler
- Distribution Moments
- Distribution-of-returns Profiling
- Dominant Cycle Measurement
- Ehlers Bandpass Filter
- Entropy Measures
- Even-better Sinewave
- Exponential Smoothing Forecasts
- FFT/spectral Analysis
- Fractal Dimension
- Hilbert Transform
- Hodrick-Prescott Filter
- Hurst Exponent
- Kalman Filter
- Lead-lag Detection
- Linear Regression
- LOESS Smoothing
- Market Efficiency & Regime Persistence Measures
- Maximum-entropy Spectrum
- Min-max Scaling
- Monte Carlo Price Paths
- Outlier Detection
- Pairs Trading Stack
- Percentile Rank
- Polynomial Regression
- Probability Cones
- Quantile Regression
- Resampling Tests
- Roofing Filter
- Sigmoid/softmax Transforms
- Signal Decomposition
- Sinewave Indicator
- Standard Deviation
- Stationarity & Efficiency Tests
- Streak Analysis
- Wavelet Decomposition
- Z-score

