Administrator
2023-12-28 6ebf3a8a4a1b48547633de879a26014b77feec46
l2/l2_data_manager_new.py
@@ -14,7 +14,7 @@
from log_module import async_log_util, log_export
from third_data import kpl_data_manager, block_info, history_k_data_util
from third_data.history_k_data_util import HistoryKDatasUtils
from utils import global_util, ths_industry_util, tool
from utils import global_util, ths_industry_util, tool, buy_condition_util
import l2_data_util
from db import redis_manager_delegate as redis_manager
from third_data.code_plate_key_manager import CodePlateKeyBuyManager, KPLCodeJXBlockManager, LimitUpCodesPlateKeyManager
@@ -32,7 +32,7 @@
from trade.trade_data_manager import CodeActualPriceProcessor, PlaceOrderCountManager
from trade.trade_manager import TradeTargetCodeModeManager, AccountAvailableMoneyManager
from trade.trade_manager import TradeTargetCodeModeManager, AccountAvailableMoneyManager, MarketSituationManager
class L2DataManager:
@@ -240,6 +240,7 @@
    __L2LimitUpSellManager = L2LimitUpSellManager()
    __PlaceOrderCountManager = PlaceOrderCountManager()
    __CodeNatureRecordManager = code_nature_analyse.CodeNatureRecordManager()
    __MarketSituationManager=MarketSituationManager()
    # 获取代码评分
    @classmethod
@@ -1013,14 +1014,16 @@
            if day in HistoryKDatasUtils.get_latest_trading_date_cache(5):
                if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < 0.6:
                    return False, True, f"参考量在最近5天,量未达到60%({cls.volume_rate_info[code][0]})"
        # 获取市场行情
        situation = cls.__MarketSituationManager.get_situation_cache()
        zylt_threshold = buy_condition_util.get_zyltgb_threshold(situation)
        zyltgb = global_util.zyltgb_map.get(code)
        if k_format and k_format[8][0]:
            # 具有辨识度
            zyltgb = 15 * 100000000
            zyltgb = zylt_threshold[1] + 1
        if zyltgb >= 40 * 100000000:
            return False, True, f"40亿以上的都不买({zyltgb})"
        if zyltgb >= zylt_threshold[0]:
            return False, True, f"{zylt_threshold[0]//100000000}亿以上的都不买({zyltgb})"
        if HighIncreaseCodeManager().is_in(code):
            if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < 0.8:
@@ -1032,7 +1035,7 @@
            # 独苗
            if not can_buy_result[0] and can_buy_result[1]:
                msg_list.append("独苗")
                if zyltgb < 10 * 100000000 or zyltgb > 20 * 100000000:
                if zyltgb < zylt_threshold[1] or zyltgb > zylt_threshold[2]:
                    return False, True, f"强势10分钟,独苗({can_buy_result[4]})不下单({can_buy_result[4]})自由流通市值({zyltgb})不满足条件"
                if k_format and (k_format[1][0] or k_format[3][0]):
                    msg_list.append("股价创新高或者逼近前高")
@@ -1044,7 +1047,7 @@
                        return False, True, f"强势10分钟,独苗({can_buy_result[4]}),当日量比({cls.volume_rate_info[code][0]})小于0.3"
            else:
                msg_list.append("非独苗")
                if zyltgb < 10 * 100000000 or zyltgb > 20 * 100000000:
                if zyltgb < zylt_threshold[1] or zyltgb > zylt_threshold[2]:
                    msg_list.append("不满足自由流通")
                    if k_format and (k_format[1][0] or k_format[3][0]):
                        # 股价创新高或者逼近前高
@@ -1064,7 +1067,7 @@
                return False, True, f"非强势10分钟,独苗({can_buy_result[4]})不下单"
            if can_buy_result[3]:
                # 强势主线
                if zyltgb < 10 * 100000000 or zyltgb > 20 * 100000000:
                if zyltgb < zylt_threshold[1] or zyltgb > zylt_threshold[2]:
                    if k_format and (k_format[1][0] or k_format[3][0]):
                        # 股价创新高或者逼近前高
                        if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < 0.6:
@@ -1078,7 +1081,7 @@
                            return False, True, f"非强势10分钟,强势主线后排,满足自由市值,股价创新高或者逼近前高, 当日量比({cls.volume_rate_info[code][0]})小于0.3"
            else:
                # 非强势主线
                if zyltgb < 10 * 100000000 or zyltgb > 20 * 100000000:
                if zyltgb < zylt_threshold[1] or zyltgb > zylt_threshold[2]:
                    if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < 0.6:
                        return False, True, f"非强势10分钟,非强势主线后排,不满足自由市值, 当日量比({cls.volume_rate_info[code][0]})小于0.6"
                else: