Administrator
2024-11-07 93ec042ae730c8e4cad1562d7ee579941847397c
l2/l2_limitup_sell_data_manager.py
@@ -48,14 +48,16 @@
                        # 卖撤
                        cls.__order_no_set_dict[code].discard(order_no)
                        cls.__delegating_sell_num_dict[code] -= volume
                        async_log_util.l2_data_log.info(hx_logger_l2_sell_delegate, f"{code}-卖撤-{order_no, price, volume}")
                        async_log_util.l2_data_log.info(hx_logger_l2_sell_delegate,
                                                        f"{code}-卖撤-{order_no, price, volume}")
                else:
                    if d[3] != '1':
                        # 卖
                        cls.__order_no_data_map_dict[code][order_no] = (order_no, price, volume)
                        cls.__order_no_set_dict[code].add(order_no)
                        cls.__delegating_sell_num_dict[code] += volume
                        async_log_util.l2_data_log.info(hx_logger_l2_sell_delegate, f"{code}-卖-{order_no, price, volume}")
                        async_log_util.l2_data_log.info(hx_logger_l2_sell_delegate,
                                                        f"{code}-卖-{order_no, price, volume}")
        except:
            pass
@@ -79,7 +81,7 @@
        try:
            limit_up_price = gpcode_manager.get_limit_up_price_as_num(code)
            has_limit_up_active_buy = False
            order_no_set =  cls.__order_no_set_dict.get(code)
            order_no_set = cls.__order_no_set_dict.get(code)
            if order_no_set is None:
                order_no_set = set()
            for d in datas:
@@ -90,16 +92,18 @@
                    continue
                has_limit_up_active_buy = True
                break
            total_deal_volume = 0
            if code in cls.__delegating_sell_num_dict:
                for d in datas:
                    # 减去
                    if d[7] in order_no_set:
                        cls.__delegating_sell_num_dict[code] -= d[2]
                        total_deal_volume += d[2]
                cls.__delegating_sell_num_dict[code] -= total_deal_volume
            if has_limit_up_active_buy:
                # 打印日志
                async_log_util.l2_data_log.info(hx_logger_l2_sell_deal, f"有涨停主动卖:{code}-{datas[-1][3]}-{ cls.__delegating_sell_num_dict.get(code)}")
                async_log_util.l2_data_log.info(hx_logger_l2_sell_deal,
                                                f"有涨停主动卖:{code}-{datas[-1][3]}-{cls.__delegating_sell_num_dict.get(code)}, 成交量-{total_deal_volume}")
        except:
            pass
@@ -118,5 +122,3 @@
        if code in cls.__delegating_sell_num_dict:
            cls.__delegating_sell_num_dict.pop(code)