
Mootdx
Mootdx A-share market data via TCP-direct 通达信 servers.
Install
npx skills add HKUDS/Vibe-Trading --skill mootdx -g -a claude-code -y- Repository
- HKUDS/Vibe-Trading37.4k
- Category
- Engineering
- Updated
- 3d ago
- License
- MIT
- Context cost
- Lightabout 1,164 tokens
- Runs scripts
- No, instructions only
What it does
Mootdx A-share market data via TCP-direct 通达信 servers. RETIRED 2026-10, TDX servers stopped answering the client protocol, so this source is out of the automatic fallback chain and kept only for explicit `source="mootdx"` use.
Status (2026-10-08): retired from the default chain. TDX servers stopped answering the client protocol mootdx speaks (upstream: mootdx/mootdx#157), so this source is no longer in the automatic A-share fallback and is excluded from the loader-health canary. The loader stays registered for explicit
source="mootdx"calls in case a future upstream release restores the protocol. For A-share OHLCV prefer tencent / eastmoney / baostock.
Overview
Mootdx talks the native 通达信 (TDX) binary protocol over TCP, bypassing the HTTP scrapers that periodically fail under load (akshare → East Money is the canonical example). Public market data only, no token, no per-IP throttling, no captcha.
- GitHub: https://github.com/mootdx/mootdx
- Legacy SDK installation (not needed for automatic A-share data):
pip install mootdx && pip install 'httpx>=0.28.1'
Mootdx pins
httpx<0.26insetup.py, but only uses basichttpx.Client/getAPIs that are forward-compatible. The secondpip installrestores the modern httpx that the rest of Vibe-Trading (MCP server, fastmcp) needs.
Quick Start
from mootdx.quotes import Quotes
client = Quotes.factory(market="std") # std = 沪/深/京; ext = 期货/期权 (upstream-broken)
# Daily OHLCV with a date range (preferred API).
df = client.get_k_data(code="000001", start_date="2025-01-01", end_date="2025-02-01")
# Intraday, offset-from-latest only, no native date range.
df_15m = client.bars(symbol="600519", frequency=1, offset=800)
Frequency Codes
bars(frequency=N) uses integer codes from mootdx.consts:
| Code | Bar |
|---|---|
| 8 | 1m |
| 0 | 5m |
| 1 | 15m |
| 2 | 30m |
| 3 | 1H |
| 4 | 1D |
| 5 | 1W |
| 6 | 1M |
get_k_data() is daily only but accepts start_date / end_date. For intraday, bars() returns the latest N rows, the built-in loader over-fetches offset=800 then clips to the requested window.
