Weighted vs Exponential Moving Average: The Difference, Worked on S&P 500 Data
The exponential moving average (EMA) weights every past bar, each older one a fixed fraction less; the weighted moving average (WMA) weights only its window, in a straight line. When they differ after a turn, price crosses the WMA first but the EMA's slope turns first, on the S&P 500 and four other markets.
The difference between a weighted and an exponential moving average is how they weight old closes: the weighted average (WMA) counts only its last N closes, in straight-line steps, while the exponential average (EMA) counts every past close, each a fixed fraction less than the next. On nearly seven decades of S&P 500 closes, checked on four more markets, that one difference had a consistent result: price crosses the weighted line first after a turn, while the exponential line changes direction first.
What each one is
The exponential moving average weights every past bar, and each older bar counts for a fixed fraction less than the one after it. Today’s value is α × today’s close + (1 − α) × yesterday’s value, with α = 2 ÷ (N + 1) for an N-bar line. Nothing ever drops out completely. The exponential moving average page covers its weights.
The weighted moving average weights only the N bars in its window, in a straight line: the newest close is multiplied by N, the one before by N − 1, and so on down to 1, and the total is divided by N × (N + 1) ÷ 2. Anything older than the window is excluded. The weighted moving average page covers that version.
A worked example
Both 10-day lines on the S&P 500 close of 2 October 2026. The last ten closes, oldest first, from 21 September: 7,764.70, 7,764.64, 7,706.03, 7,704.13, 7,743.41, 7,683.69, 7,670.84, 7,651.54, 7,666.45 and 7,722.72.
The weighted line. Multiply the oldest close by 1, the next by 2 and so on, up to the newest by 10. The products add to 423,181.23, and the weights add to 55, so the 10-day WMA is 423,181.23 ÷ 55 = 7,694.20.
The exponential line. Its multiplier is 2 ÷ (10 + 1), about 0.1818. The previous session’s 10-day EMA, carried forward from 1957, was 7,679.85 (7,679.851 unrounded), so today’s is 7,679.851 + 2 ÷ 11 × (7,722.72 − 7,679.851) = 7,687.65.
What the two numbers show. Price closed 28.52 points above the WMA and 35.07 above the EMA: the weighted line sits closer to price, which is why price reaches it first after a turn. But the EMA rose 7.79 points that day and the WMA only 4.02, because the WMA’s daily change follows the simple average of the ten closes before it (7,700.59), not its own previous value. That is the slope effect the sections below measure across 68 years.
Where they differ
Which one price crosses first. After a turn, price often closes through both on the same session; when it does not, the weighted line is usually the first one price closes through, because its weight is packed harder into the latest bars.
Which one changes direction first. Here the order flips. The exponential line’s slope turns on the same session price crosses it; the weighted line’s slope waits for something slower, explained in the next section.
What happens to old bars. One fades them forever; the other drops each one the moment it leaves the window, so a large bar leaving can nudge the weighted line on a quiet day.
Why the weighted line crosses first but turns later
The two lines move by the same fraction each bar, measured against different things. Write out the daily change of each and the arithmetic is exact:
- Exponential: today’s value − yesterday’s = 2 ÷ (N + 1) × (today’s close − yesterday’s exponential value).
- Weighted: today’s value − yesterday’s = 2 ÷ (N + 1) × (today’s close − the simple average of the N closes before today).
So the exponential line turns down the session price closes under it, which is why the two events always fall on the same day for that line. The weighted line turns down only when price closes under the previous simple average, and the simple average is the slowest of the three. Price can therefore close below a weighted line while that line is still rising, because the close has not yet fallen under the slower simple average that steers it.
That is the whole difference in one sentence: the weighted line sits closer to price, so price crosses it sooner, but its direction is steered by the simple average, so it bends later.
Which one to use: EMA or Weighted Moving Average?
Run the exponential average when your rule reads the slope or when you are following a published method that names it, because its slope turns on the session price crosses it.
Run the weighted one when your rule reads price crossing the line and you want that cross a little sooner after a turn, accepting that the line keeps pointing the old way for a few more sessions.
Keep whichever is already in a working setup when the reason to switch is a losing stretch. The measured difference is a session or so at a turn, which is too small to rescue a method that has a different problem.
The original data
The test. Yahoo Finance daily closes of the S&P 500 index from 4 March 1957, the day the 500-stock index began, to 2 October 2026. Each line was built exactly as defined above (the exponential seeded with a simple average of its first N closes) and measured from 2 January 1958: 17,304 sessions, 68.75 years, price only. The 210 sessions of 1957 only start the lines: a 50-day line does not exist until its 50th close, and the exponential one needs further months for its starting value to fade, so the count begins with the first full year in which every line is settled. A crossing is a close on the other side of a line from the previous close.
| Length | Median gap between lines | Days price sat between them | Exponential crossings a year | Weighted crossings a year |
|---|---|---|---|---|
| 10-day | 0.22% of price | 8.13% | 41.57 | 48.32 |
| 20-day | 0.34% of price | 7.87% | 29.78 | 34.21 |
| 50-day | 0.57% of price | 7.66% | 18.17 | 20.26 |
The lines are close, and they still disagree on about one session in thirteen. On 1,362 of the 17,304 sessions, the close was above one 20-day line and below the other. A rule that reads “above the line” gives two different answers on those days.
Turning points. A turn here is a close that is strictly higher (a peak) or strictly lower (a trough) than every other close from N sessions before it to N sessions after it, with N the length of the lines; a close that ties another close in that window is not a turn. That uses hindsight, so it only says where the turns were, not that anyone could see them at the time. For each turn the test counted sessions until price first closed on the far side of each line (below it after a peak, above it after a trough) and until each line first moved the other way. “Crossed the weighted line first” means that close came on an earlier session for the weighted line than for the exponential one; “same session” means both came on the same day.
| Length | Turns | Price crossed weighted first | Same session | Price crossed exponential first | Slope turned first: exponential / same / weighted |
|---|---|---|---|---|---|
| 10-day | 1,002 | 312 | 669 | 21 | 212 / 734 / 56 |
| 20-day | 502 | 186 | 296 | 20 | 139 / 341 / 22 |
| 50-day | 195 | 86 | 89 | 20 | 93 / 90 / 12 |
At the 20-day length, the most common outcome was a tie: on 296 of the 502 turns, price closed through both lines on the same session. The weighted line came first on 186 and the exponential on 20, so when the two differed it was nearly always the weighted line. Price took a mean 3.94 sessions to cross the weighted line and 4.88 to cross the exponential one. The slopes ran the other way: a mean 4.88 sessions for the exponential line to turn and 5.36 for the weighted one. Both gaps are about one session. Every turn and both counts are in the turning points file, and the summary table holds the rows above.
A recent case shows both effects at once. The S&P 500 closed at 7,798.99 on 13 August 2026, the highest close of the 20 sessions either side. Price closed under both 20-day lines five sessions later, on the same day, 20 August. The exponential line turned down that day too; the weighted line did not turn down until the twelfth session after the peak, 31 August.
Four more markets show the same order. The 20-day test was repeated on Yahoo Finance daily closes for the Nasdaq Composite, gold futures, the euro in dollars and bitcoin in dollars, downloaded 22 Oct 2026 and measured from about a year after each series begins (February 1972, September 2001, November 2004 and May 2015) to 21 Oct 2026, or 22 Oct for the euro.
Price closed between the two lines on 7.67% of Nasdaq sessions, 8.10% for gold, 8.37% for the euro and 9.60% for bitcoin, against 7.87% for the S&P 500. At the turns where price crossed one line before the other, the weighted line came first 164 times out of 178 on the Nasdaq, 81 of 85 on gold, 64 of 70 on the euro and 55 of 60 on bitcoin, against 186 of 206 on the S&P 500, and in every market the exponential slope turned first more often than the weighted one.
A second source gives nearly the same shares. FRED’s versions of three of the series (NASDAQCOM, the Fed’s noon-rate DEXUSEU from 1999 and Coinbase’s CBBTCUSD) put the between-lines share at 7.61%, 8.53% and 9.68%, close to the Yahoo figures. Stale bars that repeat the prior close with no range were dropped, 8 on the Nasdaq and 15 on gold. Gold here is a rolling front-month futures series, so contract switches add small jumps, and bitcoin trades every day, so its sessions are calendar days. All seven rows are in the four-market table.
Moving-average length against moving-average type
Length changes the line far more than type. In the first table, going from 10 to 50 days cut the crossings by more than half for either formula, while switching formula at one length changed them by 11% to 16%. Choosing that length is covered on the moving average page.
A filter barely notices the type; a trigger notices it more. A rule that only asks which side of the line price is on changes its answer on the one session in thirteen. A rule that fires on the cross itself fires a little earlier on the weighted line, and somewhat more often.
Questions people ask
Is a weighted moving average faster than an exponential one?
Price crosses it sooner: when the two crossings fell on different days after an S&P 500 turn, the 20-day WMA came first 186 times out of 206. Its slope turns later, though, so it is faster on one reading and slower on the other.
How do you calculate a weighted moving average?
Multiply each of the last N closes by its position, 1 for the oldest up to N for the newest, add the products, and divide by N × (N + 1) ÷ 2, which is 55 for a 10-day line.
Should I use the EMA or the WMA for day trading?
Pick by what your rule reads. A rule that fires on the slope turning gets it sooner from the EMA; a rule that fires on price crossing the line gets it sooner from the WMA, by about a session at a turn.
Is the EMA a type of weighted moving average?
In the wide sense, yes: it weights recent bars more. On charting platforms “WMA” means the linearly weighted version on this page, with fixed weights and a hard cutoff at N bars.
When it fails
The common failure is switching formula after a losing run. A method built on one of the lines has a bad stretch, so the other is tried on the grounds that it weights bars differently. Because the two agree on about twelve sessions in thirteen, the next stretch is decided by the market rather than by the change, and the record now spans two variants that cannot be read as one sample.
The second failure is reading the weighted line’s slope as early. Price may already be under it while it still points up, because its slope follows the simple average. A rule that waits for the weighted line to turn is slower than one that waits for the exponential line to turn, which is the opposite of what its reputation suggests.
A third is trusting a hindsight turn. Every turn in the data above was found by looking both ways in time. In real time each cross is just a cross, and most of them are not followed by a turn at all.
And a fourth is running both on one chart as confirmation. Two lines that agree on twelve sessions in thirteen cannot check each other; the thirteenth session is where they disagree, and neither says which is right. On bitcoin, where the 20-day lines sat a median 1.09% of price apart, that disagreement came about one day in ten.
Related
The exponential moving average covers the decaying weights, and the weighted moving average covers the straight-line ones. The moving average page covers the family and how often price crosses each length of the simple version.
Before switching from one of these to the other, count the sessions on your own chart where price sits between the two lines. If that is about one session in thirteen, the type is a small dial, and the length you pick is the large one.
— Michael Whitman
This page is educational, not financial advice. Test every idea on your own charts before risking money.