# ATR and volatility-based stops

> Measure how far price typically moves per candle, and use it to place stops that fit the market.

Source: https://quantraider.com/learn/indicators/atr

Course: Technical indicators (lesson 4 of 6) · Level: Intermediate · 4 min

The average true range (ATR) measures how far price typically moves per candle, including gaps. You will learn to calculate a true range by hand and use ATR to place a stop that adapts to the market's current volatility.

## True range and ATR

The high minus the low of a candle ignores gaps: if price opens far above the previous close, the candle itself may look small. **True range** (TR) fixes this by also measuring the distance from the previous close to the high and to the low, then taking the largest of the three.

```
TR = max( High − Low, |High − Previous close|, |Low − Previous close| )
```

The bars | | mean the absolute value, so the distances are never negative.

**ATR** is a smoothed average of the true range over N candles. Like RSI, the standard definition uses Wilder smoothing, and the `ATR` node states that it does. A period of 14 is a common example. ATR is measured in price units, not percent, so it only tells you how big moves are in that market and timeframe.

```
ATR now = (ATR previous × (N − 1) + TR now) / N
```

Wilder smoothing applied to the true range.

**Worked example: True range with and without a gap**

1. Normal candle: previous close 100, high 104, low 99. The three distances are 104 − 99 = 5, |104 − 100| = 4 and |99 − 100| = 1, so TR = 5.
2. Gap candle: previous close 100, high 108, low 106. The three distances are 108 − 106 = 2, |108 − 100| = 8 and |106 − 100| = 6, so TR = 8.
3. The plain high-low range of the gap candle is only 2, so true range captures the gap that the candle shape hides.
4. Smoothing: with N = 14, a previous ATR of 4.00 and a new TR of 5, ATR = (4.00 × 13 + 5) / 14 = 57 / 14 = 4.07 (rounded).

True ranges of 5 and 8 feed an ATR that moves slowly, from 4.00 to 4.07 after the first candle.

## Using ATR for a stop

A fixed stop of, say, 10 points can be too tight in volatile weeks and too wide in quiet ones. A volatility-based stop scales with the market: one common approach is to place the stop a multiple of ATR away from the entry, for example 1.5 times ATR. The multiple is a choice, not a constant of nature, and should be tested.

**Worked example: A long stop at entry − 1.5 × ATR**

1. Suppose a long entry at 110.00 and an ATR of 4.00.
2. The stop distance is 1.5 × 4.00 = 6.00.
3. The stop price is 110.00 − 6.00 = 104.00.
4. If you risk €60 on the trade, the position size is €60 / 6.00 per unit = 10 units.

In a quieter market with an ATR of 2.00 the same rule gives a stop at 107.00 and, for the same €60, 20 units.

Notice that the risk in euros stays the same while the distance and size change. This is why ATR stops pair naturally with position sizing: the stop adapts to conditions and the size adapts to the stop.

> **ATR is not direction**
>
> ATR says how far price moves, not which way. A stop at 1.5 × ATR is also not guaranteed to survive normal noise: a trade can still be stopped out by a move of a few ATRs.

## In the graph editor

The `ATR` node has three input sockets, `High`, `Low` and `Close`, and one output, `ATR`. Connect the same candle's three outputs from `Data`, and set `Period (N)`. For a long stop, use a `Multiply` node (`ATR` × 1.5) and a `Subtract` node (close minus that result), then connect the result to the stop-loss input of `Trade entry`.

> **Build an ATR stop**: Connect `Data.High`, `Data.Low` and `Data.Close` to an `ATR` node, then use `Multiply` and `Subtract` to build the stop price. [Open the graph editor](https://quantraider.com/nodesystem)

## Key takeaways

- True range is the largest of high − low, |high − previous close| and |low − previous close|, so it includes gaps.
- ATR is a Wilder-smoothed average of the true range and is measured in price units.
- A volatility-based stop for a long can be entry − k × ATR, where the multiple k, for example 1.5, is a tested choice.
- The `ATR` node takes `High`, `Low` and `Close` and outputs `ATR`.

> Educational content, not financial advice. Trading involves risk of loss.
