mirror of
https://github.com/TauricResearch/TradingAgents.git
synced 2026-09-19 11:15:24 +03:00
fix(dataflows): map Shanghai .SH tickers to Yahoo's .SS (#1260)
- normalize_symbol maps 600519.SH to 600519.SS - the alpha benchmark is resolved from the normalized symbol
This commit is contained in:
@@ -598,6 +598,8 @@ class TestDeferredReflection:
|
||||
"benchmark_map": DEFAULT_CONFIG["benchmark_map"]}
|
||||
assert TradingAgentsGraph._resolve_benchmark(mock_graph, "600519.SS") == "000001.SS"
|
||||
assert TradingAgentsGraph._resolve_benchmark(mock_graph, "000001.SZ") == "399001.SZ"
|
||||
# .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_us_ticker_defaults_to_spy(self):
|
||||
"""US tickers (no dotted suffix) take the empty-suffix entry."""
|
||||
|
||||
@@ -69,6 +69,10 @@ class TestNormalizeSymbol(unittest.TestCase):
|
||||
def test_hk_code_case_insensitive_suffix(self):
|
||||
self.assertEqual(normalize_symbol("09992.hk"), "9992.HK")
|
||||
|
||||
def test_shanghai_sh_suffix_maps_to_yahoo_ss(self):
|
||||
self.assertEqual(normalize_symbol("600519.sh"), "600519.SS")
|
||||
self.assertEqual(normalize_symbol("600519.SS"), "600519.SS")
|
||||
|
||||
|
||||
@pytest.mark.unit
|
||||
class TestNoMarketDataError(unittest.TestCase):
|
||||
|
||||
Reference in New Issue
Block a user