mirror of
https://github.com/TauricResearch/TradingAgents.git
synced 2026-06-16 21:06:15 +03:00
feat(markets): add China A-share benchmarks and document non-US tickers
A-shares already resolve through the Yahoo Finance vendor (Shanghai .SS, Shenzhen .SZ) with correct identity and indicators; add the SSE/SZSE composite benchmarks so their alpha isn't measured against SPY, and document the exchange-suffix tickers we support (incl. A-shares, crypto).
This commit is contained in:
12
README.md
12
README.md
@@ -171,6 +171,18 @@ python -m cli.main # alternative: run directly from source
|
||||
```
|
||||
You will see a screen where you can select your desired tickers, analysis date, LLM provider, research depth, and more.
|
||||
|
||||
### Markets and tickers
|
||||
|
||||
TradingAgents works with any market Yahoo Finance covers, using the exchange-suffixed ticker. Company identity and the alpha benchmark resolve automatically per market.
|
||||
|
||||
- US: `AAPL`, `SPY`
|
||||
- Hong Kong: `0700.HK` · Tokyo: `7203.T` · London: `AZN.L`
|
||||
- India: `RELIANCE.NS`, `.BO` · Canada: `.TO` · Australia: `.AX`
|
||||
- China A-shares: Shanghai `.SS`, Shenzhen `.SZ` (e.g. `600519.SS` for Kweichow Moutai)
|
||||
- Crypto: `BTC-USD`, `ETH-USD`
|
||||
|
||||
Yahoo Finance may be rate-limited or blocked from some mainland-China networks. For China-native data sources, community forks such as [tradingagent_a](https://github.com/michaelyuancb/tradingagent_a) (AKShare-based) target that environment specifically.
|
||||
|
||||
<p align="center">
|
||||
<img src="assets/cli/cli_init.png" width="100%" style="display: inline-block; margin: 0 2%;">
|
||||
</p>
|
||||
|
||||
@@ -563,6 +563,16 @@ class TestDeferredReflection:
|
||||
assert TradingAgentsGraph._resolve_benchmark(mock_graph, "RELIANCE.NS") == "^NSEI"
|
||||
assert TradingAgentsGraph._resolve_benchmark(mock_graph, "AZN.L") == "^FTSE"
|
||||
|
||||
def test_resolve_benchmark_china_a_shares(self):
|
||||
"""A-share tickers route to their exchange composite (uses the real
|
||||
default benchmark_map, since A-share support relies on it)."""
|
||||
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, "600519.SS") == "000001.SS"
|
||||
assert TradingAgentsGraph._resolve_benchmark(mock_graph, "000001.SZ") == "399001.SZ"
|
||||
|
||||
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)
|
||||
|
||||
@@ -116,13 +116,15 @@ DEFAULT_CONFIG = _apply_env_overrides({
|
||||
# while non-US tickers get their regional index automatically.
|
||||
"benchmark_ticker": None,
|
||||
"benchmark_map": {
|
||||
".NS": "^NSEI", # NSE India (Nifty 50)
|
||||
".BO": "^BSESN", # BSE India (Sensex)
|
||||
".T": "^N225", # Tokyo (Nikkei 225)
|
||||
".HK": "^HSI", # Hong Kong (Hang Seng)
|
||||
".L": "^FTSE", # London (FTSE 100)
|
||||
".TO": "^GSPTSE", # Toronto (TSX Composite)
|
||||
".AX": "^AXJO", # Australia (ASX 200)
|
||||
"": "SPY", # default for US-listed tickers (no suffix)
|
||||
".NS": "^NSEI", # NSE India (Nifty 50)
|
||||
".BO": "^BSESN", # BSE India (Sensex)
|
||||
".T": "^N225", # Tokyo (Nikkei 225)
|
||||
".HK": "^HSI", # Hong Kong (Hang Seng)
|
||||
".L": "^FTSE", # London (FTSE 100)
|
||||
".TO": "^GSPTSE", # Toronto (TSX Composite)
|
||||
".AX": "^AXJO", # Australia (ASX 200)
|
||||
".SS": "000001.SS", # Shanghai (SSE Composite)
|
||||
".SZ": "399001.SZ", # Shenzhen (SZSE Component)
|
||||
"": "SPY", # default for US-listed tickers (no suffix)
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user