Administrator
2024-10-31 b855b811e3753ffcb35f145c985bb32f4b550038
trade/huaxin/huaxin_trade_order_processor.py
@@ -117,6 +117,12 @@
    # 处理买单
    @classmethod
    def process_buy_order(cls, order: HuaxinOrderEntity):
        """
        处理买单
        @param order:
        @return: 是否需要撤单
        """
        # 处理下单成功
        def process_order_success(order_: HuaxinOrderEntity, delay_s=0.0):
            if delay_s > 0:
@@ -135,16 +141,22 @@
        # 只处理买入单
        if order.direction != str(huaxin_util.TORA_TSTP_D_Buy):
            return
            return False
        # 只处理正式订单,不处理影子订单
        if order.is_shadow_order:
            return
            # 9:15之前下的影子单
            if order.insertTime and int(order.insertTime.replace(":", "")) < int("091500"):
                # 是委托状态的影子单且是交易所已接受的状态
                if order.orderStatus == huaxin_util.TORA_TSTP_OST_Accepted:
                    # 需要撤单
                    return True
            return False
        # 同一订单号只有状态变化了才需要处理
        key = f"{order.insertDate}_{order.code}_{order.orderSysID}_{order.orderStatus}"
        if key in cls.__processed_keys:
            return
            return False
        try:
            async_log_util.info(hx_logger_trade_debug, f"处理华鑫订单:{key}")
            cls.__processed_keys.add(key)
@@ -169,6 +181,7 @@
                    CancelOrderManager().cancel_success(order.code, order.orderRef, order.orderSysID)
        except Exception as e:
            async_log_util.exception(hx_logger_trade_debug, e)
        return False
    # 返回是否要监控撤单
    @classmethod