Administrator
2024-07-03 c02285dc28ac273e38cf80e1ee01d818b32e1355
third_data/history_k_data_manager.py
@@ -17,13 +17,15 @@
    更新历史K线
    @return: 此次更新的数量
    """
    def update(codes_):
        for code in codes_:
            try:
                datas = init_data_util.get_volumns_by_code(code)
                datas = init_data_util.get_volumns_by_code(code, 150)
                HistoryKDataManager().save_history_bars(code, datas[0]['bob'].strftime("%Y-%m-%d"), datas)
            except Exception as e:
                logger_debug.exception(e)
    previous_trading_date = history_k_data_util.JueJinApi.get_previous_trading_date(tool.get_now_date_str())
    if previous_trading_date is None:
        raise Exception("上一个交易日获取失败")
@@ -41,7 +43,6 @@
    threading.Thread(target=lambda: update(codes), daemon=True).start()
    return len(codes)
class HistoryKDataManager: