VeighNa量化社区
你的开源社区量化交易平台
Member
avatar
加入于:
帖子: 218
声望: 0

Exception in thread Thread-1:
Traceback (most recent call last):
File "d:\ProgramData\Anaconda3\envs\py37_vnpy\lib\threading.py", line 926, in _bootstrap_inner
self.run()
File "d:\ProgramData\Anaconda3\envs\py37_vnpy\lib\threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\zhangxiaoyong\vnpy-master\vnpy-master\vnpy\event\engine.py", line 60, in _run
self._process(event)
File "C:\Users\zhangxiaoyong\vnpy-master\vnpy-master\vnpy\event\engine.py", line 73, in _process
[handler(event) for handler in self._handlers[event.type]]
File "C:\Users\zhangxiaoyong\vnpy-master\vnpy-master\vnpy\event\engine.py", line 73, in <listcomp>
[handler(event) for handler in self._handlers[event.type]]
File "d:\ProgramData\Anaconda3\envs\py37_vnpy\lib\site-packages\vnpy_paperaccount\engine.py", line 103, in process_tick_event
self.cross_order(order, tick)
File "d:\ProgramData\Anaconda3\envs\py37_vnpy\lib\site-packages\vnpy_paperaccount\engine.py", line 311, in cross_order
self.update_position(trade, contract)
File "d:\ProgramData\Anaconda3\envs\py37_vnpy\lib\site-packages\vnpy_paperaccount\engine.py", line 362, in update_position
long_position.price = new_cost / long_position.volume
ZeroDivisionError: float division by zero

Member
avatar
加入于:
帖子: 716
声望: 55

long_position.volume是0,无法除,自行做一个过滤

© 2015-2022 上海韦纳软件科技有限公司
备案服务号:沪ICP备18006526号

沪公网安备 31011502017034号

【用户协议】
【隐私政策】
【免责条款】