ST

shinnytech/tqsdk-python

API development

This page was translated automatically. Technical details may differ from the original. View the original

5.1K stars Quality 73 Trend 50Apache-2.0

Tianqin Quantitative Development Package, futures quantification, real-time market data/historical data/live trading

Overview

TqSdk is an open-source Python library initiated by Xinyi Technology and contributed its main code. TqSdk supports users in building various types of quantitative trading strategy programs with very little code, and provides a complete solution covering futures, options, and stocks, including historical data, real-time data, development and debugging, strategy backtesting, demo trading, live trading, operation monitoring, and risk management. * The market data gateway provides real-time market data and historical data * The trading relay gateway connects to the futures company's trading system * Both gateways provide services to the lower level using the Diff protocol * TqSdk connects to the market and trading relay gateways according to the Diff protocol to implement market and trading functions * , provides all currently tradable contracts from listing *** to support simultaneous trading with multiple live and demo accounts, as well as asset management counters such as Zhongqi, Ronghang, Jieyisi, and high-speed counters like Yida and CTPMINI ***, supports complex strategy backtesting ***, market data and trading data are all stored in the in-memory database, no access delay *, convenient data analysis *, no forced framework structure, supports strategies of arbitrary complexity, uses multiple K-line / real-time quotes for multiple products and trades multiple instruments within a single trading strategy program If you want your AI, Agent, or OpenClaw to better understand and use TqSdk, you can directly copy the following content to it: Please first download and extract the TqSdk skill pack: https://doc.shinnytech.com/tqsdk/latest/ai_editor/skills/tqsdk-trading-and-data.zip,然后先阅读其中的 SKILL.md, and follow the instructions inside to answer any TqSdk questions or write any TqSdk code. * Use TqSdk with AI tools * Learn efficiently and use TqSdk in Trae * Learn and use TqSdk efficiently in CodeBuddy * Collaboratively develop TqSdk projects with Codex * TqSdk Skills compressed package and usage instructions * Download TqSdk Skills pack tqsdk-trading-and-data.zip TqSdk only supports Python 3.9 and above. To install TqSdk, you can use pip: Read the HTML version of the document online: https://doc.shinnytech.com/tqsdk/latest

Overview (machine translated)

TqSdk is an open-source Python library initiated by Xinyi Technology, with its main code contributor. TqSdk supports users in building various types of quantitative trading strategy programs with very little code, It also offers a complete solution covering futures, options, and stocks, including historical data, real-time data, development and debugging, strategy backtesting, simulated trading, live trading, operational monitoring, and risk management.

Get Started Quickly

To quickly learn how to use TqSdk, please visit our ten-minute quick start guide.

System Architecture

  • The market data gateway provides real-time market and historical data
  • The trading relay gateway is responsible for connecting to the futures company’s trading system
  • Both gateways uniformly provide services to the following via the Diff protocol
  • TqSdk connects to market data gateways and trade relay gateways according to the Diff protocol, enabling market and trading functions

Main Features

The features provided by TqSdk support a wide range of policy programs, from simple to complex:

  • Company-level data operations, providing all tick and candlestick data for all currently tradable contracts from listing

  • Multi-account support, allowing simultaneous trading with multiple live and demo accounts

  • Supports live trading by 90% of futures companies in the market

  • Supports stock, options, and futures trading

  • Supports CTP direct trading, as well as asset management counters such as Zhongqi, Ronghang, and Jieyisi, as well as high-speed counters like Yida and CTPMINI

  • Supports demo trading

  • Supports Tick-level and K-line level backtesting, as well as backtesting for complex strategies

  • Provides nearly a hundred technical indicator functions and source codes

  • Users do not need to build or maintain a database; market quotes and trading data are all stored in the in-memory database, with no access delay

  • Optimized support for pandas and numpy libraries for convenient data analysis

  • Flexible strategy writing method, no mandatory framework structure, supports strategies of arbitrary complexity, and allows you to use multiple K-line charts/real-time quotes for multiple products and trade multiple instruments within a single trading strategy program

  • Together with Tianqin AI Assistant, it provides support such as function explanations, strategy writing guidance, and error analysis

Using TqSdk with AI/Agent

It’s recommended to first hand over the official Skills to your AI coding tool, then describe your requirements. You can directly copy the following content to it:

Please first download and extract the official TqSdk skill pack: https://doc.shinnytech.com/tqsdk/latest/ai_editor/skills/tqsdk-trading-and-data.zip Read the SKILL.md first, then read the instructions in references/ according to the task. If you need to run code locally, first check the project’s Python environment and TqSdk; If not installed, install it in the environment according to the project dependency requirements, verify importability before continuing, and do not automatically upgrade to existing versions.

The skill pack needs to be fully extracted; It will not automatically install software or connect accounts. Installation and operation require AI tools with local execution capabilities.

Related documents and resources:

  • Use TqSdk through AI tools
  • Learn and use TqSdk efficiently in Trae
  • Learn and use TqSdk efficiently in WorkBuddy

This page was translated automatically. Technical details may differ from the original.

Recommended Tools

Try a different keyword or remove a filter.

Install

npx skillfish add shinnytech/tqsdk-python
New to MCP? Start with the mcpskill.org guide →