WMA (Weighted Moving Average)

Indicator Description

WMA (Weighted Moving Average) is a linear weighted moving average that gives greater weight to recent price data, allowing it to reflect price changes more quickly.

Function Information

  • Function Name: WMA
  • Input Parameters:
    • #Kline: K-line data
  • Parameter Settings:
    • timeperiod: Time period (default: 30)
  • Output: Moving average value

Calculation Principle

WMA is calculated using the following formula:

WMA = (Price1 * n + Price2 * (n-1) + ... + Pricen * 1) / (n + (n-1) + ... + 1)

Where:

  • Price1 to Pricen are the prices of n periods
  • n is the time period

Usage Scenarios

  1. Trend identification and tracking
  2. Support and resistance level judgment
  3. Price breakout confirmation
  4. Trading signal generation
Last Updated: