Skip to content

Cumulative Sum

Math · Temporal

Cumulative Sum node on the canvas

Running total of a series — at bar i, the sum of values from bar 0 through bar i. Useful for cumulative volume, P&L curves built from per-bar deltas, or any 'so far' metric.

Cumulative Sum keeps a running total: at each bar it outputs the sum of all the source values from the start up to that bar. It's how you turn a stream of per-bar deltas into a cumulative curve — the same operation that turns per-bar P&L into an equity curve, or signed per-bar volume into a cumulative line.

How it works

Each bar the block outputs the sum of the source from bar 0 through the current bar. Whatever you feed in gets accumulated; the line only ever rises (when inputs are positive), falls (negative), or holds (zero). Wire a series (or Bars, using close) into the input. There are no parameters — it's a pure running total from the start of the data.

When to use it

Use Cumulative Sum to build "so far" curves from per-bar quantities. Feed it signed per-bar volume to construct an OBV-style accumulation line; feed it per-bar returns or deltas to build a cumulative performance curve; feed it any event count to track a running tally. It's the integrator: whenever you have a rate or a delta and want the accumulated total, this is the block.

Example

A custom accumulation line: build signed volume (volume × the sign of a Diff of close) and feed it into Cumulative Sum to get a running buy/sell-pressure curve — your own OBV variant. Watch it for divergence against price in the Tester review.

Tips & gotchas

  • It's the integrator — turns per-bar deltas into a cumulative curve.
  • Accumulates from the start of the data — the absolute level is arbitrary; read its direction and divergence.
  • No parameters — pure running total.
  • Pairs with Diff — Diff differentiates, Cumulative Sum integrates; they're inverses.

Inputs

Socket Type What to wire in
In series / bars Source series. BARS input uses close.

Outputs

Output Type Plots as Description
Σ series Line · sub-pane Running cumulative sum.

Reference auto-generated from the block catalog · category Math.