WhitmanTrading

Weighted Moving Average: A Third, Not Half

A weighted moving average multiplies each close in the window by a weight that falls linearly, newest bar highest. Its centre of mass is a third of the period rather than a half, which makes it measurably quicker to turn than either the simple or the exponential average of the same length.

How it works

A candlestick chart of the site's shared price history. The headline on the chart reads: Weights that fall in a straight line.
Weights that fall in a straight line. Illustrative chart - not real market data.

Take the last twenty closes. Multiply the newest by 20, the one before it by 19, and so on down to 1. Add all of that up and divide by the sum of the weights, which for twenty bars is 210. That is a weighted moving average.

A gently rising stretch of the long price series. The headline on the chart reads: Twenty, nineteen, eighteen, down to one.
Twenty, nineteen, eighteen, down to one. Illustrative chart - not real market data.

“Weighted” without qualification means linearly weighted. That is the convention on every charting platform. The exponential average is also weighted, and it decays geometrically instead; the difference is the shape of the decay, and the shape is what changes the result.

The number that makes it different

A calmly advancing stretch of the long price series. The headline on the chart reads: Centre of mass is a third of the period, not a half.
Centre of mass is a third of the period, not a half. Illustrative chart - not real market data.

Work out the average age of the data inside it and you get (N−1)/3. For a 20-period weighted average that is 6.3 bars. The simple and exponential 20-period averages both sit at 9.5.

That is the only place in this family where the arithmetic actually differs, and it is the reason a weighted average visibly turns before the other two rather than fractionally before them.

A strongly rising stretch of the long price series. The headline on the chart reads: A thirty weighted lags like a twenty simple.
A thirty weighted lags like a twenty simple. Illustrative chart - not real market data.

Which gives you a conversion worth memorising. To match the lag of a simple average of period N, use a weighted average of roughly 1.5×N. A 30-period weighted average has a centre of mass of 9.7 bars; a 20-period simple average has 9.5. They are effectively the same amount behind price.

So “which type” and “which period” are the same dial, not two dials. Changing type without changing period is changing the effective period, and a lot of confused comparison comes from not knowing that.

A flat but volatile stretch of the long price series. The headline on the chart reads: The oldest bar leaves with almost no weight left.
The oldest bar leaves with almost no weight left. Illustrative chart - not real market data.

It also fixes the drop-off jolt. In a simple average the oldest bar leaves the window carrying full weight, which can move the line on a quiet day. In a weighted average that bar is already down to a weight of 1 out of 210 before it goes, so its departure is almost invisible.

That is a genuine, if small, improvement, and it is one of the few things in this family that is better rather than merely different.

In practice: the cost of the extra speed

A flat, quiet stretch of the long price series. The headline on the chart reads: Faster means noisier, and that is the entire trade.
Faster means noisier, and that is the entire trade. Illustrative chart - not real market data.

Every bar of lag you remove is a bar of smoothing you give up. There is no version of this where the line turns sooner and is equally steady, because turning sooner is responding more to the newest bars, which is the definition of less smoothing.

Measured on this site’s shared history, a 20-period weighted average sat an average of 44% of a median bar’s range away from the 20-period simple average — a little further apart than the exponential comparison, as the centre-of-mass figures predict.

A long-horizon candlestick view of the same price series. The headline on the chart reads: The Hull average is three of these stacked.
The Hull average is three of these stacked. Illustrative chart - not real market data.

The Hull moving average is built out of this one. It takes a weighted average of half the period, doubles it, subtracts a weighted average of the full period, and smooths the result with a third weighted average of the square root of the period. That construction exists to cancel most of the remaining lag, and every part of it is the tool on this page.

A candlestick chart with a volume histogram beneath it, with the volume histogram emphasised. The headline on the chart reads: Still no volume anywhere in the calculation.
Still no volume anywhere in the calculation. Illustrative chart - not real market data.

The weighting is by position, not by importance. A newer bar counts more because it is newer, and that is an assumption rather than a measurement. If you want the weight to reflect what actually traded, that is the volume-weighted version.

A candlestick series containing several opening gaps, with the largest opening gap marked. The headline on the chart reads: A gap lands on the heaviest weight in the window.
A gap lands on the heaviest weight in the window. Illustrative chart - not real market data.

A gap arrives on the newest bar, which carries the largest weight of all. So a weighted average reacts to gaps more sharply than a simple one — 20/210 of the line moves with that single close.

A declining stretch of the long price series, with the entry price and the level at which a stop would trigger drawn as horizontal lines. The headline on the chart reads: An earlier exit is also an earlier mistake.
An earlier exit is also an earlier mistake. Illustrative chart - not real market data.

As a trailing stop it exits earliest of the three. In a clean trend that protects more of the move. In a trend with normal pullbacks it takes you out of positions that were about to continue, and there is no setting that distinguishes those two cases in advance.

A candlestick chart of the site's shared price history, annotated with the round-trip cost. The headline on the chart reads: And a share of a bar is what each extra signal costs.
And a share of a bar is what each extra signal costs. Illustrative chart - not real market data.

Each of those earlier exits and re-entries costs 2% of a typical bar’s range in round-trip costs on this history. Speed is not free; it is paid for in transactions.

A 72-bar candlestick section of the shared price history. The headline on the chart reads: The weighting is a choice, not a measurement.
The weighting is a choice, not a measurement. Illustrative chart - not real market data.

And nothing about a linear decay is discovered. Somebody chose a straight line because it is simple to compute and easy to reason about. The market does not weight its own memory linearly, geometrically, or in any other published shape.

What a weighted moving average is not

It is not more accurate. There is no target it is closer to. It is a different summary of the same closes with a different centre of mass.

It is not the exponential average under another name. Both put more weight on recent bars; only one of them discards old bars entirely, and their centres of mass differ by a third of the period.

It is not a solution to lag. It reduces lag by a third relative to the alternatives at the same period, and reintroduces all of it the moment you lengthen the period to get the smoothing back.

And it is not the default on most platforms, which matters practically: if a strategy specifies “the 20 average” without saying which type, the person who wrote it and the person reading it are probably looking at lines 44% of a bar apart.

When it fails

A sideways, range-bound candlestick series. The headline on the chart reads: In a range it whipsaws harder than either of the others.
In a range it whipsaws harder than either of the others. Illustrative chart - not real market data.

In a range it is the worst of the three. The property that makes it turn early makes it turn early on noise as well as on moves, and a sideways market is almost entirely noise. Every advantage it has in a trend is a liability here.

The second failure is comparing types at equal periods. A 20 weighted against a 20 simple is not a fair test of weighting — it is a test of a 6.3-bar centre of mass against a 9.5-bar one. Compare a 30 weighted with a 20 simple if you want to isolate the shape of the decay from the length of the window.

A third is expecting the speed to survive smoothing. People find it too noisy, lengthen the period until it calms down, and end up with exactly the lag they switched away from — having added a step.

A fourth is using it inside another indicator without saying so. Changing an oscillator’s smoothing to weighted changes its effective period, so a setting inherited from someone using simple smoothing is no longer the setting they were describing.

And a fifth is treating the linear decay as meaningful. It is a convenience. Nothing about markets says the bar before last matters exactly 19/20 as much as the last one, and building a thesis on the specific shape of the weights is building on a decision somebody made for arithmetic reasons.

The original data

On this site’s shared 576-bar history the 20-period weighted average diverged from the 20-period simple average by an average of 44% of a median bar’s range — measurably more than the 38% recorded for the exponential comparison, which is what the centre-of-mass figures (6.3 bars against 9.5) predict in advance.

A 72-bar window of the shared price history, cut short at the decision bar. The headline on the chart reads: The weighted line turned first. Is that information?
The weighted line turned first. Is that information? Illustrative chart - not real market data.

That prediction-then-measurement is the point of the figure. The centre of mass is arithmetic you can do on paper; the divergence is something you have to count on real bars. They agree here, which means the theory is usable: pick the type by the lag you want, convert with the 1.5× rule, and stop treating the menu as a matter of taste. The numbers are in research/series-measurements.json and the script that produced them is in the site’s own source.

Simple moving average is the equal-weight baseline every comparison on this page is against. Hull moving average is what happens when you stack three of these to cancel lag. And moving average is the parent page covering where the whole family fits.

What I actually do

The weighted average is the one I actually reach for when I want a fast line, and it took me an embarrassingly long time to find out why: it is not a preference, it is that the linear weighting puts the centre of mass a third of the way back instead of halfway. That is a real difference, unlike most of the choices on an indicator menu.

— Michael Whitman

This page is educational, not financial advice. Test every idea on your own charts before risking money.