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)