| | |
| | | # 板块 |
| | | __blocks_dict = {} |
| | | |
| | | __instance = None |
| | | def __new__(cls, *args, **kwargs): |
| | | if not cls.__instance: |
| | | cls.__instance = super(CodesHisReasonAndBlocksManager, cls).__new__(cls, *args, **kwargs) |
| | | |
| | | return cls.__instance |
| | | |
| | | |
| | | def __get_redis(self): |
| | | return self.__redisManager.getRedis() |
| | | |
| | |
| | | except: |
| | | pass |
| | | return set() |
| | | |
| | | def get_history_blocks_cache(self, code): |
| | | """ |
| | | 获取180天的历史涨停原因缓存 |
| | | @param code: |
| | | @return: |
| | | """ |
| | | return self.__history_blocks_dict_cache.get(code) |
| | | |
| | | |
| | | # 目标代码板块关键词管理 |
| | |
| | | if match_blocks_3: |
| | | match_blocks_3 -= constant.KPL_INVALID_BLOCKS |
| | | fblocks |= match_blocks_3 |
| | | |
| | | # 获取开盘啦历史涨停原因 |
| | | kpl_history_blocks = CodesHisReasonAndBlocksManager().get_history_blocks_cache(code) |
| | | if kpl_history_blocks: |
| | | fblocks |= BlockMapManager().filter_blocks(kpl_history_blocks) |
| | | return fblocks, match_blocks |
| | | |
| | | @classmethod |