admin
2025-02-21 ca454884c413afe2f35a41e6a98d4252dd5e4347
bug修改
2个文件已修改
35 ■■■■■ 已修改文件
main.py 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
strategy/instant_time_market.py 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
main.py
@@ -132,7 +132,10 @@
            :return:
            """
            data_cache.latest_code_market_info_dict = {x[0]: x for x in datas}
            instant_time_market.get_current_info()
            if constant.is_windows():
                instant_time_market.get_current_info()
            else:
                instant_time_market.set_current_info(datas)
    # 启动异步日志
strategy/instant_time_market.py
@@ -351,5 +351,35 @@
def set_current_info(current_infos):
    logging.info(f"set_current_info进入")
    try:
        now_start = time.time()
        now_time = datetime.datetime.now().strftime("%H:%M:%S")
        if len(current_infos) == 0 and now_time > data_cache.L1_data_start_time:
            print(f"9:15后 l1数据为空=l1_data_current_infos===={current_infos}")
        # for i in current_infos:
        #     if i[0] == '000001':
        #         print(f"i===={i}")
        get_all_stocks_current_open(current_infos)
        get_all_stocks_current_high_and_low(current_infos)
        for current_info in current_infos:
            try:
                if current_info is not None:
                    strategic_thread_manager(current_info)
            except Exception as error:
                logging.exception(error)
                # print("异常:", current_info)
        now_end: float = time.time()
        start_to_end = now_end - now_start
        print(f"运行中=={round(start_to_end, 2)} 秒")
        # logger.info(f"运行中=={round(start_to_end, 2)}秒")
    except Exception as error:
        logging.exception(error)
    finally:
        pass
# 仅仅用于测试数据进入策略后的数据情况
# get_current_info()