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

Traceback (most recent call last):
File "d:\vnstudio\lib\site-packages\vnpy\trader\ui\widget.py", line 449, in cancel_order
self.main_engine.cancel_order(req, order.gateway_name)
File "d:\vnstudio\lib\site-packages\vnpy\trader\engine.py", line 192, in cancel_order
gateway.cancel_order(req)
File "d:\vnstudio\lib\site-packages\vnpy\gateway\ctptest\ctptest_gateway.py", line 185, in cancel_order
self.td_api.cancel_order(req)
File "d:\vnstudio\lib\site-packages\vnpy\gateway\ctptest\ctptest_gateway.py", line 785, in cancel_order
self.reqOrderAction(ctp_req, self.reqid)
RuntimeError: Unable to cast Python instance to C++ type (compile in debug mode for details)

大佬们,应该是接口封装问题,求修复

Member
avatar
加入于:
帖子: 11
声望: 0

好了 是代码问题
ctp_req = {
"InstrumentID": req.symbol,
"ExchangeID": req.exchange.value,
"OrderRef": order_ref,
"FrontID": int(frontid),
"SessionID": int(sessionid),
"ActionFlag": THOST_FTDC_AF_Delete,
"BrokerID": self.brokerid,
"InvestorID": self.userid
}

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