| | |
| | | """ |
| | | import datetime |
| | | |
| | | import constant |
| | | import juejin |
| | | import tool |
| | | from third_data import kpl_util, kpl_data_manager |
| | |
| | | for data in limit_up_datas: |
| | | if data[0] == code: |
| | | block = data[5] |
| | | if block in kpl_data_manager.INVALID_BLOCKS and filter: |
| | | if block in constant.KPL_INVALID_BLOCKS and filter: |
| | | continue |
| | | blocks.append(block) |
| | | return blocks |
| | |
| | | return blocks |
| | | |
| | | |
| | | def get_target_block(code, filter=False): |
| | | def get_target_block_info(code, filter=False): |
| | | latest_datas = __kplDataManager.get_data(kpl_util.KPLDataType.LIMIT_UP) |
| | | blocks = __get_blocks(code, latest_datas, filter) |
| | | if not blocks: |
| | |
| | | target_block = None |
| | | if blocks: |
| | | for block in blocks: |
| | | if block in kpl_data_manager.INVALID_BLOCKS and filter: |
| | | if block in constant.KPL_INVALID_BLOCKS and filter: |
| | | continue |
| | | target_block = block |
| | | break |
| | |
| | | target_block = None |
| | | if blocks: |
| | | for block in blocks: |
| | | if block in kpl_data_manager.INVALID_BLOCKS: |
| | | if block in constant.KPL_INVALID_BLOCKS: |
| | | continue |
| | | target_block = block |
| | | break |
| | |
| | | # 是否出现过高位板 |
| | | high_block_infos = [] |
| | | for block in blocks: |
| | | if block in kpl_data_manager.INVALID_BLOCKS: |
| | | if block in constant.KPL_INVALID_BLOCKS: |
| | | continue |
| | | if latest_datas: |
| | | has_high, high_code_info = __is_has_high_code(block, latest_datas) |
| | |
| | | re_limit_codes = set() |
| | | # 炸板: |
| | | # (代码,名称,涨幅,板块,实际流通) |
| | | for data in open_limit_up_datas: |
| | | blocks = set(data[3].split("、")) |
| | | if target_block not in blocks: |
| | | continue |
| | | code_ = data[0] |
| | | break_codes.add(code_) |
| | | if open_limit_up_datas: |
| | | for data in open_limit_up_datas: |
| | | blocks = set(data[3].split("、")) |
| | | if target_block not in blocks: |
| | | continue |
| | | code_ = data[0] |
| | | break_codes.add(code_) |
| | | # 统计回封 |
| | | for data in latest_datas: |
| | | if data[5] != target_block: |