| | |
| | | |
| | | |
| | | # 获取K线形态 |
| | | # 返回 (15个交易日涨幅是否大于24.9%,是否破前高,是否超跌,是否接近前高,是否N,是否V,是否有形态,天量大阳信息,是否具有辨识度) |
| | | # 返回 (15个交易日涨幅是否大于24.9%,是否破前高,是否超跌,是否接近前高,是否N,是否V,是否有形态,天量大阳信息,是否具有辨识度,近2天有10天内最大量,上个交易日是否炸板) |
| | | def get_k_format(limit_up_price, record_datas): |
| | | p1_data = get_lowest_price_rate(record_datas) |
| | | p1 = p1_data[0] >= 0.249, p1_data[1] |
| | |
| | | # 是否具有辨识度 |
| | | p9 = is_special(record_datas) |
| | | p10 = is_latest_10d_max_volume_at_latest_2d(record_datas) |
| | | p11 = __is_yesterday_open_limit_up(record_datas) |
| | | |
| | | return p1, p2, p3, p4, p5, p6, p7, p8, p9, p10 |
| | | return p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11 |
| | | |
| | | |
| | | # 是否具有K线形态 |
| | | def is_has_k_format(limit_up_price, record_datas): |
| | | is_too_high, is_new_top, is_lowest, is_near_new_top, is_n, is_v, has_format, volume_info, is_special, has_max_volume = get_k_format( |
| | | is_too_high, is_new_top, is_lowest, is_near_new_top, is_n, is_v, has_format, volume_info, is_special, has_max_volume, open_limit_up = get_k_format( |
| | | float(limit_up_price), record_datas) |
| | | if not has_format: |
| | | return False, "不满足K线形态" |
| | |
| | | return False, '' |
| | | |
| | | |
| | | # 昨天是否炸板 |
| | | def __is_yesterday_open_limit_up(datas): |
| | | datas = copy.deepcopy(datas) |
| | | datas.sort(key=lambda x: x["bob"]) |
| | | item = datas[-1] |
| | | limit_up_price = float(gpcode_manager.get_limit_up_price_by_preprice(item["pre_close"])) |
| | | if abs(limit_up_price - item["high"]) < 0.001 and abs(limit_up_price - item["close"]) > 0.001: |
| | | # 炸板 |
| | | return True |
| | | return False |
| | | |
| | | |
| | | # V字形 |
| | | def __is_v_model(datas): |
| | | datas = copy.deepcopy(datas) |
| | |
| | | k_format = code_nature_analyse.CodeNatureRecordManager().get_k_format_cache(code) |
| | | |
| | | now_timestamp = int(tool.get_now_time_str().replace(":", "")) |
| | | |
| | | # 前一天炸板之后,今日10:00之前才能下单 |
| | | if k_format and len(k_format) >= 11 and k_format[10]: |
| | | if now_timestamp > int("100000"): |
| | | return False, True, f"上个交易日炸板,当日量10点以后不下单" |
| | | |
| | | if can_buy_result[3] and now_timestamp <= int("094000"): |
| | | # 强势主线与强势10分钟不看量 |
| | | pass |
| | |
| | | |
| | | |
| | | if __name__ == "__main__": |
| | | code_str = "600148" |
| | | code_str = "600748" |
| | | codes = code_str.split(",") |
| | | for code in codes: |
| | | if not tool.is_shsz_code(code): |
| | | continue |
| | | try: |
| | | datas = init_data_util.get_volumns_by_code(code, 120) |
| | | datas = datas[0:] |
| | | result = is_too_high(datas) |
| | | result = code_nature_analyse.__is_yesterday_open_limit_up(datas) |
| | | if result: |
| | | print(code, result) |
| | | except: |