# Linearly Weighted Moving Average (LWMA)

## What is a linear weighted moving average?

A linear weighted moving average (LWMA) is a moving average calculation that more heavily weights recent price data. The most recent price has the highest weighting, and each previous price has progressively less weight. The weights fall linearly. LWMA reacts more quickly to price changes than simple moving averages (SMA) and exponential moving averages (EMA).

### Key points to remember

• Use a linearly weighted moving average in the same way as an SMA or EMA.
• Use an LWMA to more clearly define price trends and inversions, provide cross-based trade signals and indicate areas of potential support or resistance.
• Traders who want a moving average with less lag than an SMA may want to use an LWMA.

## The linear weighted moving average (LWMA) formula is:

The

begin {aligned} & text {LWMA} = frac { left (P_n * W_1 right) + left (P_ {n-1} * W_2 right) + left (P_ {n-2} * W_3 right) …} { sum {W}} \ & textbf {where:} \ & text {P = Price for the period} \ & text {n = The most recent period , n-1 is the previous period,} \ & text {and n-2 is two previous periods} \ & text {W = The weight assigned to each period, with the} \ & text {weight the highest go first and then go down linearly} \ & text {depending on the number of periods used} \ end {aligned}

TheLWMA=ΣW(PnotThe*W1The)+(Pnot1The*W2The)+(Pnot2The*W3The)...Theor:P = Price for the periodn = the most recent period, n-1 is the previous period,and n-2 is two earlier periodsW = The weight assigned to each period, with thehighest weight first then down linearlydepending on the number of periods usedTheThe

## How to Calculate the Linear Weighted Moving Average (LWMA)

1. Choose a period of analysis. This is the number of n values ​​that will be calculated in the LWMA.
2. Calculate the linear weights for each period. This can be accomplished in two ways. The easiest way is to assign n as the weight for the first value. For example, if you use an analysis period of 100 periods, the first value is multiplied by a weight of 100, the next value is multiplied by a weight of 99. A more complex method is to choose a different weight for the value the most recent, like 30. Now, each value should drop 30/100 so that when n-99 (100th period) is reached, the weight will be one.
3. Multiply the prices for each period by their respective weights, then get the total sum.
4. Divide the above by the sum of all weights.

Let’s say we want to calculate the linearly weighted moving average of the the last price of a stock in the last five days.

Start by multiplying the price of the day by 5, that of yesterday by 4 and the price of the day before by 3. Continue multiplying the price of each day by its position in the data series until you reach the first price of the data series, which is multiplied by 1. Add these results, divide by the sum of the weights and you will get the linearly weighted moving average for this period.

((P5 * 5) + (P4 * 4) + (P3 * 3) + (P2 * 2) + (P1 * 1)) / (5 + 4 + 3 + 2 + 1)

Let’s say that the price of this stock fluctuates as follows:

Day 5: $90.90 Day 4:$ 90.36
Day 3: $90.28 Day 2:$ 90.83
Day 1: $90.91 ((90.90 * 5) + (90.36 * 4) + (90.28 * 3) + (90.83 * 2) + (90.91 * 1)) / (5 + 4 + 3 + 2 + 1) = 90.62 The LWMA of this stock during this period is$ 90.62.

## What does the Linear Weighted Moving Average (LWMA) tell you?

The linearly weighted moving average is a method of calculating the average price of an asset over a given period of time. This method weights recent data more strongly than older data and is used to analyze the market tendencies.

Generally, when the price is higher than the LWMA and the LWMA increases, the price is higher than the weighted average, which confirms a upward trend. If the price is lower than the LWMA and the LWMA is pointing down, this confirms downward trend in the price.

When the price crosses the LWMA, this could signal a change in trend. For example, if the price is above the LWMA and then drops below it, this could indicate a shift from an uptrend to a downtrend.

When assessing trends, traders should be aware of the period of decline. The analysis period is the number of periods that are calculated in the LWMA. A five-period LWMA will follow prices very closely and is useful for following small trends as the line will be easily broken by even minor price swings. A 100-period LWMA will not follow the price as closely, which means there will often be room between the LWMA and the price. This helps determine longer term trends and inversions.

Like other types of moving averages, the LWMA can sometimes be used to indicate support and resistance areas. For example, in the past the price has rebounded on the LWMA several times and then increased. This indicates that the line serves as a support. The line could continue to serve as support in the future. Failure to do so could indicate that the price trend has changed. It could reverse downward or start a period where it moves more sideways.

## What is the difference between a linear weighted moving average (LWMA) and a double exponential moving average (DEMA)?

These two moving averages are designed to reduce the lag inherent in SMA. The LWMA achieves this by applying greater weight to recent prices. the double exponential moving average (DEMA) does this by multiplying the EMA over a certain period by two, then subtracting a smoothed EMA. Because MAs are calculated differently, they will provide different values ​​on a price graph.

## Limits of using a linear weighted moving average (LWMA)

All moving averages help define trends when present, but provide little information when price action is jerky or moving mainly laterally. During these periods, the price fluctuates around the MA. The MA will not provide good crossover or support / resistance signals during these periods.

An LWMA may not provide support or resistance. This is particularly likely if he has not done so in the past.

Many false signals can also occur before a significant trend develops. A false signal is when the price crosses the LWMA but then fails to move in the expected direction, resulting in a bad trade.