| | |
| | | # 是否具有辨识度 |
| | | p9 = is_special(record_datas) |
| | | p10 = is_latest_10d_max_volume_at_latest_2d(record_datas) |
| | | p11 = __is_yesterday_open_limit_up(record_datas) |
| | | # 最近5天是否跌停/炸板 |
| | | p11 = __is_latest_open_limit_up_or_limit_down(record_datas, 5) |
| | | # 30天内是否有涨停 |
| | | p12 = __has_limit_up(record_datas, 30) |
| | | |
| | |
| | | return True |
| | | else: |
| | | return False |
| | | |
| | | |
| | | # 暂时不使用 |
| | | # 从最近一次涨停开始,是否涨幅过高 |
| | | def is_up_too_high_from_latest_limit_up(record_datas): |
| | | datas = copy.deepcopy(record_datas) |
| | | datas.sort(key=lambda x: x["bob"]) |
| | | datas = datas[-20:] |
| | | datas.reverse() |
| | | today_limit_up_price = round(float(gpcode_manager.get_limit_up_price_by_preprice(datas[0]["close"])), 2) |
| | | max_price = 0 |
| | | limit_up_price = None |
| | | for i in range(0, len(datas)): |
| | | item = datas[i] |
| | | if item['high'] > max_price: |
| | | max_price = item['high'] |
| | | if __is_limited_up(item): |
| | | limit_up_price = item['high'] |
| | | break |
| | | if not limit_up_price: |
| | | return False |
| | | if today_limit_up_price < max_price: |
| | | return False |
| | | if (today_limit_up_price - limit_up_price) / limit_up_price > 0.25: |
| | | return True |
| | | return False |
| | | |
| | | |
| | | # 最近几天是否有最大量 |
| | |
| | | return False, '' |
| | | |
| | | |
| | | # 昨天是否炸板 |
| | | def __is_yesterday_open_limit_up(datas): |
| | | # 最近几天是否有炸板或跌停 |
| | | def __is_latest_open_limit_up_or_limit_down(datas, day_count): |
| | | 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 |
| | | items = datas[0 - day_count:] |
| | | for item in items: |
| | | 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 |
| | | # 是否有跌停 |
| | | limit_down_price = float(gpcode_manager.get_limit_down_price_by_preprice(item["pre_close"])) |
| | | if abs(limit_down_price - item["close"]) < 0.001: |
| | | # 跌停 |
| | | return True |
| | | return False |
| | | |
| | | |