有时盘中会出现以下提示,导致程序中断:
Traceback (most recent call last):
File “e:\tqpy\sp\xxxxx.py”, line 1468, in <module>
api.wait_update()
File “D:\Python39\lib\site-packages\tqsdk\api.py”, line 1724, in wait_update
self._run_until_idle()
File “D:\Python39\lib\site-packages\tqsdk\api.py”, line 3107, in _run_until_idle
self._run_once()
File “D:\Python39\lib\site-packages\tqsdk\api.py”, line 3100, in _run_once
raise self._exceptions.pop(0)
File “D:\Python39\lib\site-packages\tqsdk\lib\target_pos_task.py”, line 354, in _target_pos_task
await gather(*[each._task for each in all_tasks])
File “D:\Python39\lib\site-packages\tqsdk\lib\target_pos_task.py”, line 503, in _run
raise Exception(“遇到错单: %s %s %s %d手 %f %s” % (
Exception: 遇到错单: CZCE.SF109 SELL CLOSE 14手 8270.000000
不知是什么原因?怎样避免?
说明:用的是target_pos.set_target_volume(n)下单,没有用过手工和inster_order下单。
资金充足,并且是平仓时出现的错误。不是资金的问题。