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 center 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.

Covered on this page: TradingView.

How it works

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.

An illustrative price series, volume beneath, 1 marked level, on the terms page (wma-math).
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

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.

Which gives you a conversion worth memorizing. 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 center 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.

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

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.

A worked case shows the gap. Take a stock that sat at $50 and then rose $1 a session for five sessions: over the last twenty closes the simple average is $50.75 and the weighted average about $51.33, because the five newest closes carry 90 of the 210 weight points.

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.

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 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.

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.

Each of those earlier exits and re-entries pays a round trip. Speed is not free; it is paid for in transactions.

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 center 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 centers 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 two different lines.

How this connects

An average where each bar’s weight declines linearly with age, which sits between a simple moving average and an exponential one.

All three answer one question differently. How much should an old bar count - equally, linearly less, or exponentially less.

The Hull moving average is built from weighted averages, combining several to cut lag further, with the overshoot that always accompanies that.

The differences between the three are smaller than they are usually sold as. Each turns slightly sooner or later, which is the same trade seen from either end.

And every one of them is a summary of bars that have already printed, so none is capable of leading price.

When it fails

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 center 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

The center-of-mass figures can be checked on paper, with no price data at all. For a 20-period weighted average the weights run 1 to 20 and total 210, and the weighted average age of the bars inside it works out to 6.3 bars, against 9.5 for the simple average of the same length.

An illustrative price series, volume beneath, 1 marked level, labeled 'here', on the terms page (wma-hindsight).
The weighted line turned first. Is that information? Illustrative chart - not real market data.

That arithmetic is the point of the figure. The center of mass is something you can work out on paper, and the divergence between two lines is something you can count on your own instrument. Check that they agree, then use the theory: pick the type by the lag you want, convert with the 1.5× rule, and stop treating the menu as a matter of taste.

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 reach for when I want a fast line, and the reason is not preference. The linear weighting puts the center of mass a third of the way back instead of halfway, which 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. Some links on this page earn a commission if you buy through them. It costs you nothing and it does not decide what appears here or in what order — how these pages are made is set out in our methodology.