Moving averages

Weighted Moving Average on a Live Gold Chart

A weighted moving average takes the last N closes and counts the newest one N times, the one before it N − 1 times, and so on down to once. That makes it lean toward recent prices more than a plain average does; at the default 9, the latest hourly gold close counts nine times as much as the oldest.

Loading the live chart.

Close
–
WMA
–

Open the gold chart

What it shows

Just the WMA, drawn over the candles in blue. This indicator adds no bands, levels or second line.

How Pravex works it out

  1. Take the last N values of the source price, the close by default.
  2. Give them weights 1, 2, up to N, with weight 1 on the oldest and weight N on the newest.
  3. Multiply each value by its weight, add them up and divide by N × (N + 1) ÷ 2. With the default length of 9 that divisor is 45.
  4. Example numbers, not a live price: closes of 10, 12 and 14 with a length of 3 give (1 × 10 + 2 × 12 + 3 × 14) ÷ 6 = 12.67, a little higher than the plain average of 12.

Settings

SettingDefaultWhat changing it does
Length9How many candles are weighted. A longer length means a bigger spread of weights and a slower line.
SourcecloseThe price that gets weighted. Because the newest value counts most, a switch to hl2 makes the latest candle’s wick show up in the line almost at once.
Offset0Draws the weighted line a set number of candles later (positive) or earlier (negative). Its values stay as they are.

How traders read it

The WMA is read like other moving averages: price above a rising line leans up, price below a falling line leans down. Its twist is that the line hugs recent closes, so a turn in price bends it sooner than a simple average would.

Traders also pair a short and a long WMA and watch for the crossing. The short one climbing through the long one is seen as momentum picking up.

When it misleads

It still lags, just less than a simple average of the same length. The weights fall in a straight line, so the effect is milder than an exponential average, whose old values fade more slowly but never fully. In a choppy gold range the line follows every wiggle and gives crossings that go nowhere. There is also no extra smoothing group on this one, so what you see is the raw weighted line.

Questions and answers

Why divide by N × (N + 1) ÷ 2?

That is the sum of the weights 1 to N. Dividing the weighted total by it turns the result back into a price, so the WMA sits on the same scale as the candles.

Is a WMA just a quicker SMA?

Not quite. Both use the same window, but the WMA tilts the weights toward the newest close, so it turns sooner and still drops the oldest close completely when the window moves on.

Why does the WMA cross price more often than an SMA?

The newest close carries the biggest weight, so the line sits closer to price and turns with it. Closer means more touches and more crossings, many of them in quiet ranges.

What is the weight of each candle in a 9 WMA?

The weights run 1 to 9 and add to 45. The newest close is 9/45, a fifth of the line, and the oldest is 1/45, a little over 2%.

Related: Simple Moving Average, Moving Average Exponential, Hull Moving Average, Volume Weighted Moving Average, every indicator.

Not financial advice. Read our disclaimer.

Pro charts. Zero paywalls.

Charts for gold, oil, US indices and crypto, with every tool free to use.

Open the chart

No card, no trial, no upgrade pop-ups.