Add

Element-wiseCore Math

The Add node performs element-wise addition of two aligned numeric arrays, or adds a fixed constant to every element of a single array. Toggle useNumericB to switch between array+array (timestamps must align) and array+scalar modes. Both inputs are aligned by index after the window is applied; mismatched lengths produce an error. Null values in either input produce null in the output.

Algorithm

  • Array + Array: output[i] = A[i] + B[i]
  • Array + Constant: output[i] = A[i] + numericB
  • Either operand null → output null

Parameters

NameTypeDefaultDescription
useNumericBbooleanfalseWhen true, adds the numericB constant instead of a second array connection.
numericBnumber0The constant to add when useNumericB is enabled.

Inputs & Outputs

PortTypeDescription
Inputs
input1number[]Primary input array A
input2number[]Secondary input array B (ignored when useNumericB is true)
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

Indicator Offset

Add a fixed ATR offset to a moving average to build a dynamic resistance level, e.g. SMA(20) + 1.5×ATR.

Combining Two Signals

Add two orthogonal oscillators together to build a composite score before normalization.

Manual Upper Band

Add a standard deviation series to a mean series (Average + Sqrt(Variance)) to construct a Bollinger-style upper band from scratch.