ta.cum()Cumulative Sum
Cumulative (total) sum of source. In other words it is a sum of all elements of source.
Syntax
ta.cum(source) → series floatArguments
| Parameter | Type | Description |
|---|---|---|
| source | series int/float | Series to accumulate. |
Returns
Total sum series.
Code Examples
//@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
math.sumFrequently Asked Questions
Generate ta.cum() Code with AI
Draft Pine Script using ta.cum() with Pineify's AI Coding Agent, then review the arguments and test the result on your chart. Usage depends on your plan and available credits.
Related Pine Script Functions
ta.change() - Change
Learn how to use ta.change() in Pine Script. Calculate bar-to-bar differences for price, time, and boolean series.
ta.obv - On Balance Volume
Learn about ta.obv built-in variable in Pine Script. Access On Balance Volume for volume-based trend confirmation.
ta.pvt - Price-Volume Trend
Learn about ta.pvt built-in variable in Pine Script. Access Price-Volume Trend for percentage-weighted volume analysis.
ta.highest() - Highest Value
Learn how to use ta.highest() in Pine Script. Find the highest value over a lookback period for Donchian Channels.
ta.lowest() - Lowest Value
Learn how to use ta.lowest() in Pine Script. Find the lowest value over a lookback period.