# How to calculate ATR

The Average True Range (ATR) of an asset is a historical volatility indicator that calculates the average of a number of previous True Range values. The True Range (TR) of an asset can be defined as follows:<br>

ATRx = (TRt + … + TRt-x) / Opent-x

Where: ATRx – Rolling x-day Average True Range\
TRt – True Range in period t\
Opent – Open price in period t

\
The ATR and TR values allow us to understand historical volatilities; and when we compare these values across various periods we can gauge how volatility of an asset has changed with time. By understanding ATR as a historical volatility indicator we can use is to appreciate the trading opportunities inherit in the asset and the risk that come with it.\
In this example we calculate rolling one day ATRs for the S\&P500, and compare averages of these rolling ATRs over different periods in time.&#x20;

![](/files/-MbCjcOgetzi8tM7Xrq-)

{% file src="/files/-MbCjiQ1\_BhPex2rd0JR" %}
Download - ATR SP500
{% endfile %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.atraderlife.com/courses/excel-tips/calculate-atr.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
