Windowed FIR Smoothing
Windowed FIR smoothing is moving-average construction using the window functions of signal processing. Windowed FIR Smoothing, also known as Hann, Hamming, triangle windows, is a Trend concept. The Library holds 1 implementation, ready to run on Vela.
Top Windowed FIR Smoothing indicator
The top custom implementation, built on the original standard Windowed FIR Smoothing formula.
1 total
Open the Windowed FIR Smoothing implementation below on Vela, then have Quant, our coding agent, turn it into a strategy you can backtest.
What is Windowed FIR Smoothing?
Windowed FIR smoothing is moving-average construction using the window functions of signal processing. FIR (finite impulse response) means the output is a weighted sum of a fixed number of recent bars with no feedback, so every SMA and WMA is already a FIR filter. The 'window' is the weight profile draped over that lookback: a triangle rising to the middle and falling again, a Hann window (a raised cosine tapering to zero at both edges), or a Hamming window (a raised cosine on a small pedestal). The SMA is the rectangular window, and its hard edges are its weakness: it reacts as strongly to an old bar leaving the calculation as to a new one arriving, and it leaks noise through spectral sidelobes.
Tapered windows fix the edges. Because weights fade in and out gradually, a single extreme bar neither jolts the average when it enters nor when it drops out, and the line ripples less between genuine turns. Symmetric FIR weights also delay every frequency component equally, by about half the window ((N-1)/2 bars for an N-bar window), so the smoothed line preserves the shape of the movement it keeps, merely shifted in time, rather than distorting it. John Ehlers popularized Hann-windowed averages and indicator smoothing in technical analysis. The delay is the honest cost: it is fixed, known, and cannot be removed without changing the filter class.
How to calculate a windowed FIR average
The recipe is the same for every window; only the weight formula changes.
- 1Choose a window length N and a window function. The triangle (the weighting behind the triangular MA), Hann, and Hamming are the common choices; each is just a formula assigning a weight to positions 1 through N of the lookback.
- 2Compute the N weights and normalize them to sum to one. For a Hann window the weight rises from zero at the oldest bar to a peak at the center of the lookback and falls back toward zero at the newest bar, following a cosine arc.
- 3Each bar, output the weighted sum of the last N values. The result trails price by about (N-1)/2 bars, so pick N with that delay in mind for the timeframe traded.
How traders use it
- As a drop-in smoother: replacing an SMA or WMA with a Hann- or triangle-weighted average of similar length yields a steadier line with better-defined turns, useful for slope-based trend coloring.
- As indicator plumbing: smoothing an oscillator's input or output with a small Hann window cuts false crossings, and some published designs use the difference of two windowed averages as a momentum gauge.
- As a benchmark: because symmetric FIR smoothing has exact, constant delay, it is a clean reference against which adaptive or recursive filters, such as the Ehlers SuperSmoother, can be judged.
Windowed FIR Smoothing vs related filters
WMA: The WMA is FIR but not symmetric: weights ramp linearly up to the newest bar, which cuts lag but gives up the symmetric taper's constant delay and lets more short-cycle noise leak through. Classic windowed smoothing accepts the half-window delay in exchange for the cleaner response.
Gaussian Filter: A Gaussian-weighted average is itself a windowed FIR smoother, so the distinction is mostly vocabulary: 'windowed FIR' usually points at the classic DSP windows (triangle, Hann, Hamming), while Gaussian filters are often implemented recursively instead, trading the fixed FIR delay for less of it.
SMA: The SMA is the rectangular window: equal weights, abrupt edges. Tapered windows sacrifice a little responsiveness for far less ripple and no jump when an extreme bar exits the lookback.
Windowed FIR Smoothing FAQ
Turn Windowed FIR Smoothing 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
