From c58c2d16db12419a0f27cd5df38f3468e6bb14c0 Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期二, 16 七月 2024 09:15:59 +0800 Subject: [PATCH] 设置买独苗 --- utils/init_data_util.py | 15 ++++++++------- 1 files changed, 8 insertions(+), 7 deletions(-) diff --git a/utils/init_data_util.py b/utils/init_data_util.py index 7a4008b..6bc0635 100644 --- a/utils/init_data_util.py +++ b/utils/init_data_util.py @@ -29,8 +29,8 @@ return datas -def parse_max_volume(datas, is_new_or_near_top=False): - result = __parse_max_volume(datas, is_new_or_near_top) +def parse_max_volume(code, datas, is_new_or_near_top=False): + result = __parse_max_volume(code, datas, is_new_or_near_top) refer_index = result[3] # 璁$畻鏈�浣庝环 refer_price = datas[refer_index]["high"] @@ -54,11 +54,12 @@ if datas[refer_index - 1]["volume"] > datas[refer_index]["volume"]: refer_index -= 1 - return datas[refer_index]["volume"], datas[refer_index]["volume"], datas[refer_index]['bob'].strftime("%Y-%m-%d"), refer_index + return datas[refer_index]["volume"], datas[refer_index]["volume"], datas[refer_index]['bob'].strftime( + "%Y-%m-%d"), refer_index # 杩斿洖锛�(60澶╂渶澶ч噺,鏄ㄦ棩閲�,閲忓弬鑰冩棩鏈�,鍙傝�冮噺鎹粖浜ゆ槗鏃ユ暟) -def __parse_max_volume(datas, is_new_or_near_top=False): +def __parse_max_volume(code, datas, is_new_or_near_top=False): max_volume = 0 max_volume_date = None max_volume_index = None @@ -70,7 +71,7 @@ if i >= len(datas): break item = datas[i] - limit_up_price = float(gpcode_manager.get_limit_up_price_by_preprice(item["pre_close"])) + 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: latest_limit_up_index = i break @@ -104,9 +105,9 @@ max_volume = volume max_volume_date = item['bob'] # 鏄惁鏈夋定鍋� - limit_up_price = float(gpcode_manager.get_limit_up_price_by_preprice(item["pre_close"])) + limit_up_price = float(gpcode_manager.get_limit_up_price_by_preprice(code, item["pre_close"])) # 涓嶇湅瓒呰繃60澶╃殑娑ㄥ仠 - if abs(limit_up_price - item["high"]) < 0.01 and i <= 59: + if abs(limit_up_price - item["high"]) < 0.001 and i <= 59: # 娑ㄥ仠 next_volume = 0 if i > 0: -- Gitblit v1.8.0