| | |
| | | import time |
| | | import dask |
| | | import constant |
| | | from log_module import async_log_util |
| | | |
| | | from log_module.log import logger_common, logger_kpl_jingxuan_in, logger_debug, logger_kpl_market_sift_plate |
| | | from log_module.log import logger_common, logger_kpl_jingxuan_in, logger_debug, logger_kpl_market_sift_plate, \ |
| | | logger_kpl_limit_up, logger_kpl_code_plates |
| | | from strategy import kpl_api, data_cache, basic_methods |
| | | from strategy.kpl_data_manager import KPLMarketStockHeatLogManager |
| | | from utils import tool, hx_qc_value_util |
| | |
| | | return log_data |
| | | # 定义一个时间段,在这个时间段内才会执行下面的代码,主要就是把强度数据作为日志打印存储下来。 |
| | | now_time = tool.get_now_time_str() |
| | | if '11:30:10' < now_time < '12:59:50': |
| | | return |
| | | data = (kpl_api.getMarketJingXuanRealRankingInfo()) |
| | | market_sift_plate = json.loads(data) |
| | | # print(f"market_sift_plate 数 ======{len(market_sift_plate['list'])}") |
| | |
| | | # 设定当前时间点 |
| | | now_time = tool.get_now_time_str() |
| | | # print(f"now_time===={now_time}") |
| | | if data_cache.SERVER_RESTART_TIME < now_time < data_cache.UPDATE_DATA_TIME: |
| | | if data_cache.OPEN_BIDDING_TIME < now_time < data_cache.CLOSING_TIME: |
| | | # print(f"在时间内使用--------------------------") |
| | | # 获取涨停信息列表 |
| | | limit_up_info = kpl_api.get_limit_up_info() |
| | |
| | | # most_common_element, most_common_count = counter.most_common(1)[0] |
| | | # # 打印出现次数最多的元素 |
| | | # print(f"主线概念:{most_common_element},出现了 {most_common_count} 次") |
| | | async_log_util.info(logger_kpl_limit_up, f"{limit_up_info}") |
| | | |
| | | return limit_up_block_names |
| | | |
| | | |
| | |
| | | # 写入文件 |
| | | with open(constant.ALL_STOCKS_PLATE_PATH, 'w', encoding='utf-8') as f: |
| | | f.write(json_data) |
| | | # 记录到日志 |
| | | async_log_util.info(logger_kpl_code_plates, json_data) |
| | | now_time = datetime.datetime.now() # 获取本机时间 |
| | | logger_common.info(f"写入所有个股板块文件完成!::{now_time}") |
| | | |