Administrator
2023-04-24 70f473d20da7532f4cb2f84b7e82b0bcee357700
l2/l2_data_manager_new.py
@@ -672,6 +672,25 @@
    def __can_buy_first(cls, code):
        if not trade_manager.TradeStateManager.is_can_buy():
            return False, True, f"今日已禁止交易"
        # 判断买1价格档位
        zyltgb = global_util.zyltgb_map.get(code)
        if zyltgb is None:
            global_data_loader.load_zyltgb()
            zyltgb = global_util.zyltgb_map.get(code)
        buy1_price = code_price_manager.Buy1PriceManager.get_buy1_price(code)
        if buy1_price is None:
            return False, True, f"尚未获取到买1价"
        limit_up_price = gpcode_manager.get_limit_up_price(code)
        dif = float(limit_up_price) - float(buy1_price)
        if zyltgb >= 80 * 100000000:
            # 大于2档
            if dif > 0.02001:
                return False, True, f"买1剩余档数大于2档,买一({buy1_price})涨停({limit_up_price})"
        else:
            if dif > 0.03001:
                return False, True, f"买1剩余档数大于3档,买一({buy1_price})涨停({limit_up_price})"
        limit_up_info = code_price_manager.Buy1PriceManager.get_limit_up_info(code)
        if limit_up_info[0] is None and False:
            total_data = local_today_datas.get(code)
@@ -707,10 +726,6 @@
            score = cls.__l2PlaceOrderParamsManagerDict[code].score
            score_info = cls.__l2PlaceOrderParamsManagerDict[code].score_info
            zyltgb = global_util.zyltgb_map.get(code)
            if zyltgb is None:
                global_data_loader.load_zyltgb()
                zyltgb = global_util.zyltgb_map.get(code)
            # 区分大票,小票
            if zyltgb >= 80 * 100000000:
                if cls.volume_rate_info[code][0] < 0.5:
@@ -1132,15 +1147,17 @@
            l2_log.buy_debug(code, "位置-{},总手数:{},目标手数:{}", i,
                             buy_nums, threshold_num)
            max_buy_num_set_count = 0
            for i in max_buy_num_set:
                max_buy_num_set_count += total_datas[i]["re"]
            # 有撤单信号,且小于阈值
            if buy_nums >= threshold_num and buy_count >= get_threshold_count() and trigger_buy and len(
                    max_buy_num_set) >= big_num_count:
            if buy_nums >= threshold_num and buy_count >= get_threshold_count() and trigger_buy and max_buy_num_set_count >= big_num_count:
                return i, buy_nums, buy_count, None, max_buy_num_set
        l2_log.buy_debug(code, "尚未获取到买入执行点,起始计算位置:{} 统计纯买手数:{} 目标纯买手数:{}  统计纯买单数:{} 目标纯买单数:{} 大单数量:{} 目标大单数量:{}",
                         compute_start_index,
                         buy_nums,
                         threshold_num, buy_count, get_threshold_count(), len(max_buy_num_set), big_num_count)
                         threshold_num, buy_count, get_threshold_count(), max_buy_num_set_count, big_num_count)
        return None, buy_nums, buy_count, None, max_buy_num_set