Administrator
2024-04-11 832d70d984316e43048a84ad61d0c8a12c319993
l2/l2_data_manager_new.py
@@ -317,8 +317,17 @@
                local_today_datas[code] = []
            if total_datas:
                _start_index = total_datas[-1]["index"] + 1
            datas = l2_huaxin_util.get_format_l2_datas(code, origin_datas,
                                                       gpcode_manager.get_limit_up_price(code), _start_index)
            # 如果是板上,就需要剔除板上卖数据, 默认不剔除
            filter_limit_up_sell = False
            trade_price_info = HuaXinSellOrderStatisticManager.get_latest_trade_price_info(code)
            limit_up_price = gpcode_manager.get_limit_up_price(code)
            if limit_up_price:
                limit_up_price = round(float(limit_up_price), 2)
            if trade_price_info and limit_up_price and trade_price_info[0] == limit_up_price:
                filter_limit_up_sell = True
            datas = l2_huaxin_util.get_format_l2_datas(code, origin_datas, limit_up_price, _start_index,
                                                       filter_limit_up_sell)
            __start_time = round(t.time() * 1000)
            if len(datas) > 0:
                cls.process_add_datas(code, datas, 0, __start_time)
@@ -1645,8 +1654,11 @@
        start_time_str = total_datas[start_index]["val"]["time"]
        # 获取最近的总卖信息
        refer_sell_data = cls.__L2MarketSellManager.get_refer_sell_data(code, start_time_str)
        if refer_sell_data is None:
        if refer_sell_data is None and start_time_str != '09:30:00':
            return False, -1, "总卖为空"
        if refer_sell_data is None:
            refer_sell_data = (start_time_str, 0, 0, (round(float(total_datas[start_index]["val"]["price"]), 2), 0))
            l2_log.debug(code, f"丢失总卖额,设置默认为0,计算范围:{start_index}-{end_index}")
        # 获取当前是否可激进买
        # 获取板块是否可以激进买
        # 可买的板块, 是否独苗, 消息, 可买的强势板块, 关键词, 激进买的板块
@@ -2159,8 +2171,14 @@
            if not trigger_buy:
                not_buy_msg = f"【{i}】没有买单触发"
                continue
            if buy_count < 1:
                not_buy_msg = f"【{i}】安全笔数不足,{buy_count}/{1}"
            safe_count = 1
            if threshold_money <= 0:
                # 板上下单需要安全笔数3笔
                safe_count = 3
            if buy_count < safe_count:
                not_buy_msg = f"【{i}】安全笔数不足,{buy_count}/{safe_count}"
                continue
            # max_buy_num_set = cls.__filter_not_deal_indexes(code, max_buy_num_set)