vn.py量化社区
By Traders, For Traders.
Member
avatar
加入于:
帖子: 4
声望: 0

Traceback (most recent call last):
File "C:/Users/zyz/Desktop/vnpy_study/test2.py", line 16, in <module>
script_engine.buy(vt_symbol = "rb1910.SHFE",price = "3200",volume = "1",order_type=OrderType.LIMIT)
File "D:\anaconda3\lib\site-packages\vnpy-2.0.6-py3.7.egg\vnpy\app\script_trader\engine.py", line 147, in buy
return self.send_order(vt_symbol, price, volume, Direction.LONG, Offset.OPEN, order_type)
File "D:\anaconda3\lib\site-packages\vnpy-2.0.6-py3.7.egg\vnpy\app\script_trader\engine.py", line 130, in send_order
vt_orderid = self.main_engine.send_order(req, contract.gateway_name)
File "D:\anaconda3\lib\site-packages\vnpy-2.0.6-py3.7.egg\vnpy\trader\engine.py", line 174, in send_order
return gateway.send_order(req)
File "D:\anaconda3\lib\site-packages\vnpy-2.0.6-py3.7.egg\vnpy\gateway\ctp\ctp_gateway.py", line 174, in send_order
return self.td_api.send_order(req)
File "D:\anaconda3\lib\site-packages\vnpy-2.0.6-py3.7.egg\vnpy\gateway\ctp\ctp_gateway.py", line 751, in send_order
self.reqOrderInsert(ctp_req, self.reqid)
RuntimeError: Unable to cast Python instance to C++ type (compile in debug mode for details)

Administrator
avatar
加入于:
帖子: 2152
声望: 99

price和volume都应该是float类型,之前ScriptEngine的类型提示写错了,DEV分支刚修复

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