Sum

Windowed · default period 20Statistics

The Sum node computes the total of all non-null values in the rolling window. Unlike CumSum (which accumulates from the start of the series), Sum uses a sliding window that moves forward with each bar. It is used to accumulate volume over periods, build custom oscillators based on bar counts, and as the first step in any custom mean computation.

Algorithm

  • vals = non-null values in window
  • output = Σ vals
  • Returns null when no non-null values exist

Parameters

NameTypeDefaultDescription
periodnumber20Rolling window size.

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

Volume Accumulation

Sum of volume over N bars measures total participation in a recent price move — high volume sum during a breakout confirms institutional involvement.

Custom Mean

Divide Sum by Count over the same period to build a custom mean that handles partial-null windows more transparently than the Average node.

Custom Oscillator

Sum of Sign(close − open) over N bars gives a count of bullish bars minus bearish bars — a simple breadth-style oscillator.