
Data Routing
- 3 installs
- 29.6k repo stars
- Updated August 4, 2026
- hkuds/vibe-trading
Select the best market data source (tushare, akshare, yfinance, okx, ccxt) by market type via a decision tree before backtesting or fetching data.
About
Provides a decision tree for selecting the best market data source across A-shares, US, HK, crypto, futures, and macro before a backtest or fetch. A developer loads it first to route symbol requests to tushare, akshare, yfinance, okx, or ccxt.
- Decision tree selecting tushare, akshare, yfinance, okx, or ccxt
- Per-market priority and availability checks
Data Routing by the numbers
- 3 all-time installs (skills.sh)
- Ranked #847 of 1,106 Finance & Trading skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/hkuds/vibe-trading --skill data-routingAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 3 |
|---|---|
| repo stars | ★ 29.6k |
| Last updated | August 4, 2026 |
| Repository | hkuds/vibe-trading ↗ |
What it does
Select the best market data source (tushare, akshare, yfinance, okx, ccxt) by market type via a decision tree before backtesting or fetching data.
Files
Data Source Overview
| 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 |
Decision Tree
Backtest Scenario (writing config.json)
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.
Analysis / Research Scenario (writing Python scripts)
1. Identify the market type from the user's request 2. Pick the source by priority:
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
3. Load the corresponding skill for API details: load_skill("akshare")
Availability Check
- tushare: check if
TUSHARE_TOKENenvironment variable exists - yfinance / okx / ccxt / akshare: free but may have network restrictions
- If the user reports "connection timeout" or "cannot access", switch to the same-market fallback
Symbol Format Reference
| 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 |
Fallback Chain (Runner Layer)
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.