fix check pending order
This commit is contained in:
parent
050eaaf041
commit
2f02d05daf
@ -190,15 +190,18 @@ class RealTraderManager:
|
||||
if duration > Config.RTM_ORDER_TIMEOUT:
|
||||
logger.info(f"限价单超时: ID={order_id}, 策略={strategy_name}, 持续时间={duration}秒")
|
||||
self.trader.cancel(order_id)
|
||||
time.sleep(1)
|
||||
time.sleep(3)
|
||||
order = self.trader.get_order(order_id)
|
||||
if order['order_status'] == xtconstant.ORDER_CANCELED:
|
||||
logger.info(f"限价单已撤销: ID={order_id}, 策略={strategy_name}")
|
||||
self.trader.handle_order_update(order_id, strategy_name)
|
||||
logger.info(f"检测到限价单被撤销,准备进行市价单补单: ID={order_id}")
|
||||
self.trader.place_market_order_for_remainder(order_info, strategy_name)
|
||||
elif order['order_status'] == xtconstant.ORDER_SUCCEEDED:
|
||||
logger.info(f"尝试撤单未成功, 限价单已成交: ID={order_id}, 策略={strategy_name}, 状态={order['order_status']}")
|
||||
self.trader.handle_order_update(order_id, strategy_name)
|
||||
else:
|
||||
logger.warning(f"限价单撤销失败: ID={order_id}, 策略={strategy_name}")
|
||||
logger.warning(f"限价单撤销失败: ID={order_id}, 策略={strategy_name}, 状态={order['order_status']}")
|
||||
else:
|
||||
logger.info(f"更新市价单: ID={order_id}, 策略={strategy_name}, 订单类型={order_info.order_type}")
|
||||
self.trader.handle_order_update(order_id, strategy_name)
|
||||
|
Loading…
x
Reference in New Issue
Block a user