wilderma

Wilder Moving Average (EMA with α = 1/N)

wilderma(source, periods)

A variant of the Exponential Moving Average using α = 1/N instead of 2/(N+1). Provides smoother averaging than standard EMA, commonly used in RSI and ATR.

Parameters

  • source (source): Data series to calculate Wilder MA on - price field (close, open, high, low) or indicator output
  • periods (int): Number of periods for the moving average
  • Common values: 14 (standard for RSI/ATR), 20

Formula


Wilder MA = EMA with α = 1/N

Where:
- α = smoothing factor = 1/periods
- Standard EMA uses α = 2/(periods+1)
- Wilder's is smoother than standard EMA

Examples


wilderma(close, 14);  # 14-period Wilder MA (used in RSI)
wilderma(close, 20);  # 20-period Wilder MA
x = wilderma(close, 14); close > x;  # Price above Wilder MA

Returns

Wilder moving average value

Notes

  • Smoother than standard EMA due to smaller smoothing constant
  • Preferred by Wilder for technical indicators
  • More weight on historical data compared to standard EMA