mootdx-china-stock-data
Fetch China A-share stock market data (bars, realtime quotes, tick-by-tick transactions) via mootdx/TDX protocol. Use when working with Chinese stock data, mootdx library, TDX quotes, intraday minute bars, transaction history, or real-time A-share market data.
Why use this skill?
Fetch real-time and historical China A-share market data including K-lines and tick data using the TDX protocol via the mootdx library for OpenClaw.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/wangdinglu/a-share-real-time-dataWhat This Skill Does
The mootdx-china-stock-data skill provides a robust interface for interacting with the TDX (TongDaXin) protocol to fetch China A-share market data. It enables OpenClaw agents to programmatically retrieve historical K-line bars, real-time quotes, and tick-by-tick transaction history for stocks listed on the Shanghai and Shenzhen exchanges. By wrapping the mootdx library, this skill abstracts the complexities of the TDX socket protocol and includes critical patches for timezone management and trading-hour restrictions, ensuring reliable data access for financial analysis.
Installation
To integrate this skill, use the following command in your terminal:
clawhub install openclaw/skills/skills/wangdinglu/a-share-real-time-data
This will install the necessary mootdx dependencies, including tdxpy. Ensure your environment has basic internet access to connect to TDX data servers. Before primary usage, run scripts/setup_and_verify.py --demo to ensure network connectivity and authentication are correctly configured.
Use Cases
- Automated Research: Generate automated technical analysis reports by fetching historical daily or minute-level K-lines.
- Intraday Monitoring: Build real-time trackers for volatility or volume spikes using tick-by-tick data.
- Portfolio Auditing: Fetch current market quotes for a list of stocks to verify holding values against live market prices.
- Quantitative Strategy Backtesting: Retrieve historical bars for a specific security to feed into price-action prediction models.
Example Prompts
- "Fetch the daily K-line data for 600300.SH for the past 30 days and calculate the 20-day moving average."
- "What are the latest tick-by-tick transactions for 000001.SZ during the morning session today?"
- "Can you check if 300750.SZ is currently trading and provide the latest real-time quote?"
Tips & Limitations
- Stock Codes: Always strip the exchange suffix (e.g., use '000001' instead of '000001.SZ').
- Market Coverage: Note that this skill does not support Beijing Stock Exchange (BSE) listings; ensure your target list is filtered accordingly.
- Trading Holidays: Use a calendar service to verify dates, as queries for non-trading days will yield empty datasets.
- Timezone Patching: The skill automatically applies a monkey-patch to
tdxpy.hq.time_frameto bypass strict time-of-day checks, allowing you to debug or pull data outside standard Beijing market hours if necessary.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-wangdinglu-a-share-real-time-data": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: network-access, code-execution