AI Agent Hub
Back to skills
TDX Financial Data Interface icon

TDX Financial Data Interface

Professional Updated 2026.08.30

Paste the following prompt into your AI chat to install this skill:

Please install @user_d84187c5/tdx according to the official guide at https://skillhub.cn/install/skillhub.md.

About this skill

Addressing Pain Points in Financial Data Acquisition

In quantitative trading and financial analysis, real-time data access is fundamental but challenging. Traditional TDX clients provide data manually, which is inefficient for automation. Specific problems include: how to efficiently fetch real-time quotes for A-shares, indices, and futures? How to query historical K-line data for backtesting? How to parse financial statements for fundamental analysis? And how to read local data for offline analysis? This skill offers a programmatic solution via the TDX data interface, enabling developers to easily obtain and process financial data.

How the Skill Works

The skill encapsulates Python scripts to call the TDX data interface for data tasks. Its core capabilities are divided into four parts:

  • Real-time Quote Snapshots: Uses the get_quotes method in scripts/quotes_client.py. Input a stock code like 600519 to get real-time price, volume, etc., returned as a Markdown table.
  • Historical K-line Data: Via the get_kline method, supports multiple time periods (e.g., daily, minute lines) using the frequency parameter, where frequency=9 indicates daily data. Data returns as a DataFrame with time index for analysis.
  • Financial Data Parsing: Calls scripts/financial_parser.py to fetch balance sheets, income statements, etc., automatically extracting key metrics for financial analysis.
  • Local Data Reading: Through scripts/offline_reader.py, reads TDX client local storage for daily or minute line data, suitable for offline or no-network scenarios.

Key steps include:
1. The agent parses natural language requests to extract stock codes and parameters.
2. Calls the respective scripts for data fetching, with internal exception handling and retries.
3. Converts returned data into Markdown tables or JSON for readability and integration.

Scope of Application and Considerations

This skill is designed for scenarios requiring financial data via the TDX interface, but note the following boundaries and limitations:

  • Data Source Dependency: All data comes from TDX servers or local files. Data quality depends on the TDX interface; the skill performs format validation, but original accuracy must be verified.
  • Exception Handling: Network requests include try...except blocks with up to 3 retries using exponential backoff. On connection timeout, manually updating the server list is recommended.
  • Resource Management: Automatically calls client.close() after use to release connections and prevent leaks. Ensure proper resource cleanup after each request.
  • Server Configuration: The skill auto-selects the fastest server on initialization; if failed, it falls back to default or requires manual updates to the mootdx config file.
  • Data Format: Returned data is a Pandas DataFrame with time as index, supporting quantitative analysis, but be mindful of data range and pagination.

In summary, this skill automates financial data acquisition for A-shares, indices, and futures, but users must consider network stability, data source limitations, and exception scenarios.

Use Cases

  • A quantitative trading team needs to programmatically fetch real-time A-share quote data for live monitoring and signal triggers when building trading strategies.
  • A financial researcher needs to batch-fetch daily K-line historical data for specified stocks to perform technical indicator calculations and backtest verification when analyzing market trends.
  • An investment advisor needs to parse financial statement data of listed companies to assess fundamentals and financial health when developing asset allocation plans for clients.
  • A data engineer needs to read offline-stored minute line data from the local TDX client for data integration and backup when building an internal data platform.

Best For

  • Quantitative Strategy Developer: Needs to automate fetching real-time and historical market data for strategy model training, backtesting, and live trade execution.
  • Financial Market Analyst: Regularly needs to obtain stock quotes and financial data for writing industry research reports or conducting in-depth company analysis.
  • Investment Advisor or Financial Planner: Needs to quickly query real-time quotes and parse financial statements to provide investment advice or financial diagnostic services to clients.
  • Data Platform Engineer: Responsible for integrating external financial data sources into an enterprise data warehouse, requiring batch data reading from TDX interfaces or local files.