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

TA.MA

TA.MA()函数用于计算移动平均线指标

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

TA.MA(inReal) TA.MA(inReal, optInTimePeriod)

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

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

测试TA.MA()函数:

TA.MA()函数的optInTimePeriod参数的默认值为:9

{@fun/TA/TA.MACD TA.MACD}, {@fun/TA/TA.KDJ TA.KDJ}, {@fun/TA/TA.RSI TA.RSI}, {@fun/TA/TA.ATR TA.ATR}, {@fun/TA/TA.OBV TA.OBV}, {@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.OBV TA.EMA