Administrator
2024-01-18 0f000922597f32bc525a3f1afa47fd160f76f22e
选票策略修改
4个文件已修改
52 ■■■■■ 已修改文件
code_attribute/code_volumn_manager.py 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
l2/l2_data_manager_new.py 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
third_data/code_plate_key_manager.py 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
utils/buy_condition_util.py 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
code_attribute/code_volumn_manager.py
@@ -20,7 +20,7 @@
# 设置历史量
def set_histry_volumn(code, max60, yesterday, max60_day, max60_day_count):
    redis = __redis_manager.getRedis()
    global_util.max60_volumn[code] = (max60, max60_day)
    global_util.max60_volumn[code] = (max60, max60_day,max60_day_count)
    global_util.yesterday_volumn[code] = yesterday
    try:
        RedisUtils.setex_async(0, "volumn_max60-{}".format(code), tool.get_expire(),
l2/l2_data_manager_new.py
@@ -989,6 +989,9 @@
        has_limit_down_in_5 = True if k_format and len(k_format) >= 13 and k_format[12] else False
        # 是否是强势10分钟
        is_in_strong_time = now_timestamp <= int("094000")
        # 是否是强势30分钟
        is_in_strong_time_30 = now_timestamp <= int("100000")
        # 量参考是否在最近30天
        # is_refer_volume_date_in_30_days = False
@@ -1006,21 +1009,28 @@
        # 获取市场行情
        situation = cls.__MarketSituationManager.get_situation_cache()
        zylt_threshold = buy_condition_util.get_zyltgb_threshold(situation)
        zyltgb = global_util.zyltgb_map.get(code)
        zylt_threshold_as_yi = buy_condition_util.get_zyltgb_threshold(situation)
        zyltgb_as_yi = round(global_util.zyltgb_map.get(code) / 100000000, 2)
        if zyltgb >= zylt_threshold[1]:
            return False, True, f"{zylt_threshold[1] // 100000000}亿以上的都不买({zyltgb})"
        if zyltgb_as_yi >= zylt_threshold_as_yi[1]:
            return False, True, f"{zylt_threshold_as_yi[1]}亿以上的都不买({zyltgb_as_yi})"
        if zyltgb < zylt_threshold[0]:
            return False, True, f"{zylt_threshold[0] // 100000000}亿以下的都不买({zyltgb})"
        if zyltgb_as_yi < zylt_threshold_as_yi[0]:
            return False, True, f"{zylt_threshold_as_yi[0]}亿以下的都不买({zyltgb_as_yi})"
        # 最优市值
        is_best_zylt = True if zylt_threshold_as_yi[4] <= zyltgb_as_yi <= zylt_threshold_as_yi[5] else False
        if is_special:
            # 具有辨识度,算作最优市值
            zyltgb = zylt_threshold[2] + 1
            zyltgb_as_yi = zylt_threshold_as_yi[2] + 1
        # 是否是最优自由流通市值
        is_best_zylt = True if zylt_threshold[2] <= zyltgb <= zylt_threshold[3] else False
        is_better_zylt = True if zylt_threshold_as_yi[2] <= zyltgb_as_yi <= zylt_threshold_as_yi[3] else False
        if is_in_strong_time_30 and is_best_zylt and can_buy_result[0]:
            # 强势30分钟,最优市值, 有可以下单的板块,不看量
            return True, False, can_buy_result[2]
        if HighIncreaseCodeManager().is_in(code):
            if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < 0.8:
@@ -1051,7 +1061,7 @@
                if not is_best_zylt:
                    # 如果没有辨识度才不买
                    if not is_special:
                        return False, True, f"强势10分钟,无辨识度, 独苗({can_buy_result[4]})不下单({can_buy_result[4]})自由流通市值({zyltgb})不是最优"
                        return False, True, f"强势10分钟,无辨识度, 独苗({can_buy_result[4]})不下单({can_buy_result[4]})自由流通市值({zyltgb_as_yi})不是特优市值"
                if k_format and (k_format[1][0] or k_format[3][0]):
                    msg_list.append("股价创新高或者逼近前高")
                    # 股价创新高或者逼近前高
@@ -1063,7 +1073,7 @@
                        return False, True, f"强势10分钟,无辨识度,独苗({can_buy_result[4]}),当日量比({cls.volume_rate_info[code][0]})小于{volume_rate_thresholds[0]}"
            else:
                msg_list.append("非独苗")
                if not is_best_zylt:
                if not is_better_zylt:
                    msg_list.append("不满足自由流通")
                    if k_format and (k_format[1][0] or k_format[3][0]):
                        # 股价创新高或者逼近前高
@@ -1100,10 +1110,10 @@
            # 非强势10分钟只买主线
            if not can_buy_result[0] and can_buy_result[1]:
                if not is_special and not is_best_zylt:
                    return False, True, f"非强势10分钟,无辨识度,非最优自由流通市值,独苗({can_buy_result[4]})不下单"
                    return False, True, f"非强势10分钟,无辨识度,非特优市值,独苗({can_buy_result[4]})不下单"
            if can_buy_result[3]:
                # 强势主线
                if not is_best_zylt:
                if not is_better_zylt:
                    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] < volume_rate_thresholds[1]:
@@ -1118,7 +1128,7 @@
                            return False, True, f"非强势10分钟,强势主线后排,满足自由市值,股价创新高或者逼近前高, 当日量比({cls.volume_rate_info[code][0]})小于{volume_rate_thresholds[0]}"
            else:
                # 非强势主线
                if not is_best_zylt:
                if not is_better_zylt:
                    if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < volume_rate_thresholds[
                        1] and not is_special:
                        return False, True, f"非强势10分钟,非强势主线后排【主线后排】,不满足自由市值,无辨识度, 当日量比({cls.volume_rate_info[code][0]})小于{volume_rate_thresholds[1]}"
third_data/code_plate_key_manager.py
@@ -587,11 +587,11 @@
            #     return True, False, f"【{block}】具有辨识度", is_strong_block
            # 看自由流通市值是否小于20亿
            if is_strong_block and current_shsz_rank < len(current_open_limit_up_codes) + max_rank + 1:
                zyltgb = global_util.zyltgb_map.get(code)
                zyltgb_as_yi = round(global_util.zyltgb_map.get(code) / 100000000, 2) if code in global_util.zyltgb_map else None
                situation = MarketSituationManager().get_situation_cache()
                zylt_threshold = buy_condition_util.get_zyltgb_threshold(situation)
                if zyltgb and zylt_threshold[2] <= zyltgb <= zylt_threshold[3]:
                    return True, False, f"【{block}】强势板块 自由流通市值({zyltgb})大于{zylt_threshold[2]//100000000}亿 小于{zylt_threshold[3]//100000000}亿", is_strong_block
                zylt_threshold_as_yi = buy_condition_util.get_zyltgb_threshold(situation)
                if zyltgb_as_yi and zylt_threshold_as_yi[2] <= zyltgb_as_yi <= zylt_threshold_as_yi[3]:
                    return True, False, f"【{block}】强势板块 自由流通市值({zyltgb_as_yi})大于{zylt_threshold_as_yi[2]}亿 小于{zylt_threshold_as_yi[3]}亿", is_strong_block
            return False, False, f"【{block}】前排代码:{front_current_shsz_rank_codes} 超过{len(current_open_limit_up_codes) + max_rank}个", is_strong_block
        # 过时的代码
utils/buy_condition_util.py
@@ -7,14 +7,14 @@
# 获取自由流通市值的阈值范围
# (最小流通,最大流通,优秀开始,优秀结束,最优开始,最优结束)
def get_zyltgb_threshold(market_sitation: int):
    if market_sitation == MarketSituationManager.SITUATION_GOOD:
        return 8.9 * 100000000, 100 * 100000000, 8.9 * 100000000, 50 * 100000000
    return 8.9 * 100000000, 31 * 100000000, 8.9 * 100000000, 25 * 100000000
        return 8.9, 100, 8.9, 50, 8.9, 19
    return 8.9, 31, 8.9, 25, 8.9, 19
# 获取量比的等级获取量
def get_volume_rate_by_level(level: int):
    volume_rates = [0, 0.19, 0.49, 0.89]
    return volume_rates[level]