Weighted Moving Average | WMA -ForexAbode.com
Weighted Moving Average
In Weighted Moving Average (WMA) more weight is given to the recent values unlike the simple moving average where each value has same weight.
Check about Weighted Average.
Let’s say we are talking about 5 days values or closing prices and these are as follows:
|
Day
|
1
|
2
|
3
|
4
|
5
|
|
Closing Price (value)
|
109
|
111
|
110
|
111
|
112
|
Now the simple moving average would be just the sum of the sum of all the prices divided by the number of days i.e. (109+111+110+111+112)/5. That means we are giving same weight to the prices of all 5 days. Now let’s say we wish to analyze the trend taking into account of a longer time frame e.g. three months. Would't it make sense that we give more weight to the recent prices than the three months old prices? Here comes into the picture the weighted moving average or WMA. In weighted moving average also there are two types: Linearly weighted moving average and exponentially weighted moving average or simply exponential moving average or EMA. Weighted Moving average (WMA):
The term Weighted Moving average or WMA basically means linearly Weighted Moving average. Here we give more weight to the recent values than the older values.
Lets again take the above example of 5 days values (closing prices):
|
Day
|
1
|
2
|
3
|
4
|
5
|
|
Closing Price (value)
|
109
|
111
|
110
|
111
|
112
|
|
Weight
|
1
|
2
|
3
|
4
|
5
|
|
(Closing Price) x (Weight)
|
109 X 1
or
111 x (5-4) =
|
111 X 2
or
111 x (5-3) =
|
110 X 3
or
111 x (5-2) =
|
111 x 4
or
111 x (5-1) =
|
112 x 5 =
|
And the weighted moving average or linearly weighed moving average would be
WMA = Sum of ((Closing Prices) x (weight))
--------------------------------------
(5+4+3+2+1)
Formula for weighted moving average:
So instead of the 5 days example if we are talking about n days and the values of N days starting with the most recent value as P(n), P(n-1), P(n-2) …. P(n-(n-1)) then the weighted moving average would be:
WMA (n days) =
N*P(n) + (N-1)*P(n-1) + (N-2)*P(n-2) + ….+ 2*P(n-(n-2)) + 1*P(n-(n-1))
-------------------------------------------------------------------------------
(N + (N-1) + (N-2) + ……. + 2 + 1)
Now the denominator here i.e. N + (N-1) + (N-2) + ……. + 2 + 1 is nothing but N(N+1)/2 because N + (N-1) + (N-2) + ……. + 2 + 1 = N(N+1)/2 So our simplified formulae for N days' weighted moving average is:
N*P(n) + (N-1)*P(n-1) + (N-2)*P(n-2) + ….+ 2*P(n-(n-2)) + 1*P(n-(n-1))
------------------------------------------------------------------------------
N(N+1)/2
Weighted Moving Average v/s Simple Moving Average:
Well, I prefer to use Weighted moving averages if the time frame of the technical analysis is long. For shorter time frame analysis I prefer simple moving averages.
Also read about Exponentially Weighted Moving Average which can be used when analysis is for even longer time frame.
Linearly Weighted Moving Average v/s EMA Weights:
Check about Moving Averages