MyAlgoMate
// INDICATOR FORMULA

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:

Download the free ATR Excel sheet (.xlsx)

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) ÷ 14

The 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

  1. 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.
  2. 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.
  3. Average the first 14 true ranges. Day 1 to Day 14 gives the first ATR (14) on Day 14: 22.06.
  4. 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.
  5. 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.

One row per candle, oldest first. Paste straight from Excel or your broker's download; a date or time column becomes the row label. Filled with our example prices.

Latest values

ATR (14): 19.6650
ATR calculated from the example prices
DayHighLowCloseHigh − Low|High − prev close||Low − prev close|True rangeATR (14)
Day 11,010.00990.601,001.1519.4019.40
Day 21,004.60987.75987.9516.853.4513.4016.85
Day 31,011.50986.001,009.1525.5023.551.9525.50
Day 41,015.001,001.851,012.6013.155.857.3013.15
Day 51,012.00990.80993.2521.200.6021.8021.80
Day 61,012.60990.901,008.6021.7019.352.3521.70
Day 71,018.951,003.801,013.6015.1510.354.8015.15
Day 81,012.95994.751,001.5518.200.6518.8518.85
Day 91,033.25995.301,031.5537.9531.706.2537.95
Day 101,046.151,028.501,040.0517.6514.603.0517.65
Day 111,041.801,027.701,033.1514.101.7512.3514.10
Day 121,065.801,031.151,064.8034.6532.652.0034.65
Day 131,086.001,056.851,083.5529.1521.207.9529.15
Day 141,090.251,067.251,067.9523.006.7016.3023.0022.0643
Day 151,074.301,061.451,063.5012.856.356.5012.8521.4061
Day 161,067.351,025.901,030.2041.453.8537.6041.4522.8378
Day 171,033.001,011.751,012.2021.252.8018.4521.2522.7244
Day 181,019.90979.85981.6040.057.7032.3540.0523.9620
Day 19988.30969.40970.5518.906.7012.2018.9023.6004
Day 20973.10959.05960.9014.052.5511.5014.0522.9182
Day 21980.35958.30978.3022.0519.452.6022.0522.8562
Day 22981.50957.00958.8524.503.2021.3024.5022.9736
Day 23963.00942.60946.7520.404.1516.2520.4022.7898
Day 24957.70931.65937.9526.0510.9515.1026.0523.0227
Day 25945.75926.05927.8519.707.8011.9019.7022.7853
Day 26924.60910.25911.2014.353.2517.6017.6022.4149
Day 27919.05900.00905.1519.057.8511.2019.0522.1746
Day 28904.50884.70885.9519.800.6520.4520.4522.0514
Day 29891.25871.55874.7019.705.3014.4019.7021.8834
Day 30880.70849.70855.8031.006.0025.0031.0022.5346
Day 31868.95858.15862.1510.8013.152.3513.1521.8643
Day 32875.05859.50866.4515.5512.902.6515.5521.4133
Day 33870.55843.00845.1027.554.1023.4527.5521.8516
Day 34854.70846.55851.558.159.601.459.6020.9765
Day 35863.70847.85860.2015.8512.153.7015.8520.6103
Day 36862.95845.40854.8017.552.7514.8017.5520.3917
Day 37882.25858.05877.2024.2027.453.2527.4520.8959
Day 38893.65868.85888.4524.8016.458.3524.8021.1748
Day 39908.35889.60905.4018.7519.901.1519.9021.0837
Day 40913.10895.65896.8017.457.709.7517.4520.8242
Day 41894.65887.85889.606.802.158.958.9519.9760
Day 42898.55884.80895.3013.758.954.8013.7519.5313
Day 43920.60889.25919.0031.3525.306.0531.3520.3755
Day 44920.60916.30918.354.301.602.704.3019.2272
Day 45919.30903.80906.2515.500.9514.5515.5018.9610
Day 46937.35900.30932.1037.0531.105.9537.0520.2531
Day 47947.15930.20944.3516.9515.051.9016.9520.0171
Day 48949.20937.25948.7011.954.857.1011.9519.4409
Day 49971.15949.05966.3522.1022.450.3522.4519.6558
Day 50965.90954.75955.6011.150.4511.6011.6019.0804
Day 51971.35954.15969.1017.2015.751.4517.2018.9461
Day 52997.00966.55984.3530.4527.902.5530.4519.7678
Day 53992.30980.25980.9012.057.954.1012.0519.2165
Day 54984.70961.40962.5023.303.8019.5023.3019.5082
Day 55964.60953.00960.2011.602.109.5011.6018.9433
Day 56969.05954.50967.3514.558.855.7014.5518.6295
Day 57982.20960.60971.0021.6014.856.7521.6018.8417
Day 58987.10967.55981.7519.5516.103.4519.5518.8923
Day 59999.95979.00994.8520.9518.202.7520.9519.0393
Day 601,015.15987.351,012.3527.8020.307.5027.8019.6650
Everything is worked out in your browser. Nothing you paste is stored or sent.

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:

  1. A

    Day

    A2 downwards: your dates, oldest at the top.

  2. B

    High

    B2 downwards: the high prices, oldest at the top.

  3. C

    Low

    C2 downwards: the low prices, oldest at the top.

  4. D

    Close

    D2 downwards: the closing prices, oldest at the top.

  5. E

    High - Low

    E2 =B2-C2 — then copy it down to the last row.

  6. F

    |High - prev close|

    F3 =ABS(B3-D2) — then copy it down to the last row.

  7. G

    |Low - prev close|

    G3 =ABS(C3-D2) — then copy it down to the last row.

  8. H

    True range

    H2 =E2 — this cell only (the starting value).

    H3 =MAX(E3,F3,G3) — then copy it down to the last row.

  9. 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.

// FAQ

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.

Share this page