本文へ移動
cccskills
無料GitHub で公開

mootdx

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.

インストール方法を見る

含まれるファイル(1)

  • SKILL.md4.7 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

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.

Mootdx pins httpx<0.26 in setup.py, but only uses basic httpx.Client/get APIs that are forward-compatible. The second pip install restores 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:

CodeBar
81m
05m
115m
230m
31H
41D
51W
61M

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.

Key Methods

MethodUseReturns
get_k_data(code, start_date, end_date)Daily OHLCV with date range[open, close, high, low, vol, amount, date, code]
bars(symbol, frequency, offset=800)Intraday / weekly / monthly[open, close, high, low, vol, amount, datetime, volume, ...]
minute(symbol)Current trading day 1m barsSame schema as bars()
quotes(symbol)Real-time L1 snapshot{price, bid, ask, volume, ...}
stocks(market)List all tickers on an exchangeDataFrame of code/name
F10(symbol) / finance(symbol)Fundamentals snapshotHeterogeneous dict

Symbol Format

  • Pure 6-digit: "000001", "600519", "835174" — mootdx auto-detects exchange from prefix:
    • 60x / 68x → SH
    • 00x / 30x / 002 / 003 → SZ
    • 4x / 8x → BJ
  • The built-in loader also accepts "000001.SZ", "600519.SH", "835174.BJ" and strips the suffix.

Column Names

get_k_data() returns lowercase English: open / close / high / low / vol / amount / date / code. The built-in loader renames vol → volume to match the project's OHLCV contract.

bars() returns the same OHLC columns plus a duplicate volume (alongside the legacy vol), a datetime string column, and decomposed year / month / day / hour / minute columns.

Built-in Loader

backtest/loaders/mootdx_loader.py is registered as the mootdx source. Fallback chain for a_share is [tushare, mootdx, akshare] — tushare wins when a token is present; mootdx wins when no token but TCP egress works; akshare is the broadest fallback.

from backtest.runner import run
result = run(strategy=..., source="mootdx")  # explicit override

Known Limitations

LimitationWorkaround
北交所 (BJ): get_k_data raises KeyError, bars() returns empty (upstream missing data)Loader logs a warning and skips BJ symbols — use akshare or tushare
Extended market (futures/options) returns empty as of v0.11.7 (upstream issue)Use tushare/akshare for futures
Each bars() page is 800 rows; loader paginates back up to 25 pages (≈10y daily / ≈5y 1H / ≈3mo 1m)For longer 1m history use tushare minute bars
Server selection has cold-start latency (first call picks the fastest server)First call may be ~2s slower
Returns data in 前复权 by default — no API parameter for 不复权Use tushare/akshare if raw prices are required

Reference Docs

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

ADR/H-share/A-share cross-listing premium analysis — track pricing gaps between US-listed ADRs, HK-listed H-shares, and A-shares for arbitrage signals, dual-listing valuation, and delisting risk assessment.

日本語の概要は準備中です。原文の説明を表示しています。

HKUDS/Vibe-Trading3.5万2026年10月12日 更新

akshare

無料

AKShare financial data aggregator (18k+ stars). Free, no API key. Covers A-shares, US, HK, futures, macro, forex. Primary fallback for tushare and yfinance.

日本語の概要は準備中です。原文の説明を表示しています。

HKUDS/Vibe-Trading3.5万2026年10月12日 更新

alpha-zoo

無料

Browse and bench the bundled alpha zoos — prebuilt cross-sectional factor libraries (Kakushadze 101, GTJA 191, Qlib 158, Fama-French / Carhart). Use when the user asks "which alphas exist", wants metadata on a named alpha, or wants to run IC/IR on a whole zoo over a universe.

日本語の概要は準備中です。原文の説明を表示しています。

HKUDS/Vibe-Trading3.5万2026年10月12日 更新

A 股 ST/*ST 风险预测框架 — 基于最新中报/三季报或业绩预告/快报,预测下一财年是否会因营收、利润、净资产、分红不达标而被风险警示,并将新浪监管处罚记录作为独立证据面纳入风险等级。仅适用于 A 股,不预测财务造假。

日本語の概要は準備中です。原文の説明を表示しています。

HKUDS/Vibe-Trading3.5万2026年10月12日 更新

Asset allocation theory and optimizer usage — MPT / Black-Litterman / risk budgeting / all-weather strategy, including guides for 5 optimizers and rebalancing rules.

日本語の概要は準備中です。原文の説明を表示しています。

HKUDS/Vibe-Trading3.5万2026年10月12日 更新

Diagnose failed or underperforming backtests, locate the root cause, and fix the issue

日本語の概要は準備中です。原文の説明を表示しています。

HKUDS/Vibe-Trading3.5万2026年10月12日 更新

HKUDS のスキルをすべて見る

このスキルの問題を報告する