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

TA.ATR

TA.ATR()函数用于计算平均真实波幅指标

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

TA.ATR(inPriceHLC) TA.ATR(inPriceHLC, optInTimePeriod)

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

function main(){
    var records = exchange.GetRecords(PERIOD_M30)
    var atr = TA.ATR(records, 14)
    Log(atr)
}
def main():
    r = exchange.GetRecords(PERIOD_M30)
    atr = TA.ATR(r, 14)
    Log(atr)
void main() {
    auto r = exchange.GetRecords(PERIOD_M30);
    auto atr = TA.ATR(r, 14);
    Log(atr);
}

测试TA.ATR()函数:

TA.ATR()函数的optInTimePeriod参数的默认值为:14

{@fun/TA/TA.MACD TA.MACD}, {@fun/TA/TA.KDJ TA.KDJ}, {@fun/TA/TA.RSI TA.RSI}, {@fun/TA/TA.OBV TA.OBV}, {@fun/TA/TA.MA TA.MA}, {@fun/TA/TA.EMA TA.EMA}, {@fun/TA/TA.BOLL TA.BOLL}, {@fun/TA/TA.Alligator TA.Alligator}, {@fun/TA/TA.CMF TA.CMF}, {@fun/TA/TA.Highest TA.Highest}, {@fun/TA/TA.Lowest TA.Lowest}

TA.RSI TA.OBV