Most traders set their stop at a fixed number: "a 100-point stop". The problem? 100 points can be painfully tight on a volatile day (and you get stopped out by noise) or far too loose on a quiet day (and you risk more than you need to). The ATR solves this by letting the stop breathe with volatility. It is the indicator that turns amateur risk management into professional risk management.
01What the ATR is
ATR stands for Average True Range , created by Wilder (the same man behind the RSI). It measures how much price usually moves over a given period — in other words, volatility. Important: the ATR has no direction. It does not tell you whether price will go up or down, only the typical size of the move. An ATR of 150 on Brazil's WIN mini index future means that, on average, price swings ~150 points per candle over that period.
"True Range": the ATR does not use only the difference between the candle's high and low. It also accounts for gaps (jumps between the previous close and the open), taking the largest of three measures. Hence "true" — it captures real volatility, including gap openings.
02The main use: a dynamic stop loss
The classic application is the ATR-multiple stop. Instead of "a 100-point stop", you use "a stop 2× the ATR away". So:
- Volatile market → high ATR → wide stop → you do not get stopped out by normal noise.
- Calm market → low ATR → tight stop → you risk less when you do not need that much room.
The common multiple is between 1.5× and 3× the ATR, depending on how much room the strategy needs. The bigger the multiple, the more room the trade has to breathe (and the bigger the potential loss per trade).
Example: ATR stop on the mini index future
03ATR-based position sizing
The ATR also answers "how many contracts should I trade". Combining the ATR stop with your risk per trade, the sizing happens automatically:
How many contracts? (WIN example)
Notice the lesson built in: when volatility is high (big ATR), the stop is wide, and to respect your 2% risk you have to trade fewer contracts. The ATR forces you to cut exposure exactly when the market is dangerous. It is automatic risk management.
Want the spreadsheet that runs this math?
Our free risk management spreadsheet sizes your position based on your stop and your account balance.
04Coding the ATR and the stop
//@version=5 strategy("Stop por ATR", overlay=true) periodo = input.int(14, "Período ATR") mult = input.float(2.0, "Múltiplo do ATR") atr = ta.atr(periodo) // example: enter at the moving average and use ATR for the stop ma = ta.ema(close, 21) if ta.crossover(close, ma) stopLoss = close - mult * atr takeProfit = close + mult * atr * 2 // target 2x the risk strategy.entry("Compra", strategy.long) strategy.exit("Saida", "Compra", stop=stopLoss, limit=takeProfit) plot(atr, "ATR", color=color.purple, display=display.data_window)
import pandas as pd def calcular_atr(df, periodo=14): alta_baixa = df["high"] - df["low"] alta_fech = (df["high"] - df["close"].shift()).abs() baixa_fech = (df["low"] - df["close"].shift()).abs() # True Range = the largest of the three tr = pd.concat([alta_baixa, alta_fech, baixa_fech], axis=1).max(axis=1) return tr.ewm(alpha=1/periodo, adjust=False).mean() df["atr"] = calcular_atr(df) # dynamic stop and position sizing entrada = df["close"].iloc[-1] atr_atual = df["atr"].iloc[-1] stop = entrada - 2 * atr_atual risco_reais = 100 # 2% of a 5000 account balance valor_ponto = 0.20 # WIN perda_por_contrato = (entrada - stop) * valor_ponto contratos = int(risco_reais / perda_por_contrato) print(f"Stop: {stop:.0f} | Contratos: {contratos}")
05Other uses of the ATR
- Trailing stop: moving the stop as price advances, always keeping it 2× ATR away — it locks in profit without choking the trade.
- Volatility filter: only trading when the ATR is above a minimum (avoids a dead market) or below a maximum (avoids extreme volatility).
- Proportional target: setting take profit as a multiple of the ATR, keeping the risk/reward ratio consistent in any regime.
Always remember: the ATR is not an entry signal. It does not tell you where price is going — only the size of the move. Using the ATR as a buy/sell trigger is a conceptual mistake. It belongs in the risk management equation (stop, target, size), combined with directional indicators such as moving averages, MACD or market structure.
06Frequently asked questions
What is the ATR?
Average True Range — a volatility indicator that measures the average range of price movement over a period. It does not indicate direction, only the typical size of the move. Essential for sizing stops in proportion to volatility.
How do I use the ATR for my stop?
Multiply the ATR by a factor (e.g. 2×) and place the stop that far from your entry. The stop is wide when the market is volatile and tight when it is calm, which avoids being stopped out by normal noise.
Does the ATR show direction?
No. It only measures volatility (the size of moves), never direction. That is why it is used for risk management alongside trend indicators, and never as a standalone entry signal.
Which ATR multiple should I use for the stop?
Commonly between 1.5× and 3×. A bigger multiple gives the trade more room to breathe (fewer stop-outs from noise) but increases the potential loss per trade. Calibrate it by backtest according to the strategy.
Which ATR period should I use?
The standard is 14 (Wilder's). Shorter periods react faster to changes in volatility; longer ones smooth it out. 14 works well in most cases.