TradingAgents/tradingagents
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
..
agents feat: add pre-trade market state verification to risk management 2026-04-07 13:58:43 +00:00
dataflows fix: add missing pandas import in y_finance.py (#488) 2026-04-04 07:14:10 +00:00
graph feat: add pre-trade market state verification to risk management 2026-04-07 13:58:43 +00:00
llm_clients feat: dynamic OpenRouter model selection with search (#482, #337) 2026-04-04 07:56:44 +00:00
__init__.py fix: set process-level UTF-8 default for cross-platform consistency 2026-03-22 23:42:37 +00:00
default_config.py feat: add pre-trade market state verification to risk management 2026-04-07 13:58:43 +00:00