VeighNa量化社区
你的开源社区量化交易平台
Member
avatar
加入于:
帖子: 5
声望: 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
加入于:
帖子: 4541
声望: 324

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

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

沪公网安备 31011502017034号

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