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

talib.WMA

talib.WMA()函数用于计算Weighted Moving Average (加权移动平均)

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

talib.WMA(inReal) talib.WMA(inReal, optInTimePeriod)

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

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

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

talib.TRIMA talib.LINEARREG