| | |
| | | from db.redis_manager_delegate import RedisUtils |
| | | from third_data import kpl_block_util, kpl_api, kpl_util |
| | | from settings.trade_setting import MarketSituationManager |
| | | from third_data.history_k_data_manager import HistoryKDataManager |
| | | from third_data.history_k_data_util import HistoryKDatasUtils |
| | | from third_data.kpl_data_constant import LimitUpCodesBlockRecordManager, ContainsLimitupCodesBlocksManager |
| | | from third_data.third_blocks_manager import BlockMapManager |
| | |
| | | break |
| | | if not has_continue: |
| | | continue |
| | | |
| | | has_big_deal = False |
| | | # 最近10个交易日的成交额要大于10亿 |
| | | volumes_data = HistoryKDataManager().get_history_bars(code, dates[0]) |
| | | if volumes_data: |
| | | for d in volumes_data[:10]: |
| | | if d["amount"] > 10e8: |
| | | has_big_deal = True |
| | | break |
| | | if not has_big_deal: |
| | | continue |
| | | target_codes.add(code) |
| | | # 代码对应的板块 |
| | | code_blocks = {} |
| | |
| | | def get_watch_high_codes(self): |
| | | return self.__watch_high_codes |
| | | |
| | | def get_watch_high_codes_by_block(self, b): |
| | | return self.__watch_block_high_codes.get(b) |
| | | |
| | | def compute(self, code_rate_dict: dict): |
| | | """ |
| | | 根据比例计算需要拉黑的代码 |
| | |
| | | average_rate = total_rate / len(self.__watch_block_high_codes[b]) |
| | | if average_rate < 1: |
| | | forbidden_blocks.add(b) |
| | | # async_log_util.info(logger_debug, f"板块平均涨幅 {b}-{average_rate}") |
| | | |
| | | self.__kpl_forbidden_plates_cache = forbidden_blocks |
| | | async_log_util.info(logger_debug, f"拉黑板块:{forbidden_blocks}") |
| | | except Exception as e: |