TDX Financial Data Interface
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_quotesmethod inscripts/quotes_client.py. Input a stock code like600519to get real-time price, volume, etc., returned as a Markdown table. - Historical K-line Data: Via the
get_klinemethod, supports multiple time periods (e.g., daily, minute lines) using thefrequencyparameter, wherefrequency=9indicates daily data. Data returns as a DataFrame with time index for analysis. - Financial Data Parsing: Calls
scripts/financial_parser.pyto 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...exceptblocks 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
mootdxconfig 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.
Related Skills
Systematically identify and evaluate the economic moats of listed companies using the Tang Shu Fang investment methodology for long-term investment analysis.
A skill that converts natural language questions into A-stock data queries and returns verifiable structured analysis conclusions, covering multi-dimensional analysis of market trends, fundamentals, and news.
An AI financial copilot by Wind, integrating financial databases and multimodal analysis to provide end-to-end support across investment research, asset allocation, risk control, quant, and report generation.
Searches for latest policies and generates GB/T 9704-2020 compliant official documents (requests or reports) in Word and PDF formats.