Indicators · Trend and moving averages
Weighted moving average (WMA): linear weights, worked example
How the linearly weighted moving average counts recent closes more heavily, a full worked calculation on Microsoft prices, and when it beats an SMA or EMA.
On this page
A weighted moving average (WMA) is an average of the last n prices in which each price
counts in proportion to how recent it is. In a 10-period WMA the newest close is
multiplied by 10, the one before by 9, and so on down to 1 for the oldest, and the total
is divided by the sum of the weights. Charting software calls it the "weighted" or
"linearly weighted" moving average; TA-Lib, which Finabase uses, calls it WMA.
The WMA sits between the simple moving average, where every close counts equally, and the exponential moving average, where weights decay geometrically and never quite reach zero. It reacts faster than an SMA of the same length, yet it still has a hard window: a price older than n bars has no influence at all. This guide works through the full calculation on Microsoft's prices, shows how much faster the WMA really is, and covers where it fits.
How the weighting works
Linear weighting is a simple compromise. Traders wanted an average that paid more attention to what just happened, but they also wanted a fixed window so that an event from three months ago could not keep leaking into today's reading. Weighting by position (n, n − 1, … 1) does both.
The figure shows the three shapes side by side. A curious detail: for a 10-period average, the WMA and the EMA give exactly the same weight to the newest close, 10 ÷ 55 and 2 ÷ 11, both 18.2%. They differ in what happens next. The WMA's weights fall by 1.8 percentage points per bar and reach zero after the tenth close. The EMA's fall by 18.2% of themselves per bar, so closes 11, 12 and beyond still carry about 13% of the total between them.
The formula
There is also a quick way to update a WMA without recomputing every product: keep a running sum and a running weighted sum. Each new bar, the weighted sum gains n times the new close and loses the old plain sum; the plain sum gains the new close and loses the one leaving the window. Spreadsheet users rarely need this, but it is why a WMA is as cheap to compute as an SMA.
A worked example on Microsoft
Here is Finabase's 10-day WMA of Microsoft (MSFT) on July 13, 2026, computed from the ten closes that ended that day.
| Date | Close | Weight | Weight × close |
|---|---|---|---|
| Jun 29, 2026 | $368.57 | 1 | 368.57 |
| Jun 30, 2026 | $373.02 | 2 | 746.04 |
| Jul 1, 2026 | $384.28 | 3 | 1,152.84 |
| Jul 2, 2026 | $390.49 | 4 | 1,561.96 |
| Jul 6, 2026 | $386.74 | 5 | 1,933.70 |
| Jul 7, 2026 | $388.84 | 6 | 2,333.04 |
| Jul 8, 2026 | $383.34 | 7 | 2,683.38 |
| Jul 9, 2026 | $384.36 | 8 | 3,074.88 |
| Jul 10, 2026 | $385.10 | 9 | 3,465.90 |
| Jul 13, 2026 | $390.99 | 10 | 3,909.90 |
| Total | 55 | 21,230.21 |
WMA (10) = 21,230.21 ÷ 55 = $386.00.
The plain 10-day SMA of the same closes is $383.57. The WMA sits $2.43 higher because the stock had been recovering from a late-June low of $349.20, and the WMA puts more of its weight on the higher, more recent closes.
How much faster is it?
On a perfectly straight trend, the average age of the data in a WMA is (n − 1) ÷ 3 bars, against (n − 1) ÷ 2 for an SMA or EMA. For a 10-period average that is three bars of lag instead of four and a half: a third less.
After a sudden move, the difference is larger. On July 30, 2026 Microsoft jumped from $390.54 to $451.10, a 15.5% one-day gain after its quarterly results.
| Line | Jul 29, 2026 | Jul 30, 2026 | Change |
|---|---|---|---|
| WMA (10) | $390.15 | $400.86 | +$10.71 |
| SMA (10) | $392.16 | $397.16 | +$5.00 |
The SMA can only add a tenth of the jump on day one, $6.06, less the close leaving its window. The WMA gives the new close 18.2% of its weight from the first day. Over the following days the WMA continued to catch up faster, because each fresh close above $440 entered with the top weight.
How traders use the WMA
As a faster trend line. The WMA is used much like any short moving average: price above a rising WMA describes an uptrend, price below a falling one a downtrend. It is popular with short-term traders who find a 10-day SMA too slow but dislike the EMA's long tail.
As a crossover trigger. Price crossing the WMA, or a fast WMA crossing a slow one, gives earlier signals than the SMA equivalents. Earlier also means more frequent. Over the six months on the chart, Microsoft's close crossed its 10-day WMA 27 times and its 10-day SMA 23 times.
Inside other indicators. The best-known derivative is Alan Hull's Hull Moving Average (2005), which combines WMAs of two lengths and smooths the result with a third, short WMA to cut lag further. Finabase does not chart the Hull average, but understanding the WMA explains how it works. The TEMA and DEMA use the same idea of lag cancellation with EMAs instead.
Pitfalls and limitations
Still lagging. A third less lag is still lag. A 10-day WMA confirmed Microsoft's July rebound days after the low, not at it.
The drop-off returns. Unlike the EMA, the WMA has a hard window. The weight on a close falls smoothly toward zero, so the effect is milder than with an SMA, but a close leaving the window still moves the line a little.
Short windows, more noise. Because the newest closes dominate, a 5- or 10-period WMA can bend sharply on a single outsized bar. That makes it more responsive and more prone to false turns at the same time.
Comparison table
| Average | Newest close weight (n = 10) | Lag on a steady trend (n = 10) | Hard window? |
|---|---|---|---|
| SMA | 10.0% | 4.5 bars | Yes |
| WMA | 18.2% | 3.0 bars | Yes |
| EMA | 18.2% | 4.5 bars | No |
| TRIMA | about 3.3% | 4.5 bars | Yes |
How Finabase calculates and scores the WMA
Finabase computes the WMA with TA-Lib's WMA function on daily (or intraday) closes. A
new WMA study, shown as "Weighted Moving Average" in the study list, defaults to
10 periods and accepts any period you choose.
In the technical gauge, WMA (10) is one of the overlay rows: a close at or above the line counts as Bullish, a close below it as Bearish. The Scanner tracks the same WMA (10) and lists the stocks whose close crossed it, up or down, with the date of the signal. The reading is a position, not a forecast; a stock that has just crossed above its WMA (10) after a long decline is still in a decline until longer measures agree.
Frequently asked questions
What is the difference between a WMA and an EMA?
Both weight recent closes more heavily. The WMA's weights fall in a straight line and stop after n bars. The EMA's weights fall by a constant percentage and never reach zero, so older history keeps a small influence.
Is the WMA the same as a volume-weighted average?
No. The WMA weights by position in time. A volume-weighted average, such as VWAP, weights each price by how many shares traded at it.
What period should I use for a WMA?
Ten is Finabase's default and a common short-term setting. Traders use 20 to 50 for a medium-term line. Whatever you choose, compare it on the same chart with an SMA of the same length to see how much speed you are buying.
Summary
The weighted moving average counts each of the last n closes in proportion to its recency and ignores everything older. It has a third less lag than an SMA on a steady trend and responds about twice as fast on the first day of a big move, as Microsoft's July 2026 jump showed. It still lags, it still whipsaws in ranges, and its short versions are noisy. Use it where a little more speed matters and a hard window is welcome.
Sources and further reading
- Robert W. Colby, The Encyclopedia of Technical Market Indicators, 2nd ed. (McGraw-Hill, 2003) — weighted moving averages
- Alan Hull, “Hull Moving Average” (2005) — a WMA-based low-lag average
- TA-Lib — WMA function reference
- Finabase chart data — MSFT daily bars, 2026-04-30 to 2026-10-29, WMA and SMA computed by Finabase