What is a Linear Weighted Moving Average?

A linear weighted moving average assigns more weight to the more recent prices. Generally, this is better for longer term moving averages because it allocates more weight to current prices at the expense of older prices. While weighting is not as significant for a 5 day moving average, there is a substantial difference in a longer period, such as a 50 day moving average.

In a Simple Moving Average, the price data have an equal weight in the computation of the average. Also, in a Simple Moving Average, the oldest price data are removed from the Moving Average as a new price is added to the computation.

The linear weighted moving average is more sensitive than the SMA. It reacts to current prices quicker, similar to how the Exponential Moving Average works.

Lets see how a Linear Weighted Moving Average is calculated:

LWMA = SUM (CLOSE (i) * i, N) / SUM (i, N)

Where:

SUM - sum;
CLOSE(i) - current closing price;
SUM (i, N) - total sum of weight coefficients;
N - smoothing period.

For the following example we will set the PERIOD equal to 4. We will assume the price of each day is a multiple of 10 of the day number for the price, thus, price 1 = 10, price 2 = 20, and so on.

To calculate a linear weighted moving average, multiply the oldest data point price by 1 and each following price by an increasing consecutive number up to the current price. Multiply by the number of days selected for the average, then add the factors and divide the sum by the total of all the weights used:

LWMA = (Price 1 * 1) + (Price 2 * 2) + (Price 3 * 3) + (Price 4 * 4) / 1 + 2 + 3 + 4

LWMA = (10 * 1) + (20 * 2) + (30 * 3) + (40 * 4) / 1 + 2 + 3 + 4

LWMA = (10 + 40 + 90 + 160) / 1 + 2 + 3 + 4

LWMA = 300 / 10 = 30

If we calculate the same four days as a simple moving average, we can see the difference:

SMA = (10 + 20 + 30 + 40) / 4

SMA = 100 / 4 = 25

 

Lets compare a SMA with a LWMA on a graph:

 

SMA vs. SMMA Graph

 

As we see, the LWMA is more reactive to trend changes than the SMA, which produces a graph similar to an EMA.

 


PreviousNext

Recent News (links open in new tab)

Canadian Dollar Rises as Oil Shows Strength

Mon, 05 Jan 2009 17:58:31 +0000
The Canadian dollar rose against the 3 other major currencies today, completely reversing the daily trend, as the oil and commodity markets become more attractive after the holidays. Posted on Forex News. We don't believe in an ideal broker, we believe in you — Ava FX.

Dollar Declines on Oil Shortage Expectations

Tue, 30 Dec 2008 07:45:28 +0000
The U.S. dollar began today’s trading session with a rather strong decline against the euro, after posting a significant gain yesterday, as the investors expect the oil prices to surge on the Middle East conflict. Posted on Forex News. We don't believe in an ideal broker, we believe in you — Ava FX.

Dollar Falls on Fears That Recession Deepens

Mon, 29 Dec 2008 09:06:39 +0000
The U.S. dollar declined today against the other major currencies and especially against the euro as the traders expect weak macroeconomic reports to continue coming out from the United States, showing that the world’s biggest economy is in the worst situation of all the developed countries. Posted on Forex News. We don't believe in an ideal broker, we believe in you — Ava [...]