From ef54e22b293741354a9de3050e69816c33975c10 Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期三, 03 一月 2024 18:00:03 +0800 Subject: [PATCH] 取消测试 --- utils/init_data_util.py | 42 +++++++++++++++++------------------------- 1 files changed, 17 insertions(+), 25 deletions(-) diff --git a/utils/init_data_util.py b/utils/init_data_util.py index 53977c9..3cd570e 100644 --- a/utils/init_data_util.py +++ b/utils/init_data_util.py @@ -47,7 +47,8 @@ break if latest_limit_up_index is not None: # 绐佺牬鍓嶉珮鎴栬�呮帴杩戝墠楂橈紝30涓氦鏄撴棩鍐呮湁娑ㄥ仠 - if latest_limit_up_index > 0 and datas[latest_limit_up_index - 1]["volume"] > datas[latest_limit_up_index]["volume"]: + if latest_limit_up_index > 0 and datas[latest_limit_up_index - 1]["volume"] > datas[latest_limit_up_index][ + "volume"]: return datas[latest_limit_up_index - 1]["volume"], datas[latest_limit_up_index - 1]["volume"], \ datas[latest_limit_up_index - 1]['bob'].strftime("%Y-%m-%d") else: @@ -73,7 +74,8 @@ max_volume_date = item['bob'] # 鏄惁鏈夋定鍋� limit_up_price = float(gpcode_manager.get_limit_up_price_by_preprice(item["pre_close"])) - if abs(limit_up_price - item["high"]) < 0.01: + # 涓嶇湅瓒呰繃60澶╃殑娑ㄥ仠 + if abs(limit_up_price - item["high"]) < 0.01 and i <= 59: # 娑ㄥ仠 next_volume = 0 if i > 0: @@ -84,27 +86,17 @@ date = datas[i - 1]["bob"] target_volume = (volume, date) break + + # 90涓氦鏄撴棩鏃犳定鍋滐紝鍙栨渶杩�30澶╁唴鐨勬渶楂橀噺浣滀负鍙傝�冮噺 if not target_volume: - target_volume = (max_volume, max_volume_date) - - # --鍒ゆ柇杩�60澶╂棤娑ㄥ仠鐨勬渶澶ч噺 - max_60_volume_info = [0, None] - # 60澶╁唴鏄惁鏈夋定鍋� - has_60_limit_up = False - for i in range(60): - if i >= len(datas): - break - item = datas[i] - volume = item["volume"] - if max_60_volume_info[0] < volume: - max_60_volume_info = [volume, item["bob"]] - limit_up_price = float(gpcode_manager.get_limit_up_price_by_preprice(item["pre_close"])) - if abs(limit_up_price - item["high"]) < 0.01: - has_60_limit_up = True - break - - if not has_60_limit_up and target_volume[0] > max_60_volume_info[0] * 3: - # 60澶╁唴鏃犳定鍋�,涓�60澶╁唴鏈�澶ч噺灏忎簬鏈�澶ч噺鐨�1/3,鍒ゆ柇涓哄湴閲�,杩斿洖杩�60涓氦鏄撴棩鐨勬渶澶ч噺 - return max_60_volume_info[0], max_60_volume_info[0], max_60_volume_info[1].strftime("%Y-%m-%d") - else: - return target_volume[0], target_volume[0], target_volume[1].strftime("%Y-%m-%d") + # --鍒ゆ柇杩�30澶╂棤娑ㄥ仠鐨勬渶澶ч噺 + max_30_volume_info = [0, None] + for i in range(30): + if i >= len(datas): + break + item = datas[i] + volume = item["volume"] + if max_30_volume_info[0] < volume: + max_30_volume_info = [volume, item["bob"]] + target_volume = max_30_volume_info + return target_volume[0], target_volume[0], target_volume[1].strftime("%Y-%m-%d") -- Gitblit v1.8.0