TradingAgents/tradingagents
ahmet guzererler 02cbaecf62
feat: Add macro scanner feedback loop and lessons memory (#124)
* feat: add macro scanner feedback loop and lessons memory

- Implements `LessonStore` to persist JSON screening lessons
- Adds `selection_reflector.py` to fetch performance and news, and generate LLM lessons
- Adds `memory_loader.py` to filter negative lessons into `FinancialSituationMemory`
- Integrates a rejection gate in `candidate_prioritizer.py` based on past negative lessons
- Adds `reflect` command to CLI

Co-authored-by: aguzererler <6199053+aguzererler@users.noreply.github.com>

* feat: update macro scanner feedback loop for dual-lesson output (Trend DNA)

- Update `selection_reflector.py` to calculate exact terminal returns, `mfe_pct`, `mae_pct`, and `days_to_peak`.
- Update LLM prompt to generate distinct `screening_advice` and `exit_advice`.
- Update `lesson_store` tests to reflect new schema.
- Update `memory_loader.py` to use `screening_advice` for negative selection filtering.
- Update `micro_summary_agent.py` to inject `exit_advice` into PM context for current holdings.
- Update `cli/main.py` default horizons to `30,90` and print dual-advice columns.

Co-authored-by: aguzererler <6199053+aguzererler@users.noreply.github.com>

* fix: resolve bugs in macro scanner feedback loop

- Address Key mismatch (stock_return_pct vs terminal_return_pct)
- Fix missing persistence of mfe_pct and mae_pct
- Use create_report_store() instead of raw ReportStore() in load_scan_candidates
- Clean up unused imports in fetch_news_summary
- Ensure default horizons match code in cli description
- Create isolated `_local_safe_pct` to remove cross-module dependency

Co-authored-by: aguzererler <6199053+aguzererler@users.noreply.github.com>

* fix: address PR 124 feedback on macro scanner memory feedback loop

- Use `l.get('screening_advice')` gracefully in `memory_loader` to prevent KeyErrors.
- Properly instantiate `selection_memory` inside the graph in `portfolio_setup.py` and pass it to the prioriziation rejection gate.

Co-authored-by: aguzererler <6199053+aguzererler@users.noreply.github.com>

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: aguzererler <6199053+aguzererler@users.noreply.github.com>
2026-03-26 23:44:44 +01:00
..
agents feat: PM brain upgrade — macro/micro agents & memory split (#123) 2026-03-26 12:55:24 +01:00
dataflows Bolt: Optimize string building in yfinance_scanner.py (#114) 2026-03-26 09:33:06 +01:00
graph feat: Add macro scanner feedback loop and lessons memory (#124) 2026-03-26 23:44:44 +01:00
llm_clients merge: sync with upstream TauricResearch/TradingAgents v0.2.2 2026-03-23 12:17:25 +00:00
memory feat: PM brain upgrade — macro/micro agents & memory split (#123) 2026-03-26 12:55:24 +01:00
pipeline feat: include portfolio holdings in auto mode pipeline analysis (#104) 2026-03-24 18:35:53 +01:00
portfolio feat: Add macro scanner feedback loop and lessons memory (#124) 2026-03-26 23:44:44 +01:00
__init__.py fix: set process-level UTF-8 default for cross-platform consistency 2026-03-22 23:42:37 +00:00
api_usage.py Address code review: add debug logging for unknown method resolution 2026-03-21 17:27:38 +00:00
daily_digest.py feat: daily digest consolidation and Google NotebookLM sync (#23) 2026-03-19 12:21:03 +01:00
default_config.py feat: configurable max_auto_tickers + run persistence with phase-level node re-run (#109) 2026-03-25 15:27:28 +01:00
notebook_sync.py merge: resolve conflicts with origin/main (PR #85 merged) 2026-03-22 06:52:39 +00:00
observability.py Remove unused import `field` from `observability.py` (#120) 2026-03-26 11:17:58 +01:00
report_paths.py feat: load flow_id in FE to resume runs and fix max_tickers cap (#113) 2026-03-26 07:10:42 +01:00