Swiss Army Knife Filter
The Swiss Army Knife filter is John Ehlers' name for a single generalized second-order recursive filter that becomes many different indicators depending only on which coefficient set is plugged in. It is a Trend concept. The Library holds 1 implementation, ready to run on Vela.
Ehlers
Top Swiss Army Knife Filter indicator
The top custom implementation, built on the original standard Swiss Army Knife Filter formula.
1 total
Open the Swiss Army Knife Filter implementation below on Vela, then have Quant, our coding agent, turn it into a strategy you can backtest.
What is the Swiss Army Knife filter?
The Swiss Army Knife filter is John Ehlers' name for a single generalized second-order recursive filter that becomes many different indicators depending only on which coefficient set is plugged in. One equation, five coefficients: choose them one way and it behaves like an EMA; choose them other ways and it becomes a two-pole Gaussian or Butterworth style smoother, a high-pass detrender, a band-pass that isolates one cycle wavelength, or a band-stop that removes one. Ehlers published it as a teaching and toolbox piece to show that most of the smoothers and detrenders traders use are the same machine wearing different settings.
The insight behind it is that a second-order recursion (two delayed inputs, two delayed outputs) spans a large share of practical filter behavior. Rather than maintaining separate code and separate mental models for an EMA, a smoother, and a detrender, a trader can maintain one filter and a coefficient table indexed by filter type and period. This makes side-by-side comparison honest: switching from low-pass to band-pass changes nothing except the coefficients, so differences in output reflect the filter response and not implementation quirks.
It is worth being clear about what the tool is not. It contains no adaptation and no new signal; each configured instance is a fixed filter with the ordinary tradeoffs of its type, including lag for the low-pass settings and ringing risk for the sharper band settings. Its value is architectural: a compact, uniform way to build and swap the standard responses inside larger systems.
How it's calculated
Every configuration is the same generalized second-order recursion; only the coefficients change:
Ehlers' article supplies the coefficient formulas per filter type (EMA, two-pole smoothers, high-pass, band-pass, band-stop), each parameterized by the period P.
Setting b1 = b2 = a2 = 0 with matched b0 and a1 reduces the recursion to a standard EMA.
Seed the recursion with the first outputs equal to price; sharper band settings need more warm-up bars before the output is trustworthy.
How traders use it
- As a filter workbench: traders prototype a strategy against several response types (smoother, detrender, band-pass) by swapping coefficient sets, isolating which spectral behavior actually carries the edge.
- The high-pass configuration serves as a detrender ahead of oscillators and cycle tools, similar in role to the roofing filter's first stage.
- The band-pass configuration isolates an assumed dominant cycle for timing entries in rangebound conditions; this inherits all the fragility of assuming a stable cycle, so it is usually paired with dominant cycle detection rather than a fixed period.
- In production code, one well-tested biquad routine replaces a drawer of separate indicator implementations, which reduces subtle bugs when comparing filters. The limitation is unchanged physics: no coefficient choice removes the lag-versus-smoothness tradeoff.
Swiss Army Knife filter vs related tools
Ehlers SuperSmoother: The SuperSmoother is one specific, fixed low-pass design. The Swiss Army Knife is the general chassis that can be configured into that style of smoother plus several entirely different response types.
Butterworth filter: A two-pole Butterworth is one row in the Swiss Army Knife's coefficient table. Reaching for the named filter or the generalized form produces the same line; the difference is packaging.
Gaussian filter: Likewise one configuration among several. The Gaussian setting emphasizes overshoot-free smoothing, while other settings of the same recursion detrend or band-limit instead.
Swiss Army Knife Filter FAQ
Turn Swiss Army Knife Filter into a trading strategy.
Open the implementation from this page in Vela. Quant, our coding agent, builds the strategy with you and backtests it on real data.
Browse this familyTrend104 concepts mapped · 104 in the Library
- Adaptive-lookback MA
- ADX / DMI System
- Alligator
- ALMA
- Anchored MA
- Andrews' Pitchfork
- Aroon
- ATR Trailing Regime
- Bessel Filter
- Breakout
- Butterworth Filter
- Chande Kroll Stop
- Chandelier Stop
- Chebyshev Filters
- Climactic Moves
- Continuation
- Coral Trend
- Correlation Trend Indicator
- Death Cross
- DEMA
- Displaced MA
- Donchian Trend Rules
- Dynamic S/R Via MA
- Ehlers Instantaneous Trendline
- Ehlers SuperSmoother
- Elastic Volume-weighted MA
- Elliptic Filter
- EMA
- Fan Principle
- FRAMA
- Gann Box
- Gann Fan & Angles
- Gann HiLo Activator
- Gann Method
- Gann Square of 9
- Gaussian Filter
- Geometric MA
- Golden Cross
- Guppy GMMA
- Halftrend
- Harmonic MA
- Higher-timeframe Trend Filter
- HMA
- Ichimoku Signals
- Ichimoku System
- Ichimoku Theories
- JMA
- KAMA
- Kaufman Efficiency Ratio
- Laguerre Filter
- Linear-regression Channel
- LSMA
- MA Envelope
- MA of MA
- MA Ribbon
- MA Slope Filter
- MAMA/FAMA
- McGinley Dynamic
- MLMA
- Moving Average Crossovers
- NRTR
- Order-statistic Filters
- Parabolic SAR
- Parallel Channel
- Polynomial Regression Band
- Pullback
- R-squared Trend Fit
- Rainbow MA Stack
- Random Walk Index
- Range Filter
- Retest
- Reversal
- RMA
- Savitzky-Golay Filter
- Sine-weighted MA
- SMA
- Speed Resistance Lines
- Standard-error Channel
- Supertrend
- Swiss Army Knife Filter
- SWMA
- T3
- TEMA
- TRAMA
- Trend Acceleration/inflection
- Trend Exhaustion
- Trend Intensity Index
- Trend Magic
- Trend Regime Label
- Trend-quality Composites
- Trendline
- Triangular MA
- UHL Adaptive MA
- Ultimate Smoother
- Vertical Horizontal Filter
- VIDYA
- Volume-adjusted MA
- Vortex
- VWMA
- Weinstein Stage Analysis
- Whittaker–Henderson Smoother
- Windowed FIR Smoothing
- WMA
- ZLEMA
