| | |
| | | |
| | | @classmethod |
| | | def get_history_index(cls, code, block, yesterday_limit_up_codes, exclude_codes=None, ignore_open_limit_up=True): |
| | | return cls.__get_history_index(code, block, yesterday_limit_up_codes, exclude_codes, ignore_open_limit_up) |
| | | datas = cls.__get_history_index(code, block, yesterday_limit_up_codes, exclude_codes, ignore_open_limit_up) |
| | | return datas[0], datas[1] |
| | | |
| | | @classmethod |
| | | def filter_before_codes(cls, code, block, history_index, |
| | |
| | | break |
| | | else: |
| | | before_codes_info.append(block_codes_infos[i]) |
| | | return history_index, before_codes_info |
| | | return history_index, before_codes_info, limit_up_space_ge_60s_codes |
| | | |
| | | @classmethod |
| | | def __is_radical_buy_with_open_limitup(cls, code, block, yesterday_limit_up_codes): |
| | |
| | | open_limit_up_block_codes = list(open_limit_up_block_codes_dict.get(block)) |
| | | count = len(open_limit_up_block_codes) |
| | | # ----获取历史身位---- |
| | | history_index, history_before_codes_info = cls.__get_history_index(code, block, yesterday_limit_up_codes) |
| | | history_index, history_before_codes_info, limit_up_space_ge_60s_codes = cls.__get_history_index(code, block, |
| | | yesterday_limit_up_codes) |
| | | # ----获取实时身位---- |
| | | current_index, current_before_codes_info = cls.__get_current_index(code, block, yesterday_limit_up_codes, |
| | | limit_up_time=limit_up_timestamp) |
| | |
| | | # 只有一个开1 |
| | | # 获取包含高位板的身位 |
| | | # ----获取历史身位---- |
| | | history_index, history_before_codes_info = cls.__get_history_index(code, block, set()) |
| | | history_index, history_before_codes_info, limit_up_space_ge_60s_codes = cls.__get_history_index(code, block, |
| | | set()) |
| | | # ----获取实时身位---- |
| | | current_index, current_before_codes_info = cls.__get_current_index(code, block, set(), |
| | | limit_up_time=limit_up_timestamp) |
| | |
| | | return False, f"开1数量:{count},历史-{history_index + 1} 实时-{current_index + 1}" |
| | | |
| | | # 获取主板的身位(已经排除了开1的代码) |
| | | history_index, history_before_codes_info = cls.__get_history_index(code, block, |
| | | yesterday_limit_up_codes, |
| | | exclude_codes=exclude_codes) |
| | | history_index, history_before_codes_info, limit_up_space_ge_60s_codes = cls.__get_history_index(code, block, |
| | | yesterday_limit_up_codes, |
| | | exclude_codes=exclude_codes) |
| | | # 过滤不正的原因 |
| | | history_index, history_before_codes_info = cls.__filter_before_codes(code, block, history_index, |
| | | history_before_codes_info, |
| | |
| | | return False, f"距离上个代码涨停已过去{THRESHOLD_MINUTES}分钟({current_before_codes_info[-1]})" |
| | | |
| | | # 包含高位板的整体排序 |
| | | all_history_index, all_history_before_codes_info = cls.__get_history_index(code, block, set(), |
| | | ignore_open_limit_up=False) |
| | | all_history_index, all_history_before_codes_info, limit_up_space_ge_60s_codes = cls.__get_history_index(code, |
| | | block, |
| | | set(), |
| | | ignore_open_limit_up=False) |
| | | |
| | | history_index_first, history_before_codes_info_first = cls.__get_history_index(code, block, |
| | | yesterday_limit_up_codes, |
| | | ignore_open_limit_up=False) |
| | | history_index_first, history_before_codes_info_first, limit_up_space_ge_60s_codes = cls.__get_history_index( |
| | | code, block, |
| | | yesterday_limit_up_codes, |
| | | ignore_open_limit_up=False) |
| | | all_first_history_before_codes = [x[0] for x in history_before_codes_info_first] |
| | | if not constant.TEST: |
| | | # 前两个代码是否有炸板 |
| | |
| | | open_limit_up_code_dict = kpl_data_constant.open_limit_up_code_dict_for_radical_buy |
| | | if open_limit_up_code_dict: |
| | | exclude_codes |= set(open_limit_up_code_dict.keys()) |
| | | origin_history_index, origin_history_before_codes_info = cls.__get_history_index(code, block, |
| | | yesterday_limit_up_codes, |
| | | exclude_codes) |
| | | origin_history_index, origin_history_before_codes_info, limit_up_space_ge_60s_codes = cls.__get_history_index( |
| | | code, block, |
| | | yesterday_limit_up_codes, |
| | | exclude_codes) |
| | | # 过滤不正的原因 |
| | | history_index, history_before_codes_info = cls.__filter_before_codes(code, block, origin_history_index, |
| | | origin_history_before_codes_info, |
| | |
| | | current_index, current_before_codes_info = cls.__get_current_index(code, block, set(), |
| | | limit_up_time=cls.__get_limit_up_timestamp( |
| | | code)) |
| | | history_index, history_before_codes_info = cls.__get_history_index(code, block, set()) |
| | | history_index, history_before_codes_info, limit_up_space_ge_60s_codes = cls.__get_history_index(code, block, |
| | | set()) |
| | | if current_index != history_index: |
| | | return False, f"有其他炸板" |
| | | if current_index >= 1: |
| | |
| | | # 获取板块炸板情况 |
| | | for k in LimitUpDataConstant.history_limit_up_datas: |
| | | _code = k[3] |
| | | if _code not in limit_up_space_ge_60s_codes: |
| | | continue |
| | | blocks = LimitUpCodesBlockRecordManager().get_radical_buy_blocks(_code) |
| | | if not blocks: |
| | | blocks = set() |
| | |
| | | block_codes = BlockSpecialCodesManager().get_block_codes(block) |
| | | if not block_codes or code not in block_codes: |
| | | return False, "无辨识度" |
| | | history_index, history_before_codes_info = cls.__get_history_index(code, block, yesterday_limit_up_codes, |
| | | ignore_open_limit_up=False) |
| | | history_index, history_before_codes_info, limit_up_space_ge_60s_codes = cls.__get_history_index(code, block, |
| | | yesterday_limit_up_codes, |
| | | ignore_open_limit_up=False) |
| | | if history_index > 5: |
| | | return False, f"处于首板老{history_index + 1}" |
| | | |
| | |
| | | datas = response_data["data"] |
| | | if datas: |
| | | BeforeSubDealBigOrderManager().set_big_deal_order_list(code_, datas, |
| | | gpcode_manager.get_limit_up_price_as_num(code_)) |
| | | gpcode_manager.get_limit_up_price_as_num(code_)) |
| | | |
| | | |
| | | if __name__ == '__main__': |