资源加载中... loading...

talib.ROC

The talib.ROC() function is used to calculate Rate of change : ((price/prevPrice)-1)*100 (rate of change indicator).

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

talib.ROC(inReal) talib.ROC(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 10. optInTimePeriod false number

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

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

talib.PPO talib.ROCP