| | |
| | | # 是否涨停 |
| | | def __is_limit_up(code, data): |
| | | limit_up_price = float(gpcode_manager.get_limit_up_price_by_preprice(code, data["pre_close"])) |
| | | return abs(limit_up_price - data["close"]) < 0.001 |
| | | return abs(limit_up_price - data["close"]) < 0.009 |
| | | |
| | | |
| | | # 是否涨停过 |
| | | def __is_limited_up(code, data): |
| | | limit_up_price = float(gpcode_manager.get_limit_up_price_by_preprice(code, data["pre_close"])) |
| | | return abs(limit_up_price - data["high"]) < 0.001 |
| | | return abs(limit_up_price - data["high"]) < 0.009 |
| | | |
| | | |
| | | # 多少天内是否有涨停/曾涨停 |
| | |
| | | if d < bigger_money: |
| | | continue |
| | | fdatas.append(d) |
| | | if len(fdatas) < 1: |
| | | return False, True, f"09:31:00之前下单,成交大单数量({len(fdatas)})不足1个" |
| | | thresh_count = 3 if tool.is_sh_code(code) else 1 |
| | | if len(fdatas) < thresh_count: |
| | | return False, True, f"09:31:00之前下单,成交大单数量({len(fdatas)})不足{thresh_count}个" |
| | | else: |
| | | # 判断数据是否卡 |
| | | total_datas = local_today_datas.get(code) |
| | |
| | | |
| | | |
| | | if __name__ == "__main__": |
| | | code = "301176" |
| | | code = "301337" |
| | | limit_up_price = 34.56 |
| | | volumes_data = init_data_util.get_volumns_by_code(code, 150) |
| | | print(len(volumes_data)) |
| | | volumes = init_data_util.parse_max_volume(code, volumes_data[:90], |
| | | code_nature_analyse.is_new_top(code, |
| | | limit_up_price, |
| | | volumes_data[ |
| | | :90]) or code_nature_analyse.is_near_top( |
| | | code, |
| | | limit_up_price, |
| | | volumes_data[:90])) |
| | | # 保存K线形态 |
| | | k_format = code_nature_analyse.get_k_format(code, limit_up_price, volumes_data) |
| | | # is_too_high() |
| | | # code = "601022" |
| | | # volumes_data = init_data_util.get_volumns_by_code(code, 150) |
| | |
| | | if not block_codes: |
| | | # 高位板泛化板块中无板块 |
| | | if not high_level_block_codes.get(block): |
| | | return False, True, f"{block}:板块无涨停", False, False |
| | | return False, True, f"【{block}】:板块无涨停", False, False |
| | | elif len(block_codes) == 1 and code in block_codes: |
| | | if not high_level_block_codes.get(block): |
| | | return False, True, f"{block}:板块只有当前代码涨停", False, False |
| | |
| | | if not block_codes: |
| | | # 高位板泛化板块中无板块 |
| | | if not high_level_block_codes.get(block): |
| | | return False, True, f"{block}:板块无涨停", False, False, 0, 0, 0 |
| | | return False, True, f"【{block}】:板块无涨停", False, False, 0, 0, 0 |
| | | elif len(block_codes) == 1 and code in block_codes: |
| | | if not high_level_block_codes.get(block): |
| | | return False, True, f"{block}:板块只有当前代码涨停", False, False, 0, 0, 0 |