The resource loading... loading...

talib.SUM

The talib.SUM() function is used to calculate Summation.

The return value of the talib.SUM() function is: a one-dimensional array. array

talib.SUM(inReal) talib.SUM(inReal, optInTimePeriod)

The inReal parameter is used to specify the K-line data. inReal true {@struct/Record Record} structure arrays, numeric arrays The optInTimePeriod parameter is used to set the period, the default value is 30. optInTimePeriod false number

function main() {
    var records = exchange.GetRecords()
    var ret = talib.SUM(records)
    Log(ret)
}
import talib
def main():
    records = exchange.GetRecords()
    ret = talib.SUM(records.Close)
    Log(ret)
void main() {
    auto records = exchange.GetRecords();
    auto ret = talib.SUM(records);
    Log(ret);
}

The SUM() function is described in the talib library documentation as: SUM(Records[Close],Time Period = 30) = Array(outReal)

talib.MINMAXINDEX talib.HT_DCPERIOD