Average True Range Node

ATR — Separate High / Low / Close Inputs

IndicatorVolatilityRange

Overview

The Average True Range Node computes ATR from three independently connected series: High, Low, and Close. Unlike the standard ATR node that reads directly from a stock source, this variant lets you wire any three numeric output series as High, Low, and Close inputs — enabling ATR calculations on transformed or synthesised price streams.

The underlying algorithm is identical to the standard ATR: True Range is computed per bar and then smoothed using Wilder's exponential smoothing over the chosen period. The first value is a simple average of the first period true ranges; every subsequent value is updated via Wilder's formula.

Formula

True Range (per bar)
TR = max( H − L, |H − prevC|, |L − prevC| )
First bar (no previous close): TR = H − L
ATR Seed (bar index = period − 1)
ATR₀ = mean( TR₀ … TR₍ₚ₋₁₎ )
ATR Update (Wilder's smoothing)
ATRᵢ = ( ATRᵢ₋₁ × (period − 1) + TRᵢ ) / period

Parameters

ParameterTypeDefaultDescription
periodnumber14Smoothing period for Wilder's ATR calculation. Common values: 7, 10, 14, 20.

Inputs & Outputs

SlotDirectionTypeDescription
input1Input(number | null)[]High price series
input2Input(number | null)[]Low price series
input3Input(number | null)[]Close price series
valuesOutput(number | null)[]ATR values; first (period − 1) entries are null
timestampsOutputnumber[]Unix timestamps aligned to the input series

All three inputs are required. Connect separate High, Low, and Close series nodes toinput1, input2, and input3 respectively. The node will report an error if any slot is disconnected.

Use Cases

Transformed Price Streams

Apply ATR to adjusted or synthetic High/Low/Close series without changing the underlying data source.

Stop-Loss Sizing on Custom Data

Feed cleaned or spread-adjusted H/L/C into this node to compute position-size-aware stops.

Multi-Asset Volatility Comparison

Wire H/L/C from different instruments to compare their ATR on the same chart.

Tips & Best Practices

📐 Series Length

All three input series must have the same length. Mismatched lengths are trimmed to the shortest.

⚡ Wilder Lag

Wilder's smoothing is slower to respond than EMA. Use a shorter period (7–10) for fast-moving markets.

🔗 vs Standard ATR

If your data comes from a single stock source node, prefer the standard ATR node — it is more efficient and requires no manual wiring.

Related Indicators