Turnmarks

Windows

The oldest construction, and still the most common one on any chart. Pick a shape, divide by its total, and the shape is the filter. A simple moving average is this with a rectangle.

Build one

Lag, noise gain, peak gain and leak are defined on the comparison page — the tool sits above the article deliberately, so the numbers arrive before the prose that explains them.

How it works

Each output is the last N bars multiplied by N weights and added up. The weights are the window. Nothing else is going on, which is why this family is the one to understand first: every other construction can be written as a window too, once you work out what window it implies.

What separates the shapes is how abruptly they start and stop. A rectangle switches from full weight to none between one bar and the next, and that discontinuity is expensive: it produces side lobes, which are the frequencies the filter was supposed to reject and lets through anyway. Tapering the ends — Hann, Hamming, Blackman, a Gaussian — removes the discontinuity and buys much smaller side lobes.

ALMA is the Gaussian with one extra idea: slide the bell towards the current bar instead of centring it. Weight near the present means less delay, and the published default puts the peak 85% of the way forward.

What it costs

Two things trade against each other and no shape wins both. A narrow main lobe means a sharp transition between what is kept and what is removed; low side lobes mean the removed part is really removed. A rectangle has the narrowest main lobe of any window and the worst side lobes; Blackman has the smallest side lobes and the widest main lobe.

Sliding the window forward, as ALMA does, buys lag directly — and pays for it twice: with a wider effective transition, and with more of the weight concentrated on fewer bars, which is noise gain.

What our measurements say

Three windows from the comparison, all at the same period so the shape is the only difference:

Windows at period 24, measured the same way as every other filter here. Green is the best in that column, and less is better in all of them. Peak is unmarked: the rows tie there. Each name is a link, and loads that filter into the dials above.
Filter Lag Noise Peak Leak vs an EMA of the same lag
SMA11.500.04171.0000.05546leak 0.942× · noise 1.00×
WMA7.670.05441.0000.05656leak 0.654× · noise 0.889×
ALMA (0.85/6)4.620.09221.0000.05202leak 0.378× · noise 0.944×

Within this family ALMA (0.85/6) takes both columns — the shortest lag here at 4.62 bars and the least leak at 0.05202. Within one construction that is common; across the table it is not, which is what the comparison is for. Leak is measured over periods of 4.0 bars and shorter, the same band as every other page in this section, so the rows can be read against the full table. The table happens to contain one pair that isolates this: SMA and EMA sit 11.50 and 11.50 bars behind price, near enough to the same place to compare directly, and at that shared delay SMA leaks 0.942 times what EMA does for 1.00 times the noise gain.

What a window cannot do

A window of non-negative weights can never have zero lag. Its centre of mass is somewhere inside the bars it covers, and that centre of mass is the lag. The only ways out are negative weights, which is the cascade family, or weights on bars that have not happened yet, which is not a filter.

This is also the honest reading of a symmetric window. Centre one on the current bar and the lag is zero, which is why every textbook picture of a Gaussian filter looks miraculous: half its weight sits on the future.

The other constructions