Concept

Windowed FIR Smoothing

Windowed FIR Smoothing, also known as Hann, Hamming, triangle windows, is a Trend concept. The Library holds 5 implementations, each one a working definition you can pull into Quant.

Top Windowed FIR Smoothing indicators

5 total

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.

  1. 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.
  2. 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.
  3. 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.

More Windowed FIR Smoothing implementations

Related concepts · Digital filters & smoothers

Concept family

Trend

100 concepts mapped · 88 in the Library

Windowed FIR Smoothing FAQ

What does FIR mean in a trading indicator?

Finite impulse response: the output is a weighted sum of the last N bars only, with fixed weights and no feedback of previous outputs, so any shock leaves the calculation completely after N bars. Simple and weighted moving averages are FIR; an EMA is not, since its recursion gives every past bar a small, never-quite-zero influence.

Why use a Hann window instead of a simple moving average?

Because of the edges. An SMA weights the oldest bar as much as the newest and drops it all at once, so one large bar leaving the window can move the average with no new information arriving. The Hann taper fades bars in and out, producing a smoother line with much less of that artifact, at the price of slightly slower response for the same length.

What is the difference between Hann and Hamming windows?

Both are raised-cosine tapers. Hann falls all the way to zero at the window edges; Hamming sits on a small pedestal, leaving the edge bars a little residual weight, with coefficients chosen to suppress the nearest sidelobe more aggressively. For price smoothing the practical difference is minor and rarely changes a signal.

Build Windowed FIR Smoothing your way.

Quant writes, tests, and refines it with you — then it runs on LuxAlgo charting or ports to TradingView.