Mastering ATR Smoothing Techniques for MetaTrader 4

Mike 2021.09.15 02:15 32 0 0
Attachments

The Average True Range (ATR) is a powerful indicator that helps traders gauge market volatility. This particular ATR indicator utilizes the True Range formula, which measures the greatest of the following: (High - Low), Abs(High - Previous Close), and Abs(Low - Previous Close). Here, 'Abs' refers to the absolute value.

To kick things off, the indicator computes the true range for a specified number of bars (referred to as the Length input) and then calculates the Simple Moving Average (SMA) from these values. This gives us the initial ATR value.

Different Smoothing Methods

  • RMA (Running Moving Average): The alpha coefficient is set as alpha = 1/Length. The RMA is calculated using the formula: rma = alpha * (true range value of this candle) + (1-alpha) * (last rma).
  • SMA: For each bar, the simple average of the true range values is calculated over the defined number of bars (Length). This is equivalent to the built-in iATR value.
  • EMA (Exponential Moving Average): The alpha coefficient here is defined as alpha = 2/(1 + Length). The EMA is computed as follows: ema = alpha * (true range value of this candle) + (1-alpha) * (last ema).
  • WMA (Weighted Moving Average): This method calculates the weighted average of the true range values for the specified number of bars (Length) as: sum = N * (tr[0]) + (N-1) * (tr[1]) + ... + 1 * (tr[N-1]), where 'tr' represents the true range value of the candle. Finally, wma = sum / (N*(N+1)/2).

Example: XAUUSD on the H1 timeframe

  • RMA:
  • ATR with RMA smoothing
  • EMA:
  • ATR with EMA smoothing
  • SMA:
  • ATR with SMA smoothing
  • WMA:
  • ATR with WMA smoothing
List
Comments 0