| | |
| | | from code_attribute import gpcode_manager |
| | | |
| | | # 代码股性记录管理 |
| | | from db import redis_manager |
| | | from db import redis_manager_delegate as redis_manager |
| | | from utils import tool |
| | | from db.redis_manager_delegate import RedisUtils |
| | | from utils.tool import CodeDataCacheUtil |
| | |
| | | # if max_price > float(limit_up_price): |
| | | # return False |
| | | rate = (float(limit_up_price) - min_price_info[1]["close"]) / min_price_info[1]["close"] |
| | | if rate >= 0.319: |
| | | THRESHOLD_RATE = 0.319 * 2 if tool.is_ge_code(code) else 0.319 |
| | | if rate >= THRESHOLD_RATE: |
| | | return True, rate |
| | | return False, rate |
| | | |
| | |
| | | def __is_new_top(code, limit_up_price, datas): |
| | | datas = copy.deepcopy(datas) |
| | | datas.sort(key=lambda x: x["bob"]) |
| | | datas = datas[-80:] |
| | | datas = datas[-60:] |
| | | max_price = 0 |
| | | for data in datas: |
| | | if max_price < data["high"]: |
| | |
| | | items = datas[0 - day_count:] |
| | | for item in items: |
| | | limit_up_price = float(gpcode_manager.get_limit_up_price_by_preprice(code, item["pre_close"])) |
| | | if abs(limit_up_price - item["high"]) < 0.001 and abs(limit_up_price - item["close"]) > 0.001: |
| | | # 炸板 |
| | | limit_down_price = float(gpcode_manager.get_limit_down_price_by_preprice(code, item["pre_close"])) |
| | | if abs(limit_up_price - item["high"]) < 0.001 or abs(limit_down_price - item["close"]) < 0.001: |
| | | # 炸板 # 或涨停 # 或者跌停 |
| | | return True |
| | | return False |
| | | |
| | |
| | | for item in items: |
| | | # 是否有跌停 |
| | | # 获取当日涨幅 |
| | | rate = (item["close"] - item["pre_close"])/item["pre_close"] |
| | | threshold_rate_ = round(0 - ((1 - tool.get_limit_down_rate(code))*0.9), 2) |
| | | rate = (item["close"] - item["pre_close"]) / item["pre_close"] |
| | | threshold_rate_ = round(0 - ((1 - tool.get_limit_down_rate(code)) * 0.9), 2) |
| | | if rate < threshold_rate_: |
| | | return True |
| | | return False |