feat(config): benchmark B3 tickers against the Ibovespa (#1366)

- .SA maps to ^BVSP
This commit is contained in:
Yijia-Xiao
2026-09-23 19:28:56 +00:00
parent 1f7a2aa865
commit 5c2dded82c
2 changed files with 9 additions and 0 deletions
+8
View File
@@ -629,6 +629,14 @@ class TestDeferredReflection:
# .SH is the exchange's own suffix; Yahoo spells Shanghai .SS (#1260) # .SH is the exchange's own suffix; Yahoo spells Shanghai .SS (#1260)
assert TradingAgentsGraph._resolve_benchmark(mock_graph, "600519.SH") == "000001.SS" 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): def test_resolve_benchmark_us_ticker_defaults_to_spy(self):
"""US tickers (no dotted suffix) take the empty-suffix entry.""" """US tickers (no dotted suffix) take the empty-suffix entry."""
mock_graph = MagicMock(spec=TradingAgentsGraph) mock_graph = MagicMock(spec=TradingAgentsGraph)
+1
View File
@@ -168,6 +168,7 @@ DEFAULT_CONFIG = _apply_env_overrides({
".AX": "^AXJO", # Australia (ASX 200) ".AX": "^AXJO", # Australia (ASX 200)
".SS": "000001.SS", # Shanghai (SSE Composite) ".SS": "000001.SS", # Shanghai (SSE Composite)
".SZ": "399001.SZ", # Shenzhen (SZSE Component) ".SZ": "399001.SZ", # Shenzhen (SZSE Component)
".SA": "^BVSP", # B3 Brazil (Ibovespa)
"": "SPY", # default for US-listed tickers (no suffix) "": "SPY", # default for US-listed tickers (no suffix)
}, },
}) })