Normalize

Full-series (no rolling window)Transform

The Normalize node rescales the entire windowed input array so that values span exactly [targetMin, targetMax] based on the global minimum and maximum of the series. The transformation is linear and preserves relative differences: the smallest value maps to targetMin and the largest to targetMax. All other values are linearly interpolated between. When all values are equal, the output is the midpoint (targetMin + targetMax) / 2.

Algorithm

  • min = Math.min(valid values), max = Math.max(valid values)
  • range = max − min
  • output[i] = targetMin + ((v[i] − min) / range) × (targetMax − targetMin)
  • When range = 0 (all values equal): output = (targetMin + targetMax) / 2
  • null inputs → null output

Parameters

NameTypeDefaultDescription
targetMinnumber0The minimum value of the output range.
targetMaxnumber1The maximum value of the output range.

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

Multi-Indicator Scoring

Normalize RSI, MACD, and Momentum to [0, 1] before adding them together to create a composite score where each component contributes equally regardless of scale.

Machine Learning Feature Prep

Normalize input features to [−1, 1] or [0, 1] before feeding them into an ML node or threshold-based rule engine that expects bounded inputs.

Oscillator Display

Normalize any custom indicator to [0, 100] for display as a standard oscillator-range value with consistent axis scale across sessions and instruments.