| | |
| | | datas = copy.deepcopy(record_datas) |
| | | datas.sort(key=lambda x: x["bob"]) |
| | | datas = datas[0 - day_count:] |
| | | min_price = None |
| | | max_price = None |
| | | min_price_info = None |
| | | max_price_info = None |
| | | for d in datas: |
| | | if min_price is None: |
| | | min_price = d["low"] |
| | | if max_price is None: |
| | | max_price = d["high"] |
| | | if min_price > d["low"]: |
| | | min_price = d["low"] |
| | | if max_price < d["high"]: |
| | | max_price = d["high"] |
| | | if min_price_info is None: |
| | | min_price_info = d["low"], d |
| | | if max_price_info is None: |
| | | max_price_info = d["high"], d |
| | | if min_price_info[0] > d["low"]: |
| | | min_price_info = d["low"], d |
| | | if max_price_info[0] < d["high"]: |
| | | max_price_info = d["high"], d |
| | | # if max_price > float(limit_up_price): |
| | | # return False |
| | | rate = (float(limit_up_price) - min_price) / min_price |
| | | # print(rate) |
| | | if rate >= 0.319: |
| | | return True |
| | | return False |
| | | rate = (float(limit_up_price) - min_price_info[1]["close"]) / min_price_info[1]["close"] |
| | | print(rate) |
| | | if rate >= 0.28: |
| | | return True, rate |
| | | return False, rate |
| | | |
| | | |
| | | # 连续涨停后是否回调不足够 |
| | |
| | | for x in max_limit_up_continue_count_info_list: |
| | | if max_limit_up_info is None: |
| | | max_limit_up_info = x |
| | | if max_limit_up_info[0] <= x[0]: |
| | | if max_limit_up_info[0] <= x[0]: |
| | | max_limit_up_info = x |
| | | |
| | | if not max_limit_up_info or max_limit_up_info[0] < 3: |
| | |
| | | if item["high"] > max_price_info[0]: |
| | | max_price_info = [item["high"], i] |
| | | # 计算回踩价格 |
| | | lowest_price_threhhold = round((1-0.28) * max_price_info[0], 2) |
| | | lowest_price_threhhold = round((1 - 0.28) * max_price_info[0], 2) |
| | | for i in range(max_price_info[1] + 1, len(datas)): |
| | | item = datas[i] |
| | | if item["low"] < lowest_price_threhhold: |