Range
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
| Name | Type | Default | Description |
|---|---|---|---|
| period | number | 20 | Rolling window size. |
Inputs & Outputs
| Port | Type | Description |
|---|---|---|
| Inputs | ||
| input | number[] | Source numeric array |
| Outputs | ||
| values | number | null | Computed value at each bar; null before the warmup period completes |
| timestamps | number[] | Bar timestamps (UNIX ms), aligned 1-to-1 with values |
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.