mirror of
https://github.com/TauricResearch/TradingAgents.git
synced 2026-09-25 05:52:35 +03:00
feat(config): benchmark B3 tickers against the Ibovespa (#1366)
- .SA maps to ^BVSP
This commit is contained in:
@@ -629,6 +629,14 @@ class TestDeferredReflection:
|
||||
# .SH is the exchange's own suffix; Yahoo spells Shanghai .SS (#1260)
|
||||
assert TradingAgentsGraph._resolve_benchmark(mock_graph, "600519.SH") == "000001.SS"
|
||||
|
||||
def test_resolve_benchmark_brazil(self):
|
||||
"""B3 tickers were measured against SPY."""
|
||||
from tradingagents.default_config import DEFAULT_CONFIG
|
||||
mock_graph = MagicMock(spec=TradingAgentsGraph)
|
||||
mock_graph.config = {"benchmark_ticker": None,
|
||||
"benchmark_map": DEFAULT_CONFIG["benchmark_map"]}
|
||||
assert TradingAgentsGraph._resolve_benchmark(mock_graph, "PETR4.SA") == "^BVSP"
|
||||
|
||||
def test_resolve_benchmark_us_ticker_defaults_to_spy(self):
|
||||
"""US tickers (no dotted suffix) take the empty-suffix entry."""
|
||||
mock_graph = MagicMock(spec=TradingAgentsGraph)
|
||||
|
||||
@@ -168,6 +168,7 @@ DEFAULT_CONFIG = _apply_env_overrides({
|
||||
".AX": "^AXJO", # Australia (ASX 200)
|
||||
".SS": "000001.SS", # Shanghai (SSE Composite)
|
||||
".SZ": "399001.SZ", # Shenzhen (SZSE Component)
|
||||
".SA": "^BVSP", # B3 Brazil (Ibovespa)
|
||||
"": "SPY", # default for US-listed tickers (no suffix)
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user