TradingAgents/tradingagents/graph
Michael Msebenzi 176b24be86
feat: add pre-trade market state verification to risk management
Add a Market Gate node between the risk debate and Portfolio Manager
that verifies the target exchange is open before trade execution.

- New `market_gate.py` with `check_market_state()` and `create_market_gate()`
- Calls Headless Oracle /v5/demo (free, no API key required)
- Fail-closed: network errors default to UNKNOWN (blocked)
- Ticker suffix → MIC mapping for 22 global exchanges
- Injects [MARKET GATE] advisory into risk debate history
- Optional via `use_market_gate` config flag (default: True)
- 12 new tests covering MIC resolution, HTTP mocking, and node behavior
- Zero new dependencies (stdlib urllib only)

Resolves #514

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 13:58:43 +00:00
..
__init__.py chore(release): v0.1.0 – initial public release of TradingAgents 2025-06-05 04:27:57 -07:00
conditional_logic.py refactor: standardize portfolio manager, five-tier rating scale, fix analyst status tracking 2026-03-22 23:30:29 +00:00
propagation.py fix: initialize all debate state fields in propagation.py 2026-03-15 17:54:32 +00:00
reflection.py refactor: remove stale imports, use configurable results path (#499) 2026-04-04 07:35:35 +00:00
setup.py feat: add pre-trade market state verification to risk management 2026-04-07 13:58:43 +00:00
signal_processing.py refactor: remove stale imports, use configurable results path (#499) 2026-04-04 07:35:35 +00:00
trading_graph.py feat: add pre-trade market state verification to risk management 2026-04-07 13:58:43 +00:00