UtilityPine Script v6

ta.cum()

Cumulative Sum

Cumulative (total) sum of source. In other words it is a sum of all elements of source.

Syntax

Syntax
ta.cum(source) → series float

Arguments

ParameterTypeDescription
sourceseries int/floatSeries to accumulate.

Returns

Total sum series.

Code Examples

Pine Script v6 Example
//@version=6
indicator("ta.cum")
plot(ta.cum(close - open), title="Cumulative (close-open)")

Trading Applications

Calculate running totals of any series

Build custom cumulative indicators

Create volume-weighted cumulative metrics

Use as a building block for complex indicators

Related Functions

Frequently Asked Questions

Generate ta.cum() Code with AI

Skip the manual coding. Use Pineify's AI Coding Agent to generate Pine Script code using ta.cum() and other built-in functions instantly.