Average True Range (ATR)
factor.formula
True Range (TR) =
Average True Range (ATR) =
default:
Explanation of symbols in the formula:
- :
Highest price of the day
- :
Lowest price of the day
- :
Closing price of the day
- :
Previous day's closing price
- :
Absolute value
- :
Take the maximum value
- :
Exponential moving average of the true range (TR) over N days
- :
The window period used to calculate ATR. The default value is 20.
factor.explanation
ATR effectively solves the interference of gaps on volatility measurement by calculating the maximum change in the price fluctuation of the day relative to the closing price of the previous day. Specifically, the daily true range (TR) is first calculated, which is the maximum of the difference between the highest and lowest prices of the day, the absolute value of the difference between the highest price of the day and the closing price of the previous day, and the absolute value of the difference between the lowest price of the day and the closing price of the previous day. Then, the TR is exponentially moved averaged for a specified period (usually 20 days) to obtain the final average true range (ATR). Compared with the simple moving average, the exponential moving average gives a higher weight to recent data, enabling it to capture changes in price volatility more quickly. ATR can be used to determine the volatility of the current market and assist in formulating trading strategies. For example, when ATR is high, it means that the market is volatile and a wider stop loss or take profit setting can be considered; when ATR is low, it means that the market is less volatile and a relatively compact stop loss or take profit setting can be adopted. In addition, ATR can be used in combination with other technical indicators to improve the accuracy of trading decisions.