refactor: remove stale imports, use configurable results path (#499)

This commit is contained in:
Yijia-Xiao
2026-04-04 07:35:35 +00:00
parent bdc5fc62d3
commit bdb9c29d44
16 changed files with 15 additions and 49 deletions
+4 -7
View File
@@ -259,15 +259,12 @@ class TradingAgentsGraph:
}
# Save to file
directory = Path(f"eval_results/{self.ticker}/TradingAgentsStrategy_logs/")
directory = Path(self.config["results_dir"]) / self.ticker / "TradingAgentsStrategy_logs"
directory.mkdir(parents=True, exist_ok=True)
with open(
f"eval_results/{self.ticker}/TradingAgentsStrategy_logs/full_states_log_{trade_date}.json",
"w",
encoding="utf-8",
) as f:
json.dump(self.log_states_dict, f, indent=4)
log_path = directory / f"full_states_log_{trade_date}.json"
with open(log_path, "w", encoding="utf-8") as f:
json.dump(self.log_states_dict[str(trade_date)], f, indent=4)
def reflect_and_remember(self, returns_losses):
"""Reflect on decisions and update memory based on returns."""