ATR formula: how to calculate Average True Range (with Excel)
How the Average True Range is worked out — the true range of every candle, then Wilder's 14-period average of it. With a worked example, the Excel formulas, a free Excel sheet and a box to calculate ATR from your own high, low and close.
Last updated:
Needs: high, low, close · Standard settings: Period 14
The ATR formula
True range (TR) = the largest of
High − Low
|High − previous Close|
|Low − previous Close|
(first candle: High − Low)
First ATR = average of the first 14 true ranges
Next ATR = (previous ATR × 13 + current TR) ÷ 14The running average is Wilder's smoothing, the same one used in the RSI. ATR is in price points, the same units as the stock.
How to calculate ATR step by step
- Work out each candle's true range. Day 1 has no previous close, so its true range is 1,010.00 − 990.60 = 19.40.
- From the second candle, compare three distances. Day 2: High − Low = 16.85, |High − previous close| = 3.45, |Low − previous close| = 13.40. The largest is 16.85.
- Average the first 14 true ranges. Day 1 to Day 14 gives the first ATR (14) on Day 14: 22.06.
- Smooth from the next candle on. Day 15's true range is 12.85: (22.06 × 13 + 12.85) ÷ 14 = 21.41. Day 16 had a wider range (41.45), so ATR rises to 22.84.
- Repeat for every candle. On Day 60 the example's ATR (14) is 19.67.
Worked example — and calculate ATR from your own prices
The table works through 60 daily candles of an imaginary stock, column by column — the same columns as the Excel sheet. To calculate ATR for your own stock, clear the box and paste your high, low, close from Excel or your broker's download.
Latest values
| Day | High | Low | Close | High − Low | |High − prev close| | |Low − prev close| | True range | ATR (14) |
|---|---|---|---|---|---|---|---|---|
| Day 1 | 1,010.00 | 990.60 | 1,001.15 | 19.40 | 19.40 | |||
| Day 2 | 1,004.60 | 987.75 | 987.95 | 16.85 | 3.45 | 13.40 | 16.85 | |
| Day 3 | 1,011.50 | 986.00 | 1,009.15 | 25.50 | 23.55 | 1.95 | 25.50 | |
| Day 4 | 1,015.00 | 1,001.85 | 1,012.60 | 13.15 | 5.85 | 7.30 | 13.15 | |
| Day 5 | 1,012.00 | 990.80 | 993.25 | 21.20 | 0.60 | 21.80 | 21.80 | |
| Day 6 | 1,012.60 | 990.90 | 1,008.60 | 21.70 | 19.35 | 2.35 | 21.70 | |
| Day 7 | 1,018.95 | 1,003.80 | 1,013.60 | 15.15 | 10.35 | 4.80 | 15.15 | |
| Day 8 | 1,012.95 | 994.75 | 1,001.55 | 18.20 | 0.65 | 18.85 | 18.85 | |
| Day 9 | 1,033.25 | 995.30 | 1,031.55 | 37.95 | 31.70 | 6.25 | 37.95 | |
| Day 10 | 1,046.15 | 1,028.50 | 1,040.05 | 17.65 | 14.60 | 3.05 | 17.65 | |
| Day 11 | 1,041.80 | 1,027.70 | 1,033.15 | 14.10 | 1.75 | 12.35 | 14.10 | |
| Day 12 | 1,065.80 | 1,031.15 | 1,064.80 | 34.65 | 32.65 | 2.00 | 34.65 | |
| Day 13 | 1,086.00 | 1,056.85 | 1,083.55 | 29.15 | 21.20 | 7.95 | 29.15 | |
| Day 14 | 1,090.25 | 1,067.25 | 1,067.95 | 23.00 | 6.70 | 16.30 | 23.00 | 22.0643 |
| Day 15 | 1,074.30 | 1,061.45 | 1,063.50 | 12.85 | 6.35 | 6.50 | 12.85 | 21.4061 |
| Day 16 | 1,067.35 | 1,025.90 | 1,030.20 | 41.45 | 3.85 | 37.60 | 41.45 | 22.8378 |
| Day 17 | 1,033.00 | 1,011.75 | 1,012.20 | 21.25 | 2.80 | 18.45 | 21.25 | 22.7244 |
| Day 18 | 1,019.90 | 979.85 | 981.60 | 40.05 | 7.70 | 32.35 | 40.05 | 23.9620 |
| Day 19 | 988.30 | 969.40 | 970.55 | 18.90 | 6.70 | 12.20 | 18.90 | 23.6004 |
| Day 20 | 973.10 | 959.05 | 960.90 | 14.05 | 2.55 | 11.50 | 14.05 | 22.9182 |
| Day 21 | 980.35 | 958.30 | 978.30 | 22.05 | 19.45 | 2.60 | 22.05 | 22.8562 |
| Day 22 | 981.50 | 957.00 | 958.85 | 24.50 | 3.20 | 21.30 | 24.50 | 22.9736 |
| Day 23 | 963.00 | 942.60 | 946.75 | 20.40 | 4.15 | 16.25 | 20.40 | 22.7898 |
| Day 24 | 957.70 | 931.65 | 937.95 | 26.05 | 10.95 | 15.10 | 26.05 | 23.0227 |
| Day 25 | 945.75 | 926.05 | 927.85 | 19.70 | 7.80 | 11.90 | 19.70 | 22.7853 |
| Day 26 | 924.60 | 910.25 | 911.20 | 14.35 | 3.25 | 17.60 | 17.60 | 22.4149 |
| Day 27 | 919.05 | 900.00 | 905.15 | 19.05 | 7.85 | 11.20 | 19.05 | 22.1746 |
| Day 28 | 904.50 | 884.70 | 885.95 | 19.80 | 0.65 | 20.45 | 20.45 | 22.0514 |
| Day 29 | 891.25 | 871.55 | 874.70 | 19.70 | 5.30 | 14.40 | 19.70 | 21.8834 |
| Day 30 | 880.70 | 849.70 | 855.80 | 31.00 | 6.00 | 25.00 | 31.00 | 22.5346 |
| Day 31 | 868.95 | 858.15 | 862.15 | 10.80 | 13.15 | 2.35 | 13.15 | 21.8643 |
| Day 32 | 875.05 | 859.50 | 866.45 | 15.55 | 12.90 | 2.65 | 15.55 | 21.4133 |
| Day 33 | 870.55 | 843.00 | 845.10 | 27.55 | 4.10 | 23.45 | 27.55 | 21.8516 |
| Day 34 | 854.70 | 846.55 | 851.55 | 8.15 | 9.60 | 1.45 | 9.60 | 20.9765 |
| Day 35 | 863.70 | 847.85 | 860.20 | 15.85 | 12.15 | 3.70 | 15.85 | 20.6103 |
| Day 36 | 862.95 | 845.40 | 854.80 | 17.55 | 2.75 | 14.80 | 17.55 | 20.3917 |
| Day 37 | 882.25 | 858.05 | 877.20 | 24.20 | 27.45 | 3.25 | 27.45 | 20.8959 |
| Day 38 | 893.65 | 868.85 | 888.45 | 24.80 | 16.45 | 8.35 | 24.80 | 21.1748 |
| Day 39 | 908.35 | 889.60 | 905.40 | 18.75 | 19.90 | 1.15 | 19.90 | 21.0837 |
| Day 40 | 913.10 | 895.65 | 896.80 | 17.45 | 7.70 | 9.75 | 17.45 | 20.8242 |
| Day 41 | 894.65 | 887.85 | 889.60 | 6.80 | 2.15 | 8.95 | 8.95 | 19.9760 |
| Day 42 | 898.55 | 884.80 | 895.30 | 13.75 | 8.95 | 4.80 | 13.75 | 19.5313 |
| Day 43 | 920.60 | 889.25 | 919.00 | 31.35 | 25.30 | 6.05 | 31.35 | 20.3755 |
| Day 44 | 920.60 | 916.30 | 918.35 | 4.30 | 1.60 | 2.70 | 4.30 | 19.2272 |
| Day 45 | 919.30 | 903.80 | 906.25 | 15.50 | 0.95 | 14.55 | 15.50 | 18.9610 |
| Day 46 | 937.35 | 900.30 | 932.10 | 37.05 | 31.10 | 5.95 | 37.05 | 20.2531 |
| Day 47 | 947.15 | 930.20 | 944.35 | 16.95 | 15.05 | 1.90 | 16.95 | 20.0171 |
| Day 48 | 949.20 | 937.25 | 948.70 | 11.95 | 4.85 | 7.10 | 11.95 | 19.4409 |
| Day 49 | 971.15 | 949.05 | 966.35 | 22.10 | 22.45 | 0.35 | 22.45 | 19.6558 |
| Day 50 | 965.90 | 954.75 | 955.60 | 11.15 | 0.45 | 11.60 | 11.60 | 19.0804 |
| Day 51 | 971.35 | 954.15 | 969.10 | 17.20 | 15.75 | 1.45 | 17.20 | 18.9461 |
| Day 52 | 997.00 | 966.55 | 984.35 | 30.45 | 27.90 | 2.55 | 30.45 | 19.7678 |
| Day 53 | 992.30 | 980.25 | 980.90 | 12.05 | 7.95 | 4.10 | 12.05 | 19.2165 |
| Day 54 | 984.70 | 961.40 | 962.50 | 23.30 | 3.80 | 19.50 | 23.30 | 19.5082 |
| Day 55 | 964.60 | 953.00 | 960.20 | 11.60 | 2.10 | 9.50 | 11.60 | 18.9433 |
| Day 56 | 969.05 | 954.50 | 967.35 | 14.55 | 8.85 | 5.70 | 14.55 | 18.6295 |
| Day 57 | 982.20 | 960.60 | 971.00 | 21.60 | 14.85 | 6.75 | 21.60 | 18.8417 |
| Day 58 | 987.10 | 967.55 | 981.75 | 19.55 | 16.10 | 3.45 | 19.55 | 18.8923 |
| Day 59 | 999.95 | 979.00 | 994.85 | 20.95 | 18.20 | 2.75 | 20.95 | 19.0393 |
| Day 60 | 1,015.15 | 987.35 | 1,012.35 | 27.80 | 20.30 | 7.50 | 27.80 | 19.6650 |
The example prices are made up for this page — they are not real market data. ATR is a calculation from past prices, not a forecast, a signal or advice to buy or sell. MyAlgoMate provides trading technology, not investment advice.
How to calculate ATR in Excel
Put the headings in row 1 and the first candle in row 2, oldest at the top. Then type these formulas — each column uses the ones to its left:
- A
Day
A2 downwards: your dates, oldest at the top.
- B
High
B2 downwards: the high prices, oldest at the top.
- C
Low
C2 downwards: the low prices, oldest at the top.
- D
Close
D2 downwards: the closing prices, oldest at the top.
- E
High - Low
E2
=B2-C2— then copy it down to the last row. - F
|High - prev close|
F3
=ABS(B3-D2)— then copy it down to the last row. - G
|Low - prev close|
G3
=ABS(C3-D2)— then copy it down to the last row. - H
True range
H2
=E2— this cell only (the starting value).H3
=MAX(E3,F3,G3)— then copy it down to the last row. - I
ATR (14)
I15
=AVERAGE(H2:H15)— this cell only (the starting value).I16
=(I15*13+H16)/14— then copy it down to the last row.
The first ATR needs 14 true ranges, so column I starts in row 15.
Prefer not to type them? The free sheet has every formula filled in for the example prices — replace the prices with yours and extend the rows. It opens in Microsoft Excel (we checked every value against the table above), and you can import it into Google Sheets or LibreOffice.
Download the free ATR Excel sheet (.xlsx)ATR in other calculations
ATR is the building block of the Supertrend bands and of Keltner Channels, and the true range is part of the ADX. Some traders also measure a stop-loss distance in ATRs: the arithmetic is just ATR × the multiple — for example, 2 × an ATR of 19.67 = 39.33 points. Which multiple to use, if any, is your own decision; the position size calculator then works out the quantity for the risk you choose.
ATR describes how much prices have moved. It is a calculation, not a forecast or advice.
ATR calculation — questions, answered.
For each candle take the true range: the largest of High − Low, |High − previous close| and |Low − previous close|. The first ATR (14) is the average of the first 14 true ranges; after that, ATR = (previous ATR × 13 + today's true range) ÷ 14.
High, low and close in columns B, C and D from row 2. True range in H3: =MAX(B3-C3,ABS(B3-D2),ABS(C3-D2)) (in H2, the first row, just =B2-C2). First ATR in I15: =AVERAGE(H2:H15). From I16: =(I15*13+H16)/14, copied down. The free sheet on this page also shows the three parts of the true range.
The full distance a candle covered, including any gap from the previous close. Normally it is just High − Low, but if a candle opens with a gap, the distance from the previous close to the far end of the candle is larger and counts instead.
ATR % = ATR ÷ Close × 100. In the example on this page, Day 60's ATR of 19.67 on a close of 1,012.35 is 1.94%. Expressing it as a percentage lets you compare stocks with very different prices.
No. ATR only measures how big the candles' ranges have been, up or down. A rising ATR means larger ranges, not rising prices.
Check the smoothing — most charts use Wilder's (as here), but some offer a simple, exponential or weighted average of the true range. The starting point matters too: Wilder's smoothing remembers earlier candles, so use plenty of history. Spot vs futures prices and the timeframe also change it.
More indicator formulas, with Excel sheets
Turn your own rules into automated orders.
Already use ATR in your own rules? MyAlgoMate's algo trading software places the orders your rules call for at 150+ Indian brokers — and TradeBridge turns your own TradingView or Chartink alerts into live orders. You decide the rules; we provide the technology.