LWMA in Forex: How the Linear Weighted Moving Average Works

Updated 14 Nov 2026

Moving averages are among the most widely used tools in trading, but not all moving averages are built the same way. Open the Moving Average settings in MetaTrader and you will see four methods: Simple, Exponential, Smoothed and Linear Weighted. The last one, known as the LWMA, gives more importance to recent prices in a simple, transparent way, making it faster than a simple moving average while staying easy to understand.

This guide explains what LWMA is, how it is calculated, how it compares with other moving averages and how to use it in Forex trading and Expert Advisor (EA).

LWMA in Forex: How the Linear Weighted Moving Average Works

What is the LWMA?

The Linear Weighted Moving Average (LWMA), also called the Weighted Moving Average (WMA), is a moving average that assigns a linearly increasing weight to each price in the period. The most recent price gets the highest weight, the one before it gets slightly less, and so on, down to the oldest price, which gets a weight of 1.

Because recent prices count more, the LWMA reacts faster to new price movements than a Simple Moving Average (SMA) of the same length.

How LWMA Is Calculated

For a period of N, the weights are N for the most recent price, N − 1 for the previous price, and so on down to 1 for the oldest price.

LWMA = (P1 × 1 + P2 × 2 + … + PN × N) ÷ (1 + 2 + … + N)

Here P1 is the oldest price and PN is the most recent. The sum of the weights equals N × (N + 1) ÷ 2.

Example: 5-period LWMA on EUR/USD closes

Bar

Close

Weight

Close × weight

Oldest

1.0800

1

1.0800

2

1.0810

2

2.1620

3

1.0805

3

3.2415

4

1.0820

4

4.3280

Most recent

1.0830

5

5.4150

Total

 

15

16.2265

LWMA = 16.2265 ÷ 15 ≈ 1.08177

The 5-period SMA of the same closes is 1.08130. The LWMA sits closer to the latest prices because the rising recent closes carry more weight.

LWMA vs SMA vs EMA vs SMMA

Moving average

How it weights prices

Speed

Typical use

SMA (Simple)

Equal weight for all prices in the period

Slowest

Long-term trend, key levels such as the 200 SMA

SMMA (Smoothed)

Very smooth, long memory of past prices

Slow

Filtering noise, used in indicators such as the Alligator

EMA (Exponential)

Exponentially more weight on recent prices; older prices never fully drop out

Fast

Trend following, crossovers

LWMA (Linear Weighted)

Linearly more weight on recent prices; only the last N prices count

Fast

Responsive trend and timing signals

The LWMA and EMA are both fast, but they behave differently. The LWMA uses only the prices inside its period, so an old price spike drops out completely after N bars. The EMA keeps a small influence from all past prices. In practice, an LWMA often hugs price slightly more closely than an EMA of the same period.

How to Read the LWMA

LWMA Trading Strategies

Trend filter

Use a longer LWMA, such as 50 or 100, to define the trend. Take only long trades when price is above a rising LWMA and only short trades when price is below a falling LWMA. Then use price action or another setup for entries.

LWMA crossover

A classic approach uses two LWMAs, for example 5 and 20 periods:

Because LWMA reacts quickly, crossovers come earlier than with SMAs, but they also produce more false signals in ranging markets. Adding a higher-timeframe trend filter improves reliability.

Dynamic support and resistance

In trending markets, price often pulls back to a medium-term LWMA, such as the 20 or 34, before continuing. Traders look for rejection candles near the line to enter in the trend direction, with a stop beyond the recent swing point.

Combining with key levels

An LWMA pullback that lines up with a strong level is more reliable. Examples include the Point of Control, an order block, or a zone just after a liquidity sweep.

LWMA Trading Strategies

Choosing LWMA Settings

Purpose

Common periods

Short-term timing, scalping

5 to 10

Swing trading, pullbacks

20 to 34

Trend filter

50 to 100

Long-term trend

200

You can also choose which price the LWMA uses: close, typical price (high + low + close ÷ 3) or weighted close. The close is the most common choice.

On MetaTrader 4 and 5, add the standard Moving Average indicator and choose Linear Weighted as the MA method. On TradingView, the same calculation is available as WMA.

Using LWMA in Expert Advisors

LWMA is widely used in EAs for trend filters, crossover signals and exit rules. When building or testing one:

Combining LWMA With Other Tools

Advantages of LWMA

Limitations of LWMA

Frequently Asked Questions

What does LWMA stand for?
LWMA stands for Linear Weighted Moving Average, a moving average that gives linearly more weight to recent prices.

Is LWMA the same as WMA?
Yes. Most platforms use WMA and LWMA for the same calculation. MetaTrader calls it “Linear Weighted”.

Is LWMA better than EMA?
Neither is better in every situation. LWMA uses only prices inside its period and often hugs price slightly more closely; EMA keeps some influence from older prices. Test both with your strategy.

What is the best LWMA period?
It depends on your timeframe and goal. Common choices are 5 to 10 for timing, 20 to 34 for pullbacks and 50 to 200 for trend filters.

Conclusion

The Linear Weighted Moving Average gives recent prices more importance in a simple, predictable way, making it faster and more responsive than a simple moving average. Use it to define trends, time crossovers and find dynamic support and resistance. Add a trend filter and key-level confirmation to reduce whipsaws, and always test your settings before trading live.

Risk warning: Trading Forex and CFDs on margin carries a high level of risk and may not be suitable for all investors. This article is for educational purposes only and is not investment advice.

More in Strategies & Indicators

All Strategies & Indicators →