Token导航 LogoToken导航TokenDH.com
效率需要联网clawhub未标认证来源可访问clear审计提醒

free-a-share-real-time-data免费共享实时数据

Agent Skill

用于辅助数据整理、表格处理、CSV/Excel 分析、指标计算和图表准备。它适合让 Agent 清洗字段、汇总数据、发现异常、生成统计口径或把分析结果转成可读说明。使用时需要确认数据来源、字段含义和时间范围,避免把样本数据当全量事实;涉及敏感数据、导出文件或批量写回时,应先确认权限和脱敏边界。

总安装

35,144

周安装

1,408

GitHub Stars

1

下载量

11,377
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:free-a-share-real-time-data(免费共享实时数据)
来源仓库:https://github.com/wangdinglu/free-a-share-real-time-data
安装命令:
openclaw skills install free-a-share-real-time-data
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install free-a-share-real-time-data

简介

通过mootdx/TDX协议获取中国A股市场数据(柱状图、实时报价、逐笔交易)。在处理中国股票数据、mootdx 库、TDX 报价、日内分钟柱线、交易历史或实时 A 股市场数据时使用。

SKILL.md

name
mootdx-china-stock-data
description
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.

Mootdx China A-Share Stock Data Client

A wrapper around the mootdx library (TDX protocol) for fetching China A-share market data including K-line bars, real-time quotes, and tick-by-tick transaction records.

Installation

pip install mootdx
mootdx depends on tdxpy internally. Both are installed together.

Verify & Demo

python scripts/setup_and_verify.py           # Install + verify + connectivity test
python scripts/setup_and_verify.py --check   # Verify only (skip install)
python scripts/setup_and_verify.py --demo    # Full API demo with real output

The --demo mode exercises every major API and prints real data — useful as a runnable reference for correct calling patterns.

Critical: Time & Timezone Considerations

Trading Hours (Beijing Time, UTC+8)

SessionTime
Morning09:30 - 11:30 (120 min)
Lunch break11:30 - 13:00
Afternoon13:00 - 15:00 (120 min)
Total240 trading minutes/day

Trading Time Bypass Patch

Problem: mootdx / tdxpy has a built-in time_frame() check that blocks API calls outside trading hours. On servers with non-Beijing timezone, this breaks even during valid trading hours.

Solution: Monkey-patch tdxpy.hq.time_frame to always return True:

import tdxpy.hq
tdxpy.hq.time_frame = lambda: True

This patch is applied automatically during MootdxClient.__init__(). Without it, transactions() and transaction() calls will silently return empty results outside detected trading hours.

Trading Calendar

When querying historical data, always check if a date is a trading day. Non-trading days (weekends, holidays) have no data. The client uses TradingCalendarStrategy.is_trading_day(date_str) for this — you must have a trading calendar service available.

Date/Time Parameter Formats

ParameterFormatExample
dateYYYYMMDD"20250210"
timeHH:MM:SS or HH:MM"10:30:00" or "10:30"

Stock Code Format

mootdx uses pure numeric codes (TDX format). Convert from standard format:

Standard FormatTDX FormatMarket
000001.SZ000001Shenzhen
600300.SH600300Shanghai
300750.SZ300750Shenzhen (ChiNext)
688001.SH688001Shanghai (STAR)

Conversion: Strip the .SH / .SZ / .BJ suffix.

Important: mootdx does NOT support Beijing Stock Exchange (.BJ) stocks. Filter them out before calling.

API Reference

1. Initialize Client

from mootdx.quotes import Quotes
client = Quotes.factory(market='std')

2. get_bars() — K-Line / Candlestick Data

Fetch historical or real-time K-line bars.

await client.get_bars(
    stock_code="000001.SZ",   # Standard format (auto-converted)
    frequency=7,               # K-line period (see table below)
    offset=240,                # Number of bars to fetch
    date="20250210",           # Optional: specific date (YYYYMMDD)
    time="10:30:00",           # Optional: specific time (HH:MM:SS)
    filter_by_time=True        # Filter to closest bar matching time
)

Frequency codes:

CodePeriod
71-minute bars
81-minute bars (alternative)
4Daily bars
9Daily bars (alternative)

Return format (list of dicts):

{
    "stock_code": "000001.SZ",
    "datetime": "2025-02-10 10:30:00",
    "open": 12.50,
    "high": 12.65,
    "low": 12.45,
    "close": 12.60,
    "vol": 150000.0,
    "amount": 1890000.0
}

Start position calculation: For historical dates, the start parameter is calculated as the number of trading minutes (for 1-min bars) or trading days (for daily bars) between now and the target datetime. This accounts for:

  • Whether today is a trading day
  • Current trading session status (pre-market / in-session / post-market)
  • Lunch break gap (11:30-13:00)

3. get_realtime_quote() — Single Stock Real-Time Quote

await client.get_realtime_quote(stock_code="000001.SZ")

Returns (dict): Price, OHLC, volume, amount, and full Level-2 order book (5-level bid/ask):

{
    "stock_code": "000001.SZ",
    "price": 12.60,
    "last_close": 12.50,
    "open": 12.45, "high": 12.65, "low": 12.40,
    "volume": 5000000, "amount": 63000000,
    "bid1": 12.59, "bid2": 12.58, ..., "bid5": 12.55,
    "ask1": 12.60, "ask2": 12.61, ..., "ask5": 12.65,
    "bid_vol1": 500, ..., "ask_vol5": 300,
    "pct_chg": 0.8
}

4. get_realtime_quotes() — Batch Real-Time Quotes

Native batch interface — much faster than looping get_realtime_quote().

await client.get_realtime_quotes(["000001.SZ", "600300.SH", "300750.SZ"])

Returns (list of dicts):

{
    "stock_code": "000001.SZ",
    "trade_date": "2025-02-10",
    "open": 12.45, "high": 12.65, "low": 12.40, "close": 12.60,
    "pre_close": 12.50,
    "change": 0.15,
    "pct_chg": 1.2048,
    "vol": 5000000.0,
    "amount": 63000000.0,
    "is_realtime": true
}
pct_chg is calculated from today's open price, not previous close.

5. get_batch_bars() — Batch K-Line Data

Parallel fetch K-line bars for multiple stocks with concurrency control.

await client.get_batch_bars(
    stock_codes=["000001.SZ", "600300.SH"],
    date="20250210",
    time="10:30:00",
    max_concurrent=10
)

Returns: Dict[str, List[Dict]]{stock_code: [bar_data, ...]}

6. get_transactions_history() — Historical Tick Data

Tick-by-tick transaction records for a specific historical date.

await client.get_transactions_history(
    stock_code="000001.SZ",
    date="20250210",         # Required: YYYYMMDD
    start=0,
    offset=1000
)

Returns (list of dicts):

{
    "stock_code": "000001.SZ",
    "time": "09:30:05",
    "price": 12.50,
    "vol": 100,
    "buyorsell": 0,          # 0=buy, 1=sell, 2=neutral
    "num": 5,                # Number of trades in this tick
    "volume": 100
}

7. get_transactions_realtime() — Real-Time Tick Data

Today's live tick-by-tick transaction stream.

await client.get_transactions_realtime(
    stock_code="000001.SZ",
    start=0,
    offset=1000
)

Same return format as get_transactions_history().

8. get_transactions_with_fallback() — Tick Data with Fallback

Tries real-time first, falls back to today's historical data if empty.

await client.get_transactions_with_fallback(
    stock_code="000001.SZ",
    start=0, offset=1000,
    use_history_fallback=True
)

Raw mootdx API (Low-Level)

If using mootdx directly without the wrapper:

from mootdx.quotes import Quotes

client = Quotes.factory(market='std')

# K-line bars
df = client.bars(symbol="000001", frequency=7, start=0, offset=240)

# Real-time quotes (supports list of symbols for batch)
df = client.quotes(symbol="000001")
df = client.quotes(symbol=["000001", "600300"])

# Historical transactions
df = client.transactions(symbol="000001", start=0, offset=1000, date="20250210")

# Real-time transactions
df = client.transaction(symbol="000001", start=0, offset=1000)
All raw APIs return pandas DataFrames.

Common Pitfalls

  1. Empty results outside trading hours: Apply the time_frame patch (see above)
  2. Beijing Exchange stocks: .BJ codes are NOT supported — always filter them out
  3. Rate limiting: Default rate limit is 0.005s between calls; adjust if connection drops
  4. Weekend/holiday queries: Always validate against trading calendar before querying
  5. 1-min bar offset calculation: Must account for 240 trading minutes/day with lunch gap

Additional Resources

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

78.64%
按下载量换算8,947

安全审计

VirusTotal

通过

ClawScan

可疑

Static analysis

未展示

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills