Range

Windowed · default period 20Statistics

The Range node computes max(window) − min(window) over the rolling period — the simplest volatility proxy. Large range means high volatility; small range means compression. A rolling range on price highs and lows is the Donchian channel width; on indicator values it identifies active vs. quiet regimes. Range is always non-negative.

Algorithm

  • vals = non-null values in window
  • output = max(vals) − min(vals)
  • Returns null when no non-null values exist

Parameters

NameTypeDefaultDescription
periodnumber20Rolling window size.

Inputs & Outputs

PortTypeDescription
Inputs
inputnumber[]Source numeric array
Outputs
valuesnumber | nullComputed value at each bar; null before the warmup period completes
timestampsnumber[]Bar timestamps (UNIX ms), aligned 1-to-1 with values
Live mode: In live streaming mode the node updates only the last bar in-place rather than recalculating the full array, keeping CPU usage minimal during real-time data feeds.

Use Cases

Volatility Compression Detection

A narrowing rolling range (Range decreasing over multiple bars) signals price compression — a classic breakout setup filter when followed by a Range expansion.

Donchian Channel Width

Range applied to (high − low) prices gives the Donchian channel width, a proxy for trend channel volatility and momentum breadth.

Normalization Denominator

Divide a price-based oscillator by Range to normalize it to [0, 1] within the rolling window — equivalent to a Stochastic Oscillator denominator.