Chart ContextTools & field guides

Chart Context / Tools & field guides

True Range and Wilder ATR Calculator from OHLC

Measure historical price movement while including gaps from the previous close. Paste chronological OHLC bars and the close before the first bar. The tool shows the latest true range, Wilder ATR, and ATR as a percentage of the final close.

No signup requiredCalculated in your browser

Work it out

The starting values are an illustration, not a suggested trade or allocation.

Your inputs are not sent to a server or stored by this calculator.

Worked example

True ranges are 5, 6, 5, and 5. The first three seed ATR at 5.3333; one Wilder update produces 5.2222.

Prepare the series in chronological order

Each row must contain open, high, low, close. Put the oldest bar first, omit a header, and separate numbers with commas or tabs. Supply the close immediately before the first row so that the first gap can be measured.

Use one instrument and one consistent time interval. Keep adjusted or unadjusted prices consistent throughout. Changing sessions, combining time frames, or mixing split-adjusted prices can introduce artificial gaps.

True range includes the previous close

For each bar, true range is the largest of three distances: high − low, absolute(high − previous close), and absolute(low − previous close).

A bar may have a narrow high-to-low range but a large true range if it opens well away from the preceding close. The open is validated as part of the OHLC row, but it is not itself a term in the true-range formula.

The exact ATR convention used here

For period n, the initial ATR is the arithmetic mean of the first n true ranges. For each later bar, ATR = (previous ATR × (n − 1) + current true range) / n. This is Wilder smoothing.

A simple moving average of the latest n true ranges is a different calculation after the initial value. Charting platforms may use more history to seed an indicator; supplying only a short history can therefore produce a different value even with the same period.

Verify the four-bar example

The sample starts with a previous close of 100 and generates true ranges of 5, 6, 5, and 5. The third bar has a high-to-low range of only 3, but its high of 112 is 5 above the previous close of 107.

With n = 3, the initial ATR after bar three is 16 / 3 = 5.3333. The fourth-bar ATR is ((16 / 3) × 2 + 5) / 3 = 47 / 9 = 5.2222. The latest true range remains 5.

Read the units correctly

ATR is in the same price units as the OHLC input. Dividing it by the final close and multiplying by 100 produces the displayed ATR percentage. This normalization is a size comparison, not a volatility forecast.

An increasing ATR does not specify up or down. It also does not mean the next bar will remain inside an ATR-sized interval; historical averages are not hard price boundaries.

Use the per-bar output to resolve differences

The CSV lists the previous close, true range, and any initialized ATR for every bar. Blank ATR cells before bar n are intentional. Trace the first differing true range before changing a formula to match another platform.

  • Check the session close and the price-adjustment setting.
  • Check whether the other platform uses Wilder smoothing, an EMA, or an SMA.
  • Supply a longer consistent history when initialization is the source of a difference.

What this tool does not calculate

  • At least n bars are required; at most 500 rows and an ATR period of 200 are accepted.
  • Prices must be positive and belong to valid OHLC bars.
  • No market data is downloaded, and the indicator is not a forecast or stop recommendation.

Common questions

Why must I enter the close before the first row?

True range compares a bar with the previous close. Without that value, the first gap cannot be measured consistently. The tool asks for it instead of silently assuming the first true range equals high minus low.

Is this a simple moving average ATR?

No. The first value is a simple mean of n true ranges, then the tool applies Wilder smoothing. An SMA recomputes the average of the latest n observations at every step.

Why does my chart show a different ATR?

Possible reasons include a longer initialization history, another smoothing convention, a different session close, adjusted prices, or incomplete bars. The per-bar CSV helps locate the difference.

Can ATR tell me which direction to trade?

No. This calculation measures the magnitude of historical movement and gaps. It does not determine direction or estimate an outcome probability.

Sources & method

An original calculation tool built with AI assistance. Its method and limits are documented here, and calculation examples are checked with automated tests.

About Chart Context

Explore the project behind this free educational tool. The calculation and guide above work without joining a channel.

About Chart Context

10 services for volatility and chart-context research

Compare charting, market data, learning and author-led ideas when a price move needs volatility context.