diff --git a/tradingagents/graph/portfolio_analysis.py b/tradingagents/graph/portfolio_analysis.py index 6409258b..12325e3c 100644 --- a/tradingagents/graph/portfolio_analysis.py +++ b/tradingagents/graph/portfolio_analysis.py @@ -181,12 +181,12 @@ class PortfolioAnalyzer: directory.mkdir(parents=True, exist_ok=True) log_data = { - "trade_date": str(trade_date), + "trade_date": trade_date, "tickers": tickers, "individual_results": individual_results, "portfolio_summary": portfolio_summary, } - log_file = directory / f"portfolio_analysis_{re.sub(r'[^\w.-]', '_', str(trade_date))}.json" + log_file = directory / f"portfolio_analysis_{re.sub(r'[^\w.-]', '_', trade_date)}.json" with log_file.open("w", encoding="utf-8") as f: json.dump(log_data, f, indent=4)