easy_tdx  by handsomejustin

Python SDK for millisecond-level financial market data and quantitative analysis

Created 1 month ago
454 stars

Top 65.6% on SourcePulse

GitHubView on GitHub
Project Summary

This project provides a free, open-source Python SDK designed to democratize access to high-frequency financial market data and advanced analytical tools, previously exclusive to institutional investors. It targets retail traders, quantitative researchers, and AI developers, offering millisecond-level data for A-shares, Hong Kong, US stocks, and futures, along with integrated technical analysis and backtesting capabilities. The primary benefit is leveling the playing field by providing ordinary users with powerful data access and analytical tools at no cost.

How It Works

The SDK connects directly to TDX servers for real-time and historical data, achieving millisecond-level latency. It offers data access via a Python API, a command-line interface (CLI), and a RESTful Web API. Key features include over 34 built-in technical indicators, automated Chanlun analysis (identifying patterns like segments, centers, and divergence), and a comprehensive backtesting engine. It also supports reading data directly from local TDX .day files for offline analysis.

Quick Start & Requirements

  • Installation: pip install easy-tdx
  • Development Install: pip install -e ".[dev]" or pip install -e ".[web]" for web API support.
  • Prerequisites: Python. Access to TDX data servers or a local TDX installation for offline data.
  • Setup Time: Approximately 30 seconds for installation.
  • Documentation: Detailed usage instructions are available on the GitHub Wiki.

Highlighted Details

  • Millisecond-level access to A-share, HK, US stock, and futures market data.
  • Integrated calculation of 34+ technical indicators (e.g., MACD, KDJ, RSI, BOLL).
  • Automated Chanlun analysis pipeline: K-line consolidation, fractal identification, segments, centers, buy/sell points, and divergence detection.
  • Built-in vector backtesting engine supporting 16 classic strategies, multi-factor combinations, and strategy ranking.
  • Multiple interfaces: Python API, CLI, and a RESTful Web API (with WebSocket support) for seamless integration, particularly with AI agents.
  • Offline data capabilities via direct reading of local TDX .day files.
  • Advanced quantitative features including a factor engine, factor analysis, and portfolio management tools.

Maintenance & Community

Information regarding specific maintainers, community channels (like Discord or Slack), or active development beyond the README content is not detailed.

Licensing & Compatibility

The project is released under the MIT License, permitting free use, modification, and distribution, making it suitable for both academic research and commercial applications without significant restrictions.

Limitations & Caveats

The project explicitly warns that backtesting results are historical and do not guarantee future performance, being subject to survivor bias and overfitting. Actual trading requires consideration of factors like slippage, liquidity, and exchange-imposed trading halts. The tool is designed for data access and analysis, not as a guaranteed profit-making mechanism. Offline data access requires a local TDX installation.

Health Check
Last Commit

1 day ago

Responsiveness

Inactive

Pull Requests (30d)
2
Issues (30d)
9
Star History
380 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.