electkismet/eltdx

通达信A股行情协议 Python 库,MCP,支持快照、分时、逐笔、K 线、集合竞价、特殊指标等接口。适合作为量化数据源,支持其他语言通过HTTP或WebSocket调用

What it solves

eltdx is a high-performance Python API client for accessing TongdaXin (Tdx) quantitative data. It allows users to retrieve A-share market data—including real-time quotes, K-lines, trade details, auction data, and corporate financial information—without needing to implement the complex underlying binary protocols manually.

How it works

The project uses a Rust-driven core to handle the heavy lifting of packet construction, parsing, connection pooling, and heartbeat management for the 7709 and 7615 protocols. This Rust engine is exposed to Python via a native extension, providing a modular API and a set of "Helpers" that simplify complex data retrieval tasks. For non-Python users, it can be deployed as an HTTP/WebSocket gateway using FastAPI.

Who it’s for

It is designed for quantitative researchers, algorithmic traders, and developers focusing on the A-share market who need a reliable, fast, and programmatic way to fetch market data for research and short-term analysis.

Highlights

  • Rust-Powered Performance: Core protocol logic is implemented in Rust for efficiency and stability.
  • Comprehensive Data Coverage: Supports everything from real-time 5-level depth quotes and minute-by-minute ticks to F10 corporate profiles and financial reports.
  • Advanced Helpers: Includes pre-built functions for short-term indicators, stock profiles, and auction data to reduce boilerplate code.
  • Flexible Deployment: Offers a native Python library, an MCP (Model Context Protocol) tool service for AI agents, and a cross-language HTTP/WebSocket gateway.

Related

  • Project
  • Project
  • Project
  • Project