← Back to Home
Trading Signal / Indicator
📐

Average True Range (ATR)

Measure volatility and size your stops intelligently.

Start Automating Free →

Want to automate this strategy? Try auto-Trading free — no credit card required.

Average True Range (ATR) chart

Overview

What is Average True Range (ATR)?

The Average True Range (ATR), developed by J. Welles Wilder Jr. in his 1978 book, measures market volatility by calculating the average of the "true range" over a specified period. The true range is the greatest of: (current high − current low), (|current high − previous close|), and (|current low − previous close|), ensuring gaps are captured.

ATR does not indicate direction — it measures only the magnitude of price movement. A high ATR indicates a volatile market; a low ATR indicates a calm one. This makes it invaluable for stop-loss calibration: a 2× ATR stop, for example, is set far enough away to avoid being triggered by normal market noise, yet close enough to limit losses meaningfully.

The Chandelier Exit is a popular trailing stop technique based on ATR: the stop trails at 3× ATR below the highest high reached during the trade. As the trade becomes profitable and price climbs, the stop rises with it, protecting profits while allowing the trend to breathe.

ATR is also used in position sizing: many systematic traders risk a fixed fraction of equity per trade and set position size = Risk Amount ÷ (ATR × multiplier), ensuring every trade represents an equal real-money risk regardless of the asset's absolute price.

How It Works in auto-Trading

Automate It

auto-Trading uses ATR to calculate dynamic stop-loss distances for every trade. In the risk management module, users set their stop as an ATR multiple (default 2× ATR). Position size is automatically computed based on the dollar risk per trade and the ATR stop distance, ensuring consistent position sizing across volatile and calm market conditions.

Try Free →

Strategy Code

Pick a script below, copy it, and use it on your chart.

Pine Script (TradingView)

This is a TradingView Pine Script example for this indicator. Paste it into the TradingView Pine Editor, add it to your chart, and adjust inputs for your market and timeframe.

//@version=6
strategy("Average True Range (ATR)", overlay=true)
atrLen = input.int(14, "ATR Length")
atrMult = input.float(2.0, "ATR Mult")
emaLen = input.int(50, "Trend EMA")

Get full strategy code access

Enter your email address and full name to unlock this strategy code.

ThinkScript (thinkorswim)

This is a thinkorswim ThinkScript example for this indicator. Open thinkorswim, create a custom study, paste the script, and apply it to your chart.

input atrLength = 14;
input emaLength = 50;
def atrVal = ATR(atrLength);
def emaVal = ExpAverage(close, emaLength);
def buySignal = close crosses above emaVal;

Get full strategy code access

Enter your email address and full name to unlock this strategy code.

Ready to automate Average True Range (ATR)?

Join thousands of traders who use auto-Trading to execute this strategy automatically, 24/7.

Get Started Free →

All Strategies & Signals

Continue Learning

Trading Strategies

Trading Signals & Indicators