Is there equivalent method of PineScript ta.cum() in cAlgo?

Created at 19 Jul 2024, 00:58
SE

sevenlimes

Joined 15.09.2023

Is there equivalent method of PineScript ta.cum() in cAlgo?
19 Jul 2024, 00:58


Hi everyone,

I need some help in finding an equivalent method of the PineScript ta.cum() function in cAlgo.

Basically, ta.cum(close) calculates the cumulative total of close values on all bars on the chart, is there a way to do the same for Bars.ClosePrices?

Thanks


@sevenlimes
Replies

PanagiotisCharalampous
19 Jul 2024, 05:43

Hi there,

Here you go

var closePricesSum = Bars.ClosePrices.Sum();

Best regards,

Panagiotis


@PanagiotisCharalampous