采用本地停止单的模式下,我发现在实盘下无法正常撤单。版本2.0.6, 股指IC1908合约交易。
在回测模式下是OK的。然后我debug了一下,发现在回测模式下,backtesting engine返回的是 vt_orderid是这样的格式["STOP.1"] ,而在cta engine下,返回的本地停止单的的格式是'STOP.1", 是不带[]的。 请问正确的格式是应该是怎样的? 我找了一下相关源代码,如下
cta engine的代码(413行)=====>
self.stop_orders[stop_orderid] = stop_order
vt_orderids = self.strategy_orderid_map[strategy.strategy_name]
vt_orderids.add(stop_orderid)
self.call_strategy_func(strategy, strategy.on_stop_order, stop_order)
self.put_stop_order_event(stop_order)
return stop_orderid
BacktestingEngine的代码(906行)======>
price = round_to(price, self.pricetick)
if stop:
vt_orderid = self.send_stop_order(direction, offset, price, volume)
else:
vt_orderid = self.send_limit_order(direction, offset, price, volume)
return [vt_orderid]