new k : 2020-05-22 13:30:00
2020-05-22 13:30:00,716 – WARNING – 通知: 下单失败,26:已撤单报单被拒绝SHFE:当前状态禁止此项操作,合约代码:SHFE.rb2010,下单方向:买,开平标志:平今,委托价格:3520,委托手数:1
Traceback (most recent call last):
File “D:\ProgramData\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py”, line 3326, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File “<ipython-input-2-dfe16e6627c1>”, line 1, in <module>
runfile(‘D:/PyCharmProject/TestBegin.py’, wdir=’D:/PyCharmProject’)
File “D:\ProgramData\PyCharm Community Edition 2019.3.3\plugins\python-ce\helpers\pydev\_pydev_bundle\pydev_umd.py”, line 197, in runfile
pydev_imports.execfile(filename, global_vars, local_vars) # execute the script
File “D:\ProgramData\PyCharm Community Edition 2019.3.3\plugins\python-ce\helpers\pydev\_pydev_imps\_pydev_execfile.py”, line 18, in execfile
exec(compile(contents+”\n”, file, ‘exec’), glob, loc)
File “D:/PyCharmProject/TestBegin.py”, line 57, in <module>
main_loop(cond, data, ord, pos, api, 1, klinesMin, acc, 1, posTask)
File “D:\PyCharmProject\MainLoop.py”, line 17, in main_loop
api.wait_update()
File “D:\ProgramData\Anaconda3\lib\site-packages\tqsdk\api.py”, line 891, in wait_update
self._run_until_idle()
File “D:\ProgramData\Anaconda3\lib\site-packages\tqsdk\api.py”, line 1534, in _run_until_idle
self._run_once()
File “D:\ProgramData\Anaconda3\lib\site-packages\tqsdk\api.py”, line 1527, in _run_once
raise self._exceptions.pop(0)
File “D:\ProgramData\Anaconda3\lib\site-packages\tqsdk\lib.py”, line 159, in _target_pos_task
await gather(*[each._task for each in all_tasks])
File “D:\ProgramData\Anaconda3\lib\site-packages\tqsdk\lib.py”, line 240, in _run
self._symbol, self._direction, self._offset, self._volume, limit_price, order.last_msg))
Exception: 遇到错单: SHFE.rb2010 BUY CLOSETODAY 1手 3520.000000 26:已撤单报单被拒绝SHFE:当前状态禁止此项操作
2020-05-22 13:30:00,716 是本地时间,那么你报单的时间是比这个时间早的,很可能还没开盘,你是程序一启动就报单了还是收到第一笔quote行情之后才下单的呢?如果是一启动就下单了,那就有可能是在开盘前下单的
我是订阅了15分钟K线行情,根据新K线产生消息触发下单,可以看到我添加的调试信息:new k : 2020-05-22 13:30:00
这个算盘后吧?不应该失败吧?