| | |
| | | import json |
| | | import logging |
| | | import os |
| | | |
| | | import constant |
| | | # 引入掘金API |
| | | import utils.juejin_api |
| | | # from logging_config import get_logger |
| | |
| | | |
| | | # 读取已经获取到并存储在本地的目标范围的个股的板块概念 |
| | | # 读取JSON文件并解析为字典 |
| | | with open('D:/量化低吸/low_suction_hx/strategy/local_storage_data/all_stocks_plate_dict.json', 'r', |
| | | encoding='utf-8') as f: |
| | | json_data = f.read() |
| | | stocks_plate_path = f"{constant.get_path_prefix()}/local_storage_data/all_stocks_plate_dict.json" |
| | | if os.path.exists(stocks_plate_path): |
| | | with open(stocks_plate_path, 'r', |
| | | encoding='utf-8') as f: |
| | | json_data = f.read() |
| | | else: |
| | | json_data = "{}" |
| | | all_stocks_plate_dict = json.loads(json_data) |
| | | logger.info(f"all_stocks_plate_dict的数量={len(all_stocks_plate_dict)}") |
| | | |