如题,在回测测试时,如果没有底仓,直接开仓时,orderdata是正常的,先是“未成交”,然后成交。但是只要是有底仓,执行加仓的话,orderdata的状态就全都是“已撤销”,这样回测策略就执行不了加仓了。而且从实盘上也检查了,报价并没有超出涨跌停范围。
OrderData(gateway_name='BACKTESTING', symbol='RB888', exchange=<Exchange.SHFE: 'SHFE'>, orderid='1', type=<OrderType.LIMIT: '限价'>, direction=<Direction.SHORT: '空'>, offset=<Offset.OPEN: '开'>, price=4426.0, volume=3, traded=0, status=<Status.NOTTRADED: '未成交'>, datetime=datetime.datetime(2021, 6, 16, 21, 4, tzinfo=<DstTzInfo 'Asia/Shanghai' CST+8:00:00 STD>), reference='')
OrderData(gateway_name='BACKTESTING', symbol='RB888', exchange=<Exchange.SHFE: 'SHFE'>, orderid='1', type=<OrderType.LIMIT: '限价'>, direction=<Direction.SHORT: '空'>, offset=<Offset.OPEN: '开'>, price=4426.0, volume=3, traded=3, status=<Status.ALLTRADED: '全部成交'>, datetime=datetime.datetime(2021, 6, 16, 21, 4, tzinfo=<DstTzInfo 'Asia/Shanghai' CST+8:00:00 STD>), reference='')
OrderData(gateway_name='BACKTESTING', symbol='RB888', exchange=<Exchange.SHFE: 'SHFE'>, orderid='4', type=<OrderType.LIMIT: '限价'>, direction=<Direction.LONG: '多'>, offset=<Offset.OPEN: '开'>, price=4960.0, volume=2, traded=0, status=<Status.CANCELLED: '已撤销'>, datetime=datetime.datetime(2021, 7, 9, 22, 19, tzinfo=<DstTzInfo 'Asia/Shanghai' CST+8:00:00 STD>), reference='')