Skip to content

trend indicator

WMA backtesting — Weighted Moving Average

The Weighted Moving Average (WMA) is a trend line that assigns linearly increasing weight to more recent closes, sitting between SMA and EMA in how quickly it responds to new price action. Like any moving average, its value as a trading signal depends entirely on the rule built around it and the market it is tested on.

Try WMA on BTC/USDT ETH/USDT SOL/USDT

How WMA works

WMA multiplies each close in the window by a weight that increases in a straight line toward the most recent candle, then divides by the sum of those weights. That linear weighting makes WMA respond to new price action faster than an SMA of the same length, but without the exponential tail EMA gives to very old data. CandleTest computes WMA with TradingView-parity math. It is commonly used as a trend-filter line — price crossing above or below it, optionally combined with the WMA’s own slope — both testable as no-code rules.

WMA settings

Lengthdefault 20

The averaging window. Shorter lengths track price closely with fast turns; longer lengths produce a steadier line that confirms trend changes later.

Example WMA strategies to backtest

Price-vs-WMA trend filter

Enter long when the close crosses above the WMA. Exit when the close crosses back below it.

WMA slope confirmation

Enter long when the close crosses above the WMA and the WMA is rising. Exit when the close crosses back below the WMA, or when the WMA turns to falling.

Every rule above is buildable in the no-code strategy builder — pick conditions, press run, and get win rate, drawdown and equity curve on real exchange data with fees and leverage modeled.

WMA FAQ

How is WMA different from EMA?

Both weight recent closes more than older ones, but WMA’s weighting increases in a straight line while EMA’s decays exponentially and technically never reaches zero. In practice this makes WMA a bit less reactive than an EMA of the same length — the difference is small enough that a side-by-side backtest is the only reliable way to pick between them.

What length should I use for a WMA trend rule?

There is no setting that works across every pair and timeframe — start from a common default and sweep a range of lengths for a price-crosses-WMA rule on your exact market before committing to one.

Does WMA reduce whipsaws compared to SMA?

It can, since it reacts a bit sooner to genuine trend shifts, but it will still whipsaw in a sideways market because it is a trend-following tool by design. Backtesting the specific rule over both trending and ranging periods shows the actual difference.

Can I combine WMA with a momentum indicator?

Yes — the strategy builder supports ANDing conditions, for example only taking a price-crosses-WMA long entry when RSI is above 50, to filter trend signals by underlying momentum.

Related indicators