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

talib.NATR

talib.NATR()函数用于计算Normalized Average True Range (归一化平均值范围)

talib.NATR()函数的返回值为:一维数组。 array

talib.NATR(inPriceHLC) talib.NATR(inPriceHLC, optInTimePeriod)

inPriceHLC参数用于指定K线数据。 inPriceHLC true {@struct/Record Record}结构数组 optInTimePeriod参数用于设置周期,默认值为14。 optInTimePeriod false number

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

NATR()函数在talib库文档中的描述为:NATR(Records[High,Low,Close],Time Period = 14) = Array(outReal)

talib.ATR talib.TRANGE