vn.py官网
你的开源社区量化交易平台
Member
avatar
加入于:
帖子: 86
声望: 4

我是2.1.8.1版本,也就是最新版本。
https://static.vnpy.com/upload/temp/518d13d7-d9df-4803-a1ac-e41300f7ae5c.JPG
vnpy显示提交中,可是在IB的trader workstation中已经成交了。vn trader中一下订单,vn trader 中行情就停止走动了。界面停止了,行情不跳了。

论坛查找了半天,
https://www.vnpy.com/forum/topic/3575-guan-yu-ibzhong-de-yi-xie-guan-yu-exchangede-wen-ti-huan-you-jie-jue-ban-fa?page=1#pid20237
这个帖子描述的问题和我的符合,可是我是最新版本,帖子中说明的问题在代码中已经解决了。

请指点,非常感谢。

Member
avatar
加入于:
帖子: 2748
声望: 189

看了你那个帖子的回复,名称那里是空的说明没有订阅成功,那么是下不出去单的

Member
avatar
加入于:
帖子: 86
声望: 4

description
能够下单,但ib中显示成交,vnpy中显示提交中。

会是哪里的问题,能指点一下吗

Member
avatar
加入于:
帖子: 86
声望: 4

/examples/vn_trader/run.py
运行上面这个文件,然后订阅行情,然后下单,下面是提示


ERROR -1 2104 Market data farm connection is OK:hfarm
ERROR -1 2104 Market data farm connection is OK:cashfarm
ERROR -1 2104 Market data farm connection is OK:usfarm
ERROR -1 2106 HMDS data farm connection is OK:cashhmds
ERROR -1 2106 HMDS data farm connection is OK:hkhmds
ERROR -1 2158 Sec-def data farm connection is OK:secdefhk
ERROR 9 399 Order Message:
Âò 1 EUR.USD Forex
Warning: Your order size is below the EUR 20000 IdealPro minimum and will be routed as an odd lot order.
Exception in thread Thread-4:
Traceback (most recent call last):
  File "C:\vnstudio\lib\threading.py", line 917, in _bootstrap_inner
    self.run()
  File "C:\vnstudio\lib\threading.py", line 865, in run
    self._target(*self._args, **self._kwargs)
  File "C:\vnstudio\lib\site-packages\vnpy\gateway\ib\ib_gateway.py", line 831, in run
    self.decoder.interpret(fields)
  File "C:\vnstudio\lib\site-packages\ibapi\decoder.py", line 1280, in interpret
    handleInfo.processMeth(self, iter(fields))
  File "C:\vnstudio\lib\site-packages\ibapi\decoder.py", line 214, in processOpenOrder
    self.wrapper.openOrder(order.orderId, contract, order, orderState)
  File "C:\vnstudio\lib\site-packages\vnpy\gateway\ib\ib_gateway.py", line 428, in openOrder
    symbol=ib_generate_symbol(contract),
NameError: name 'ib_generate_symbol' is not defined
Member
avatar
加入于:
帖子: 86
声望: 4

关闭程序,又出现下面的提示

unhandled exception in EReader thread
Traceback (most recent call last):
File "C:\vnstudio\lib\site-packages\ibapi\reader.py", line 34, in run
data = self.conn.recvMsg()
File "C:\vnstudio\lib\site-packages\ibapi\connection.py", line 99, in recvMsg
buf = self._recvAllMsg()
File "C:\vnstudio\lib\site-packages\ibapi\connection.py", line 119, in _recvAllMsg
buf = self.socket.recv(4096)
OSError: [WinError 10038] 在一个非套接字上尝试了一个操作。

Member
avatar
加入于:
帖子: 2748
声望: 189

黄裳 wrote:

/examples/vn_trader/run.py
运行上面这个文件,然后订阅行情,然后下单,下面是提示


ERROR -1 2104 Market data farm connection is OK:hfarm
ERROR -1 2104 Market data farm connection is OK:cashfarm
ERROR -1 2104 Market data farm connection is OK:usfarm
ERROR -1 2106 HMDS data farm connection is OK:cashhmds
ERROR -1 2106 HMDS data farm connection is OK:hkhmds
ERROR -1 2158 Sec-def data farm connection is OK:secdefhk
ERROR 9 399 Order Message:
Âò 1 EUR.USD Forex
Warning: Your order size is below the EUR 20000 IdealPro minimum and will be routed as an odd lot order.
Exception in thread Thread-4:
Traceback (most recent call last):
  File "C:\vnstudio\lib\threading.py", line 917, in _bootstrap_inner
    self.run()
  File "C:\vnstudio\lib\threading.py", line 865, in run
    self._target(*self._args, **self._kwargs)
  File "C:\vnstudio\lib\site-packages\vnpy\gateway\ib\ib_gateway.py", line 831, in run
    self.decoder.interpret(fields)
  File "C:\vnstudio\lib\site-packages\ibapi\decoder.py", line 1280, in interpret
    handleInfo.processMeth(self, iter(fields))
  File "C:\vnstudio\lib\site-packages\ibapi\decoder.py", line 214, in processOpenOrder
    self.wrapper.openOrder(order.orderId, contract, order, orderState)
  File "C:\vnstudio\lib\site-packages\vnpy\gateway\ib\ib_gateway.py", line 428, in openOrder
    symbol=ib_generate_symbol(contract),
NameError: name 'ib_generate_symbol' is not defined

请去github拉取一下dev分支最新的ib_gateway的代码吧,这里应该是generate_symbol(ib_contract)

Member
avatar
加入于:
帖子: 86
声望: 4

description

我在这里复制了这个文件替换原来的,问题仍旧,你说的dev分支是哪里??我对github不太熟悉。

非常感谢回复!!

Member
avatar
加入于:
帖子: 86
声望: 4

这个显示的应该是master分支,你说的dev应该是开发分支,dev的代码从哪里能看到??是不是要安装git的专用工具才可以??

Member
avatar
加入于:
帖子: 86
声望: 4

我找到了,问题解决了,非常感谢!!!

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

沪公网安备 31011502017034号