Linearly weighted moving average (LWMA) is a technical indicator used in financial analysis to smooth price data over a specified time period. It assigns greater weights to more recent data points, making it more responsive to price changes compared to simple moving averages (SMAs).
Understanding Linearly Weighted Moving Average
The linearly weighted moving average is calculated by multiplying each data point’s price by a weight factor. The weight factor increases linearly as the data point gets more recent. Therefore, the most recent data points have a greater impact on the average than older data points.
Calculation
o calculate a linearly weighted moving average, follow these steps:
- Determine the number of periods (N) to include in the calculation.
- Assign weight factors ranging from 1 to N, with N being the weight for the most recent period.
- Multiply each data point by its respective weight factor.
- Sum up the weighted data points.
- Divide the sum by the sum of the weight factors to obtain the linearly weighted moving average.
The formula for calculating the LWMA is:
����=∑�=1�(��×�)∑�=1��LWMA=∑i=1Ni∑i=1N(Pi×i)
Where:
- LWMA is the linearly weighted moving average.
- ��Pi is the price of the data point for period i.
- N is the number of periods.
Example
Suppose we want to calculate the LWMA for a stock‘s closing prices over the past five days. We assign weights of 1, 2, 3, 4, and 5 to the most recent to the oldest data points, respectively. If the closing prices for the last five days are $50, $51, $52, $53, and $54, the LWMA would be calculated as follows:
����=(50×1)+(51×2)+(52×3)+(53×4)+(54×5)1+2+3+4+5LWMA=1+2+3+4+5(50×1)+(51×2)+(52×3)+(53×4)+(54×5)
����=50+102+156+212+27015LWMA=1550+102+156+212+270
����=79015LWMA=15790
����=52.67LWMA=52.67
Therefore, the LWMA for the last five days would be $52.67.
Advantages and Disadvantages
Linearly weighted moving averages offer several advantages over simple moving averages, including greater responsiveness to price changes and reduced lag. However, they can be more sensitive to outliers and may result in more false signals during choppy market conditions.