Average True Range

The Average True Range (ATR) is a foundational volatility indicator that measures the average amount of price movement over a specified period. Unlike percentage-based volatility measures, ATR provides an absolute value that represents typical price movement, making it invaluable for risk management and position sizing. It smooths the True Range values using a moving average, providing a clearer picture of overall market volatility trends.

Developed by J. Welles Wilder Jr. and introduced in his 1978 book "New Concepts in Technical Trading Systems," ATR has become one of the most widely used volatility indicators in technical analysis. Wilder originally used a 14-period calculation, which remains the standard default today.

What It Measures

The Average True Range measures the average absolute price movement over a specified number of periods, providing a volatility metric that accounts for gaps and limit moves. Higher ATR values indicate greater volatility and larger price swings, while lower values suggest calmer, more stable price action.

When to Use

Period Selection Guidelines

The period parameter affects how responsive the ATR is to recent volatility changes:

Period RangeCharacteristicsUse Case
5-10Highly responsive, captures short-term volatilityDay trading, scalping, quick adjustments
10-14Standard (Wilder's default: 14)General trading, balanced view
14-20Moderate smoothingSwing trading, medium-term positions
20-30Smoother, filters short-term spikesPosition trading, trend following
30-50+Very smooth, long-term volatility trendsLong-term investing, strategic allocation

Model Selection

ATR supports different averaging methods for smoothing True Range values:

Wilder originally used the Smoothed Moving Average (SMMA) method, which gives very gradual weight changes and is the traditional choice for ATR calculations.

Interpretation

Default Usage

use rust_ti::other_indicators::bulk::average_true_range;
use rust_ti::ConstantModelType;

pub fn main() {
    // fetch the data in your preferred way
    // let close = vec![...];  // close prices
    // let high = vec![...];   // high prices
    // let low = vec![...];    // low prices
    
    let period = 14;
    let model = ConstantModelType::SimpleMovingAverage;
    
    let atr = average_true_range(&close, &high, &low, model, period);
    println!("ATR: {:?}", atr);
}
import pytechnicalindicators as pti

# Average True Range with default parameters
period = 14
model = "simple_moving_average"

atr = pti.other_indicators.bulk.average_true_range(close, high, low, model, period)
print("ATR:", atr)
import init, { 
    other_bulk_averageTrueRange,
    ConstantModelType
} from 'https://cdn.jsdelivr.net/npm/ti-engine@latest/dist/web/ti_engine.js';

await init();

// fetch the data in your preferred way
// const close = [...];  // close prices
// const high = [...];   // high prices
// const low = [...];    // low prices

const period = 14;
const model = ConstantModelType.SimpleMovingAverage;

const atr = other_bulk_averageTrueRange(close, high, low, model, period);
console.log("ATR:", atr);

Interactive Chart

Use the interactive playground below to explore how different parameters affect the indicator's behavior.