Administrator
2024-10-10 32a96952b6fc3429ca03668298e8efbd6a23daa0
bug修复
1个文件已修改
17 ■■■■■ 已修改文件
utils/init_data_util.py 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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
@@ -13,12 +14,16 @@
def re_set_price_pres(codes, force=False):
    # 通过历史数据缓存获取
    result = HistoryKDatasUtils.get_gp_latest_info(codes)
    for item in result:
        symbol = item['symbol']
        symbol = symbol.split(".")[1]
        pre_close = tool.to_price(decimal.Decimal(str(item['pre_close'])))
        gpcode_manager.CodePrePriceManager.set_price_pre(symbol, pre_close, force)
    try:
        result = HistoryKDatasUtils.get_gp_latest_info(codes)
        for item in result:
            symbol = item['symbol']
            symbol = symbol.split(".")[1]
            pre_close = tool.to_price(decimal.Decimal(str(item['pre_close'])))
            gpcode_manager.CodePrePriceManager.set_price_pre(symbol, pre_close, force)
    except Exception as e:
        logger_debug.error(f"get_gp_latest_info异常:{codes}")
        logger_debug.exception(e)
# 获取近90天的最大量与最近的量