Administrator
2023-10-25 ffc5b9eb80eb5bd43077a0ce96e0fb2ea4c8d62c
bug修复
4个文件已修改
16 ■■■■■ 已修改文件
huaxin_client/trade_client.py 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
trade/huaxin/huaxin_trade_api.py 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
trade/huaxin/huaxin_trade_order_processor.py 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
utils/data_export_util.py 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
huaxin_client/trade_client.py
@@ -874,12 +874,14 @@
            sinfo = data["sinfo"]
            order_ref = data.get("order_ref")
            shadow_price = data.get("shadow_price")
            blocking = data.get("blocking")
            if direction == 1:
                async_log_util.info(logger_trade, f"{code}华鑫本地开始下单")
                # 买
                try:
                    req_rid_dict[sinfo] = (client_id, request_id, sk, order_ref)
                    if blocking:
                        req_rid_dict[sinfo] = (client_id, request_id, sk, order_ref)
                    # threading.Thread(target=lambda: self.__tradeSimpleApi.buy(code, volume, price, sinfo, order_ref),
                    #                  daemon=True).start()
                    self.trade_thread_pool.submit(self.__tradeSimpleApi.buy, code, volume, price, sinfo, order_ref, shadow_price)
trade/huaxin/huaxin_trade_api.py
@@ -372,7 +372,8 @@
                            "order_ref": order_ref,
                            "volume": volume,
                            "price_type": price_type,
                            "price": price, "shadow_price": shadow_price, "sinfo": sinfo}, request_id=request_id,
                            "price": price, "shadow_price": shadow_price, "sinfo": sinfo, "blocking": blocking},
                           request_id=request_id,
                           blocking=blocking,
                           is_pipe=is_pipe_channel_normal())
    try:
trade/huaxin/huaxin_trade_order_processor.py
@@ -148,9 +148,10 @@
            if huaxin_util.is_can_cancel(order.orderStatus):
                # 设置下单成功
                new_place_order_index_ = process_order_success(order)
                if not new_place_order_index_:
                    # 有可能由于L2数据还没有来,导致正确的下单位置尚未获取到,需要延时200ms再进行处理
                    cls.__thread_pool.submit(lambda: process_order_success(order, delay_s=0.2))
                # 暂时不需要验证
                # if not new_place_order_index_:
                #     # 有可能由于L2数据还没有来,导致正确的下单位置尚未获取到,需要延时200ms再进行处理
                #     cls.__thread_pool.submit(lambda: process_order_success(order, delay_s=0.2))
            elif huaxin_util.is_canceled(order.orderStatus) or huaxin_util.is_deal(
                    order.orderStatus):
                # 已经撤单/已经成交,需要处理临时保存的系统订单号
utils/data_export_util.py
@@ -265,6 +265,6 @@
if __name__ == "__main__":
    try:
        export_l2_excel("000010")
        export_l2_excel("000981")
    except Exception as e:
        logging.exception(e)