P
PipsGrowth

Key Takeaways

Difficulty:Beginner
Reliability:Very High
Category:volatility
Timeframes:1H, 4H, Daily

Average True Range (ATR)

volatilityπŸ“Š 1H, 4H, Daily

Measures market volatility by calculating the average range between high and low prices.

Formula

Code
True Range = Max[(High - Low), |High - Close(prev)|, |Low - Close(prev)|]
ATR = Moving Average of True Range

Detailed Explanation

Average True Range (ATR) was developed by J. Welles Wilder to measure volatility. Unlike indicators that show direction, ATR purely measures the degree of price movement.

True Range considers:
- Current High minus Current Low
- Current High minus Previous Close
- Current Low minus Previous Close

Applications:
- Position Sizing: Adjust size based on volatility
- Stop Loss: Place stops at 1.5-3Γ— ATR
- Breakout Confirmation: High ATR confirms breakouts

Trading Setup Example

Entry, stop loss, and take profit levels.

πŸ“ˆ Buy Setup
Average True Range (ATR)ATR SpikeSL = 1.5Γ—ATREntryTake ProfitStop LossCandlesATRBUY
πŸ“‰ Sell Setup
Average True Range (ATR)ATR SpikeSL = 1.5Γ—ATREntryTake ProfitStop LossCandlesATRSELL

Always wait for signal confirmation before entering a trade.

Where This Indicator Works Best

Trend context and market position.

πŸ“ˆ Bullish Context
Squeeze!Low VolatilityBest Fit βœ“Breakout ↑
πŸ“‰ Bearish Context
Squeeze!Low VolatilityBest Fit βœ“Breakdown ↓

Measures market volatility and identifies breakout opportunities.

Live Chart β€” Average True Range (ATR)

See Average True Range (ATR) in action on a live chart. Try changing the settings and timeframe.

Parameters

Period
Default: 14
ATR calculation period

πŸ“ˆ Bullish Signals

Rising ATR confirms trend strength during uptrend

πŸ“‰ Bearish Signals

Rising ATR confirms trend strength during downtrend

Python Implementation

ATR calculation with stop loss example

Python
import pandas_ta as ta
df['ATR'] = ta.atr(df['high'], df['low'], df['close'], length=14)
# ATR-based stop loss
entry_price = df['close'].iloc[-1]
atr_value = df['ATR'].iloc[-1]
stop_loss = entry_price - (2 * atr_value)

TradingView Pine Script

JavaScript
//@version=5
indicator("ATR")
atr = ta.atr(14)
plot(atr, "ATR", color=color.orange)
πŸ“Š Use TradingView for Advanced Charting
Professional analysis tools with 100+ technical indicators
Get TradingView Pro

MT5 MQL5 Code

C++
int atr_handle = iATR(_Symbol, _Period, 14);
double atr[];
CopyBuffer(atr_handle, 0, 0, 3, atr);

Common Mistakes

βœ—Using ATR to predict direction
βœ—Not adjusting ATR period for timeframe

Confirmation Signals

Trend direction indicators
Volume

Best For

Volatility measurementStop loss placementPosition sizing

πŸ’‘ Pro Tips

  • β€’ATR does not indicate direction, only volatility
  • β€’Use ATR multiples for stop losses (e.g., 2Γ— ATR)
  • β€’Expanding ATR often precedes major price moves
Last updated: February 8, 2026

Educational Disclaimer

This content is for educational purposes only and does not constitute financial or investment advice. Trading involves significant risk and you may lose your capital. Always consult a licensed financial advisor before making investment decisions.

Frequently Asked Questions

Average True Range (ATR) - Complete Guide with Python & TradingView Code