zoukankan      html  css  js  c++  java
  • BotVS开发基础—2.7 指标MA

    代码

    #计算一小时 MA5均线
    # 时间 2017-06-29 00:00:00 -2017-06-30 00:00:00   1小时 实盘级Tick
    # 平台 OCKCoin BTC
    def main():
        while true:
            records = _C(exchange.GetRecords);  # 获取K线数据 ,默认为策略界面设置的K线周期, _C 是一个容错的内置函数。
            if len(records) < 5:
                Log("数据长度不够");  
                continue
            Log("records", records);   # records
            Log("records 长度:", len(records));  # 显示一下 records 的长度。
            ma = TA.MA(records, 5);   # 不加参数的话,默认为9
            Log("ma", ma);   # 
            Sleep(1000 * 60 * 60);  #60分钟,即1小时
  • 相关阅读:
    vue
    vim 使用
    ssh 免密码登录
    shell 监控
    shell top
    使用网络技术---WebView
    安卓数据存储
    模块
    面向对象
    文件
  • 原文地址:https://www.cnblogs.com/bitquant/p/7209841.html
Copyright © 2011-2022 走看看