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

抢单定时交易

Author: 提供策略帮助(点击头像联系), Date: 2024-01-16 15:50:37
Tags:


from datetime import datetime


"""
简单思路分享:开盘抢单 或者 打新 使用
如需策略定制: QQ 35787501
"""


def main():
    while True:
        now = datetime.strptime(_D(), "%Y-%m-%d %H:%M:%S")
        if now.hour > h and now.minute > m:
            exchange.SetContractType(contract)
            exchange.SetDirection("buy")
            oid = exchange.Buy(-1, num)
            print("执行买入交易:", oid)
            break
        Sleep(1000)

template: strategy.tpl:40:21: executing "strategy.tpl" at <.api.GetStrategyListByName>: wrong number of args for GetStrategyListByName: want 7 got 6