Administrator
2024-10-31 b855b811e3753ffcb35f145c985bb32f4b550038
trade/huaxin/huaxin_trade_api.py
@@ -80,9 +80,13 @@
                if huaxin_util.is_deal(order.orderStatus):
                    # 如果成交了需要刷新委托列表
                    huaxin_trade_data_update.add_delegate_list("卖成交")
            TradeResultProcessor.process_buy_order(order)
            need_cancel = TradeResultProcessor.process_buy_order(order)
            if need_cancel:
                # 需要撤买单
                threading.Thread(target=lambda:  cancel_order(2, order.code, order.orderSysID), daemon=True).start()
            need_watch_cancel = TradeResultProcessor.process_sell_order(order)
            if need_watch_cancel:
                # 需要撤卖单
                threading.Thread(target=lambda: __cancel_order(order.code, order.orderRef), daemon=True).start()
        finally:
            try:
@@ -492,6 +496,10 @@
    if not request_id:
        request_id = __get_request_id(ClientSocketManager.CLIENT_TYPE_TRADE)
    for i in range(1):
        cancel_shadow = True
        if int(tool.get_now_time_str().replace(":", "")) < int("091500"):
            # 预埋单不能撤影子单
            cancel_shadow = False
        request_id = __request(ClientSocketManager.CLIENT_TYPE_TRADE,
                               {"type": ClientSocketManager.CLIENT_TYPE_TRADE, "trade_type": 1,
                                "direction": direction,
@@ -499,7 +507,11 @@
                                "order_ref": order_ref,
                                "volume": volume,
                                "price_type": price_type,
                                "price": price, "shadow_price": shadow_price, "sinfo": sinfo, "blocking": blocking},
                                "price": price,
                                "shadow_price": shadow_price,
                                "sinfo": sinfo,
                                "blocking": blocking,
                                "cancel_shadow": cancel_shadow},
                               request_id=request_id,
                               is_trade=True)
    try: