WilderAverage

Category: Indicators

The WilderAverage function calculates the Wilder’s Moving Average, which is a type of exponential moving average developed by J. Welles Wilder. It is primarily used to smooth out price data and is often employed in various technical indicators to reduce volatility and noise. The Wilder Moving Average is different from a simple moving average in that it applies more weight to recent data points, making it more responsive to new information.

Syntax:

WilderAverage[N](price)

Where N represents the number of periods over which the average is calculated, and price indicates the price data (e.g., close, open, high, low) to be averaged.

Example:

To calculate the Wilder Moving Average for 26 periods using closing prices and then for 12 periods, you can use the following code:

long = WilderAverage[26](close)
short = WilderAverage[12](close)
WilderMACD = long - short
RETURN WilderMACD

In this example, long and short are variables storing the Wilder Moving Averages for 26 and 12 periods, respectively. The difference between these two averages, termed WilderMACD, is then calculated and returned. This difference can be used as a signal line in trading strategies, similar to how MACD (Moving Average Convergence Divergence) is used.

Additional Information:

  • The Wilder Moving Average is particularly popular in the calculation of other technical indicators like the Relative Strength Index (RSI) and Average True Range (ATR), also developed by Wilder.
  • Choosing the right period (N) depends on the specific application and market conditions. Shorter periods may respond quicker to price changes but can be noisier, while longer periods provide smoother but slower signals.

This function is a fundamental tool in technical analysis for financial markets, helping traders and analysts identify trends and potential reversal points in price movements.

Logo Logo
Loading...