math.sum
The sum of the numbers you pass. It adds the arguments in the one call. There is no length argument anywhere in its signature, so it is not a running total over bars.
math.sum(const float number0, number1, ...) → const floatmath.sum(const int number0, number1, ...) → const intmath.sum(input float number0, number1, ...) → input floatmath.sum(input int number0, number1, ...) → input intmath.sum(series float number0, number1, ...) → series floatmath.sum(series int number0, number1, ...) → series intmath.sum(simple float number0, number1, ...) → simple floatmath.sum(simple int number0, number1, ...) → simple int| Parameter | Type | Required | Description |
|---|---|---|---|
number0, number1, ... | const float | yes | The numbers to add, passed as a list. There is an int form and a float form. |
Returns const float or const int or input float or input int or series float or series int or simple float or simple int — The total. Int arguments give an int and float arguments give a float, in the arguments’ form.
indicator("High plus low plus close")
plot(math.sum(high, low, close))See also math.abs · math.acos · math.asin
Part of the function index.
Ready to put this into practice?
Try GoCharting Premium
Unlock advanced orderflow, market profile, options desk, and real-time data — everything you just read about, live in your charts.