Quantitative Analysis · Data Science · Machine Learning

# Average True Range – ATR

## Average True Range

The Average True Range (ATR) is a technical analysis indicator that measures the volatility of a security’s price. It is calculated using the following formula:

### ATR = [(Previous ATR x (N – 1)) + True Range] / N

Where “Previous ATR” is the previous period’s ATR, “N” is the number of periods used to calculate the ATR (typically 14), and “True Range” is the greatest of the following:

• The current high minus the current low
• The absolute value of the current high minus the previous close
• The absolute value of the current low minus the previous close

The ATR is typically displayed as a single line on a chart and is expressed in terms of the security’s price.

## There are several ways that the ATR can be used in an algorithmic trading strategy:

1. Volatility: The ATR can be used to measure the volatility of a security’s price. A high ATR indicates that the security’s price is moving significantly and that it may be more risky to trade. A low ATR indicates that the security’s price is relatively stable and that it may be less risky to trade.
2. Stop-loss orders: The ATR can be used to set stop-loss orders, which are orders to sell a security if it reaches a certain price. The ATR can be used to determine the appropriate distance for a stop-loss order, so that the security is sold if it moves too far in the wrong direction.
3. Trailing stop-loss orders: The ATR can also be used to set trailing stop-loss orders, which are orders to sell a security if it moves a certain distance in the wrong direction. The ATR can be used to determine the appropriate distance for a trailing stop-loss order, so that the security is sold if it moves too far in the wrong direction after the trade has been entered.
4. Position sizing: The ATR can be used to determine the appropriate position size for a trade, based on the volatility of the security’s price. A high ATR may indicate that a smaller position size is appropriate, while a low ATR may indicate that a larger position size is appropriate.

It’s important to note that the ATR should be used in conjunction with other technical analysis tools and fundamental analysis in order to provide a well-rounded view of a security’s market conditions.