Data source selection decision tree. Load this skill BEFORE any backtest or data-fetching task to choose the best available data source.
| Source | Markets | Auth Required | Network | Skill |
|---|---|---|---|---|
| tushare | A-shares, funds, futures, macro | Yes (TUSHARE_TOKEN) | China network | tushare |
| akshare | A-shares, US, HK, futures, macro, forex | No | Unrestricted | akshare |
| yfinance | US stocks, HK stocks, ETFs | No | Needs Yahoo Finance access | yfinance |
| okx | Crypto (OKX exchange) | No | Needs okx.com access | okx-market |
| ccxt | Crypto (100+ exchanges) | No | Needs exchange access | ccxt |
Use source: "auto" — the runner automatically routes by symbol pattern and falls back to alternative sources if the primary one is unavailable.
You do NOT need to specify a concrete data source in config.json unless the user explicitly asks for one.
A-shares: tushare (if TUSHARE_TOKEN is set) > akshare (free fallback) US stocks: yfinance > akshare HK stocks: yfinance > akshare Crypto: okx (single exchange) > ccxt (multi-exchange) Futures: tushare > akshare Macro / economics: akshare > tushare Forex: akshare > yfinance
load_skill("akshare")TUSHARE_TOKEN environment variable exists| Market | Format | Examples |
|---|---|---|
| A-shares | NNNNNN.SZ/SH/BJ | 000001.SZ, 600000.SH |
| US stocks | TICKER.US | AAPL.US, MSFT.US |
| HK stocks | NNN(N).HK | 700.HK, 9988.HK |
| Crypto | SYMBOL-USDT | BTC-USDT, ETH-USDT |
| Futures | XXNNNN.EXCHANGE | CU2406.SHFE |
| Forex | XXX/YYY | USD/CNY, EUR/USD |
The backtest runner implements automatic fallback at the market level:
User requests 000001.SZ (A-share)
-> detect market: a_share
-> try tushare: TUSHARE_TOKEN missing -> skip
-> try akshare: available -> use akshare
-> success (zero config required)
This is transparent to the user — they just see results.