Average True Range (ATR)
Returns the Average True Range, a volatility indicator that accounts for gaps by measuring the true range (including gap movements) over a period.
True Range Definition
True Range is the greatest of:
- Current High - Current Low
- |Current High - Previous Close|
- |Current Low - Previous Close|
ATR is the moving average of True Range values.
Common Uses
| Use Case | Application |
|---|---|
| Stop-loss placement | Set stops at 2-3x ATR from entry |
| Position sizing | Lower position size for high ATR |
| Volatility comparison | Compare volatility across stocks |
| Breakout confirmation | Large moves should exceed ATR |
Parameters
| Parameter | Description | Default |
|---|---|---|
| Symbol | Stock ticker symbol | Required |
| Days | Number of periods | 14 |
| StartDate | Calculate as of this date | Today |
Syntax
=AverageTrueRange(Symbol, [Days], [StartDate])Parameters
symbolstringRequired
Stock ticker symbol
daysstring
Number of periods for ATR calculation
startDatedate
Start date for calculation (defaults to today)
Returns
number
Average True Range value
Examples
=AverageTrueRange("AAPL")=AverageTrueRange("AAPL", "14")=AverageTrueRange("TSLA", "14")=AverageTrueRange("SPY", "20")=AverageTrueRange("AAPL", "14", DATE(2024,1,15))=AverageTrueRange(A1)When to Use
- Set trailing stop-losses based on volatility
- Position sizing for risk management
- Identify volatility expansion or contraction
- Confirm breakout strength
- Compare relative volatility across stocks
When NOT to Use
| Scenario | Use Instead |
|---|---|
| Need close-to-close volatility | StandardDeviationOnClosePrice() |
| Need momentum oscillator | RelativeStrengthIndex() |
| Need trend direction | SimpleMovingAverage() |
| Need directional movement | PlusDirectionalIndicator() or MinusDirectionalIndicator() |
Common Issues & FAQ
Why is ATR returning "NA"?
Check that:
- The symbol is valid and actively traded
- There is sufficient historical data for the period
- The stock has OHLC data available
How do I use ATR for stop-losses?
A common approach:
- Trailing stop = Entry Price - (2 x ATR) for longs
- Adjust multiplier based on your risk tolerance
What does a rising/falling ATR mean?
Rising ATR indicates increasing volatility (larger daily ranges), while falling ATR indicates decreasing volatility (smaller daily ranges).
Related Formulas
More MarketXLS Technical Indicators formulas you can use in the same worksheet:
- Average Volume 1 Year
- Average Volume 15 Days
- Average Volume 2 Years
- Average Volume 3 Months
- Average Volume 3 Years
- Average Volume 30 Days
- Average Volume 5 Years
- Average Volume 6 Months
See AverageTrueRange used in a complete workbook: Boost Your Investment Returns with the ROIC Formula
