Compare commits
2 Commits
2648f91e09
...
ccf375eafd
| Author | SHA1 | Date |
|---|---|---|
|
|
ccf375eafd | |
|
|
138c077cc6 |
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -283,7 +283,6 @@ class TradingAgentsGraph:
|
|||
"""
|
||||
original_ticker = self.ticker
|
||||
original_curr_state = self.curr_state
|
||||
original_log_states = self.log_states_dict.copy()
|
||||
try:
|
||||
return self.portfolio_analyzer.analyze(
|
||||
tickers, trade_date, self.propagate, debug=self.debug
|
||||
|
|
@ -291,7 +290,6 @@ class TradingAgentsGraph:
|
|||
finally:
|
||||
self.ticker = original_ticker
|
||||
self.curr_state = original_curr_state
|
||||
self.log_states_dict = original_log_states
|
||||
|
||||
def reflect_and_remember(self, returns_losses):
|
||||
"""Reflect on decisions and update memory based on returns."""
|
||||
|
|
|
|||
Loading…
Reference in New Issue