Administrator
2023-07-31 045319f511af9f0b58ba7b9f57f5ed7effb95b6d
bug修复
1个文件已修改
21 ■■■■■ 已修改文件
code_attribute/code_nature_analyse.py 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
code_attribute/code_nature_analyse.py
@@ -15,8 +15,8 @@
class CodeNatureRecordManager:
    __redisManager = RedisManager(0)
    __k_format_cache={}
    __nature_cache={}
    __k_format_cache = {}
    __nature_cache = {}
    @classmethod
    def __get_redis(cls):
@@ -36,12 +36,15 @@
    @classmethod
    def get_k_format_cache(cls, code):
        val = None
        if code in cls.__k_format_cache:
            return cls.__k_format_cache[code]
        val = cls.get_k_format(code)
        if val:
            cls.__k_format_cache[code] = val
        return val
            val = cls.__k_format_cache[code]
        if not val:
            val = cls.get_k_format(code)
            if val:
                cls.__k_format_cache[code] = val
        # 复制
        return copy.deepcopy(val) if val else None
    # 保存股性
    @classmethod
@@ -63,7 +66,6 @@
        if val:
            cls.__nature_cache[code] = val
        return val
# 设置历史K线
@@ -100,7 +102,8 @@
# 是否具有K线形态
def is_has_k_format(limit_up_price, record_datas):
    is_too_high, is_new_top, is_lowest, is_near_new_top, is_n, is_v, has_format, volume_info,is_special = get_k_format(float(limit_up_price),record_datas)
    is_too_high, is_new_top, is_lowest, is_near_new_top, is_n, is_v, has_format, volume_info, is_special = get_k_format(
        float(limit_up_price), record_datas)
    if not has_format:
        return False, "不满足K线形态"
    return True, "有形态"