| | |
| | | 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 |
| | | |
| | |
| | | |
| | | 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天的最大量与最近的量 |