The talib.CCI()
function is used to calculate the Commodity Channel Index (homeopathic indicator).
The return value of the talib.CCI()
function is a one-dimensional array.
array
talib.CCI(inPriceHLC) talib.CCI(inPriceHLC, optInTimePeriod)
The inPriceHLC
parameter is used to specify the K-line data.
inPriceHLC
true
{@struct/Record Record} structure array
The optInTimePeriod
parameter is used to set the period, the default value is 14.
optInTimePeriod
false
number
function main() {
var records = exchange.GetRecords()
var ret = talib.CCI(records)
Log(ret)
}
import talib
def main():
records = exchange.GetRecords()
ret = talib.CCI(records.High, records.Low, records.Close)
Log(ret)
void main() {
auto records = exchange.GetRecords();
auto ret = talib.CCI(records);
Log(ret);
}
The CCI()
function is described in the talib library documentation as: CCI(Records[High,Low,Close],Time Period = 14) = Array(outReal)