From aacc6148dd43a9cffbff9a23a273a55b64bf3d8c Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期六, 12 十月 2024 17:21:42 +0800 Subject: [PATCH] bug修复 --- utils/init_data_util.py | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/utils/init_data_util.py b/utils/init_data_util.py index 6bc0635..b02b719 100644 --- a/utils/init_data_util.py +++ b/utils/init_data_util.py @@ -2,6 +2,7 @@ import decimal from code_attribute import gpcode_manager +from log_module.log import logger_debug from third_data.history_k_data_util import HistoryKDatasUtils from utils import tool @@ -12,6 +13,7 @@ def re_set_price_pres(codes, force=False): + # 閫氳繃鍘嗗彶鏁版嵁缂撳瓨鑾峰彇 result = HistoryKDatasUtils.get_gp_latest_info(codes) for item in result: symbol = item['symbol'] @@ -20,16 +22,19 @@ gpcode_manager.CodePrePriceManager.set_price_pre(symbol, pre_close, force) + # 鑾峰彇杩�90澶╃殑鏈�澶ч噺涓庢渶杩戠殑閲� # 鑾峰彇鏈�杩戜竴娆℃定鍋�/娑ㄥ仠涓嬩竴涓氦鏄撴棩鐨勬渶澶у�� -def get_volumns_by_code(code, count=60) -> object: +def get_volumns_by_code(code, count=60): datas = HistoryKDatasUtils.get_history_tick_n(code, count, "open,high,low,close,volume,pre_close,bob,amount") + if not datas: + return None # 璁$畻 datas.sort(key=lambda x: x["bob"], reverse=True) return datas -def parse_max_volume(code, datas, is_new_or_near_top=False): +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] # 璁$畻鏈�浣庝环 -- Gitblit v1.8.0