Type/to search
2
Follow
0
Followers
GetRecords与TA.EMA的关系
Help
Created 2021-09-23 18:00:49  
 2
 1133

如题,GetRecords() 是获取K线数据,TA.EMA获取均线数据,那么
var records = exchange.GetRecords(PERIOD_M15)
if (records && records.length > 12) {
var ema = TA.EMA(records, 12)
}
为什么15分钟级别的K线可以用到12天的均线指标里?请问是什么意思,谢谢

Related Recommendations
Comment
All comments (2)

    15分钟周期的K线, 这话没毛病. 但是那个12 不是12天, 哥们, 是12根K线, 一根K线代表15分钟. 没有足够的K线, 无法算EMA, var ema = TA.EMA(records, 12)
    这个代码的变量名该改改,你就不容易疑惑了. 真正的意思是: var ema12 =TA.EMA(records, 12) // 这句代码就是算出EMA12 均线的值.

    5 years ago

    Ok, 明白,感谢

    5 years ago
  • 1
Forums
PINE Language
Get the app
iPhone Download
© 2015 - ∞ INVENTOR PTE LTD (SG)