Scale

Full-series (no rolling window)Transform

The Scale node performs a linear mapping from a known input range [fromMin, fromMax] to a desired output range [toMin, toMax]. Unlike Normalize (which auto-detects the input range from actual data), Scale requires you to specify the expected input bounds explicitly — making it suitable when you know the theoretical range of an indicator and want deterministic mapping regardless of actual data extremes.

Algorithm

  • fromRange = fromMax − fromMin, toRange = toMax − toMin
  • output[i] = toMin + (v[i] − fromMin) × (toRange / fromRange)
  • When fromRange = 0: output = (toMin + toMax) / 2 for all valid values
  • null inputs → null output

Parameters

NameTypeDefaultDescription
fromMinnumber0Expected minimum of the input range.
fromMaxnumber100Expected maximum of the input range.
toMinnumber−1Desired minimum of the output range.
toMaxnumber1Desired maximum 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

RSI Remapping

Scale RSI from [0, 100] to [−1, +1] (fromMin=0, fromMax=100, toMin=−1, toMax=1) to make it compatible with signed signal aggregation where zero represents neutral.

Stochastic to Probability

Scale Stochastic (0–100) to [0, 1] to represent it as a probability value, enabling direct use as a weighting factor in portfolio allocation formulas.

Temperature/Parameter Scaling

When a downstream node expects inputs in a specific range, Scale converts indicator outputs to that range using known theoretical bounds rather than data-driven bounds.