How to Use ATR for Volatility-Based Stop-Losses

By Jacob Denbrock5 min readReviewed by Christopher Downie on
How to Use ATR for Volatility-Based Stop-Losses

Use ATR to define a volatility-based stop distance, then connect that distance to an explicit exit rule and position size. Average True Range does not automatically place a stop, guarantee a fill, or make a strategy profitable. It supplies a measurement that you can use consistently.

Start on LuxAlgo’s native charts and use Quant to build and test the complete strategy. Keep the calculation, simulated orders, and live broker execution separate so each part can be checked.

1. Find the ATR Value and Its Timeframe

ATR smooths true range over a selected number of bars. True range includes the bar’s high-low distance and gaps relative to the previous close. It measures movement rather than direction. A 14-period ATR on an hourly chart uses hourly bars; on a daily chart it uses daily bars.

An ATR of $3 is a smoothed historical measurement, not a promise that the next bar will stay within $3. Record the length, timeframe, smoothing method, and reference bar. TradingView’s ATR documentation explains the calculation and settings.

2. Calculate the Initial Stop

Distance = reference ATR × multiplier. Subtract the distance from a long entry or add it to a short entry. Use an ATR value available at the time the decision is made, such as the last completed bar.

Hypothetical positionCalculationStop level
Long stock at $150; ATR $3; multiplier 2$150 − $6$144
Short stock at $150; ATR $3; multiplier 2$150 + $6$156

There is no universal multiplier for day, swing, or position trading. Test a limited range with the strategy’s actual entries, holding period, instrument, and costs. A larger multiplier increases the distance; it does not establish better protection or a higher return.

3. Define Whether the Stop Can Move

An ATR-based initial stop can remain fixed. If it updates, specify the reference price, ATR timing, and direction constraints.

  • Entry-based recalculation: entry minus current ATR times the multiplier for a long trade. Increasing ATR can lower this stop and increase planned risk.
  • Trailing candidate: a defined favorable price reference minus an ATR distance for longs, or plus the distance for shorts.
  • One-way ratchet: retain the higher of the previous stop and new candidate for longs, or the lower for shorts.

A conventional Chandelier Exit uses a lookback-window high or low with an ATR distance. Using the extreme since entry is a variation. Neither label alone specifies every update or ratchet rule.

For example, a long trade entered at $150 has an initial $144 stop. If its chosen high reaches $160 while ATR remains $3 and the multiplier is 2, the candidate is $154. If ATR rises to $4 without a new high, the candidate falls to $152. A one-way ratchet would retain $154. This defines the intended level, not a guaranteed execution price.

4. Calculate Position Size From Monetary Risk

Quantity = planned monetary allowance ÷ estimated loss per unit. For a simple stock trade, start with the stop distance per share and include an allowance for costs. Round down to the permitted increment. If you already calculated the monetary allowance, do not multiply it by account balance again.

For a hypothetical $50,000 account with a 1% planned allowance, the budget is $500. With ATR of $2.50 and a 2× multiplier, the distance is $5 and quantity is 100 shares before costs. With an additional $0.20 per-share round-trip cost and execution allowance, 96 shares use $499.20 of the budget.

Check purchase price or margin requirements too. For contracts, incorporate the monetary tick, pip, or point value and currency conversion. See the CME position-sizing lesson. A planned risk percentage is not the same as the percentage of capital allocated to the order.

5. Handle Volatility Changes Without Losing the Risk Plan

Widening an existing stop while retaining the same quantity increases its planned loss. Do not treat a volatility spike as an automatic instruction to increase the multiplier. Depending on the tested rules, the response could instead be smaller new positions, restricted entries, or no trade.

Longer ATR periods generally smooth changes more, but can lag sudden movement. Updating hourly for every day trade or daily for every swing trade is not a universal rule. Match update timing to the strategy’s decision process and execution model.

Stops also carry execution risk. The SEC’s stop-order bulletin explains that a stop-market order can fill away from the trigger price; a stop-limit order may not fill. Gaps and thin liquidity can make realized losses exceed the original calculation.

6. Build and Test the Full Strategy With Quant

Review price context on native charts, then inspect the strategy’s entries and stop updates against its trade log.

In Quant, describe the entry condition, ATR reference, stop distance, update rule, and sizing method. Use the Code, Review, and Run workflow to inspect the implementation and evaluate the results. Resolving a code error does not verify the trading logic.

  1. Check inputs and properties: review capital, order size, commissions, slippage, and the ATR settings.
  2. Inspect individual trades: verify entry timing, the first protective exit, and subsequent updates. Include losing trades and volatility spikes.
  3. Compare like with like: hold entries, data, and execution assumptions constant when comparing stop methods.
  4. Reserve unseen data: evaluate a period not used for tuning, inspect nearby parameter values, and document limitations in the available history.

No fixed requirement of 200 trades or five to ten years guarantees statistical reliability. Consider sample dependence, market coverage, and how many settings were tried. Claims of 32% lower drawdown, 15% higher performance, or a 22% filter improvement require a specific reproducible study; they are not general properties of ATR stops.

Pine Script®: A Calculation Is Not an Order

In TradingView, a script that only calculates a stop level or quantity does not create a complete backtest. A strategy needs defined entries and exits. The official strategy documentation explains simulated order commands and broker-emulator behavior.

The following is a calculation fragment for a larger Pine Script® implementation. It assumes a stock-like instrument whose price and account currency match. It calculates whole-share quantity before costs and capital constraints; it does not submit orders, define an entry, or implement a trailing stop.

// Calculation fragment, not a complete strategy.
float accountEquity = 50000.0
float riskFraction = 0.01
float atrValue = ta.atr(14)
float stopDistance = atrValue * 2.0
float riskBudget = accountEquity * riskFraction
float quantity = not na(stopDistance) and stopDistance > 0 ? math.floor(riskBudget / stopDistance) : 0.0

When integrating a calculation into a strategy, specify when values are captured, how the first stop is attached to an entry, and how gaps or same-bar events are simulated. Review generated code and validate compatibility before moving between native Quant and TradingView workflows.

7. Review Filters and Combined Exposure

Volume, moving-average, or ADX filters add conditions to test. They do not ensure that a trade agrees with market direction, and an ADX threshold does not automatically justify widening a stop by 50%. Compare each change separately and include its effect on trade count and costs.

ATR-based sizing does not measure correlation or prevent concentrated portfolio exposure. Several positions can respond to the same market event even when each has a volatility-based stop. Review combined exposure separately, and use LuxAlgo Journal to compare supported trading records and notes with the original plan.

Video: How to Set Stop Losses With ATR

This Trading Journal tutorial demonstrates ATR stop placement. Treat its settings as examples to evaluate within a complete strategy and execution plan.

FAQs

What is the formula for ATR trailing stop loss?

A candidate long stop is a defined price reference minus ATR times a multiplier; a candidate short stop adds the distance. To make the stop move only favorably, retain the higher of the previous and candidate stops for longs, or the lower for shorts. Specify the reference, ATR timing, and update frequency. Current price minus an ATR distance alone can move downward and is not automatically a one-way trailing stop.

Learn to trade smarter.

Market analysis and techniques that build your edge, one email a week.

Don’t worry, no spam here. See our privacy policy for more info.

Jacob Denbrock
Jacob Denbrock

CCO at LuxAlgo. 20 years of content creation experience, Jacob runs LuxAlgo's content team, brand growth, and hosts live shows showcasing his expertise in trading & LuxAlgo tools.

Read next