Weighted Moving Average (WMA)

Parameters: period = 20 (2–200)

Overview

The Weighted Moving Average (WMA) enhances the traditional moving average by applying a linear weighting scheme that gives more importance to recent prices. Unlike the Simple Moving Average which treats all data points equally, the WMA multiplies each price by a weight that decreases linearly as the data gets older. This makes the WMA more responsive to recent price movements while still providing the trend-smoothing benefits of a moving average.

The weighting scheme follows a triangular pattern where the most recent price receives the highest weight (n), the second most recent receives (n-1), and so on, with the oldest price receiving a weight of 1. The sum of these weights forms the denominator, calculated as n*(n+1)/2. This mathematical approach ensures the WMA responds more quickly to price changes than an SMA while being less reactive than an EMA.

Interpretation & Trading Signals

Trend Signals:

  • Rising WMA: Indicates uptrend, acts as dynamic support
  • Falling WMA: Indicates downtrend, acts as dynamic resistance
  • Price Above WMA: Bullish bias, potential buying opportunities on pullbacks
  • Price Below WMA: Bearish bias, potential selling opportunities on rallies

Crossover Signals:

  • Golden Cross: Short-term WMA crosses above long-term WMA (bullish)
  • Death Cross: Short-term WMA crosses below long-term WMA (bearish)
  • Price Crossover: Price crossing WMA can signal trend changes

Divergence & Reversal:

  • Flattening WMA: Signals potential trend exhaustion
  • Price/WMA Divergence: New price highs without new WMA highs suggests weakness
  • WMA Direction Change: Early warning of potential trend reversal

Example Usage

Code examples will be available once the Rust implementation is complete.

Performance Analysis

Related Indicators