| | |
| | | @param code_rate_dict: 涨幅百分数 |
| | | @return: |
| | | """ |
| | | if self.__watch_block_high_codes: |
| | | forbidden_blocks = set() |
| | | for b in self.__watch_block_high_codes: |
| | | total_rate = 0 |
| | | for code in self.__watch_block_high_codes[b]: |
| | | if code in code_rate_dict: |
| | | total_rate += code_rate_dict.get(code) |
| | | average_rate = total_rate / len(self.__watch_block_high_codes[b]) |
| | | if average_rate < 1: |
| | | forbidden_blocks.add(b) |
| | | self.__kpl_forbidden_plates_cache = forbidden_blocks |
| | | try: |
| | | if self.__watch_block_high_codes: |
| | | forbidden_blocks = set() |
| | | for b in self.__watch_block_high_codes: |
| | | total_rate = 0 |
| | | for code in self.__watch_block_high_codes[b]: |
| | | if code in code_rate_dict: |
| | | total_rate += code_rate_dict.get(code) |
| | | average_rate = total_rate / len(self.__watch_block_high_codes[b]) |
| | | if average_rate < 1: |
| | | forbidden_blocks.add(b) |
| | | self.__kpl_forbidden_plates_cache = forbidden_blocks |
| | | async_log_util.info(logger_debug, f"拉黑板块:{forbidden_blocks}") |
| | | except Exception as e: |
| | | logger_debug.exception(e) |
| | | |
| | | |
| | | class LimitUpCodesPlateKeyManager: |