当程序运行后第一次下单时报这个错,然后后面的指令都不会执行,请问怎么解决?
wss://otg-gtjaqh.shinnytech.com/trade,当前时间 1630675808.666475, 开始从网络层收取数据时间 1630675342.9413931,已收取数据大小 144
2021-09-03 21:30:08 – WARNING – 通知: 与 wss://otg-gtjaqh.shinnytech.com/trade 的网络连接断开,请检查客户端及网络是否正常
2021-09-03 21:30:08 – WARNING – 通知: 开始与 wss://otg-gtjaqh.shinnytech.com/trade 的重新建立网络连接
2021-09-03 21:30:09 – INFO – 通知: 登录成功
2021-09-03 21:30:09 – WARNING – 通知: 与 wss://otg-gtjaqh.shinnytech.com/trade 的网络连接已恢复
2021-09-03 21:30:09 – WARNING – 通知: 撤单指定的order_id不存在,不能撤单,撤单信息,用户名:xxxx,报单编号:PYSDK_target_ae3c508c9ed69e5b80d205c98fdb7672
代码如下
klines = api.get_kline_serial(SYMBOL, duration_seconds=CYCLE, data_length=data_length)
target_pos = TargetPosTask(api, SYMBOL)
target_pos.set_target_volume(0)
account = api.get_account()
position = api.get_position(SYMBOL,account=TQACCOUNT)
order = api.get_order(SYMBOL,account=TQACCOUNT)
while True:
api.wait_update()
close = klines[“close”]
if api.is_changing(klines.iloc[-1], “datetime”):
KAMA = talib.KAMA(close, timeperiod = N)
klines[“KAMA_MAIN”] = KAMA
klines[“KAMA_MAIN.color”] = 0xFF000000
klines[“KAMA_MAIN.width”] = 3
if position.pos == 0 or order == “”:
# 均线下穿,做空
if KAMA.values[-1] < KAMA.values[-2]:
target_pos.set_target_volume(SELL)
print(“空头”)
# 均线上穿,做多
if KAMA.values[-1] > KAMA.values[-2]:
target_pos.set_target_volume(BUY)
print(“多头”)