Normalize
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
| Name | Type | Default | Description |
|---|---|---|---|
| targetMin | number | 0 | The minimum value of the output range. |
| targetMax | number | 1 | The maximum value of the output range. |
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
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.