← 返回 Skills 市场
sparkmao

Financial data fetcher

作者 ねこさん · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
204
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install financial-data-fetcher
功能描述
一个基于通达信 TQ 策略接口的金融数据获取工具,提供多种API脚本用于获取股票行情、财务数据、板块信息等。
使用说明 (SKILL.md)

TongdaXin Financial Data Fetcher

Description

一个基于通达信 TQ 策略接口的金融数据获取工具,提供多种API脚本用于获取股票行情、财务数据、板块信息等。

Triggers

当用户请求获取金融数据时自动触发,例如:

  • "获取K线数据"
  • "查询股票快照"
  • "获取专业财务数据"
  • "获取板块交易数据"
  • "查询新股申购信息"
  • 任何与股票行情、财务数据、市场信息相关的请求

Commands

行情数据

/get_market_data --stock_list 688318.SH --period 1d --count 1

获取K线行情数据

/get_market_snapshot --stock_code 688318.SH

获取快照数据

/get_stock_info --stock_code 688318.SH --field_list Name Unit

获取证券基本信息

/get_more_info --stock_code 688318.SH

获取股票更多信息

/get_trading_dates --market SH --count 10

获取交易日列表

财务数据

/get_financial_data --stock_list 688318.SH --field_list FN193 FN194

获取专业财务数据

/get_financial_data_by_date --stock_list 688318.SH --field_list FN193 --year 2025

获取指定日期专业财务数据

/get_gpjy_value --stock_list 688318.SH --field_list GP1 GP2

获取股票交易数据

/get_gpjy_value_by_date --stock_list 688318.SH --field_list GP1 --year 2025

获取指定日期股票交易数据

/get_gp_one_data --stock_list 688318.SH --field_list GO1 GO2

获取股票的单个财务数据

板块数据

/get_stock_list --market 16

获取系统分类成份股

/get_sector_list

获取A股板块代码列表

/get_stock_list_in_sector --block_code 880081.SH

获取板块成份股

/get_bkjy_value --stock_list 880660.SH --field_list BK5 BK6

获取板块交易数据

/get_bkjy_value_by_date --stock_list 880660.SH --field_list BK9 --year 2025

获取指定日期板块交易数据

市场数据

/get_scjy_value --field_list SC1 SC2

获取市场交易数据

/get_scjy_value_by_date --field_list SC6 SC7 --year 2025

获取指定日期市场交易数据

新股与分红

/get_ipo_info --ipo_type 2 --ipo_date 1

获取新股申购信息

/get_divid_factors --stock_code 688318.SH

获取分红配送数据

/get_gb_info --stock_code 688318.SH --date_list 20250101 20250601 --count 2

获取股本数据

自定义板块

/get_user_sector

获取自定义板块列表

/create_sector --block_code TEST --block_name 测试板块

创建自定义板块

/delete_sector --block_code TEST

删除自定义板块

/rename_sector --block_code TEST --block_name 新名称

重命名自定义板块

/send_user_block --block_code TEST --stocks 600000.SH 600004.SH

添加自定义板块成份股

/clear_sector --block_code TEST

清空自定义板块成份股

ETF与可转债

/get_trackzs_etf_info --zs_code 950162.CSI

获取跟踪指数的ETF信息

/get_cb_info --stock_code 123039.SZ

获取可转债基础信息

行情订阅

/subscribe_hq --stock_list 688318.SH

订阅行情

/unsubscribe_hq --stock_list 688318.SH

取消订阅更新

/get_subscribe_hq_stock_list

获取订阅列表

数据刷新

/refresh_cache --market AG --force

刷新行情缓存

/refresh_kline --stock_list 688318.SH --period 1d

刷新历史K线缓存

数据下载

/download_file --stock_code 688318.SH --down_time 20241231 --down_type 1

下载特定数据文件

Prerequisites

使用本工具前需要满足以下条件:

1. 安装 Python 依赖包

pip install numpy pandas

2. 安装通达信金融终端TQ版

  • 需要安装 通达信金融终端TQ版 并确保其正常运行
  • 本工具依赖 TQ 策略接口与通达信客户端进行数据交互
  • 确保 TQ 策略功能已启用

Usage

运行脚本前需要设置 PYTHONPATH:

# Unix/Linux/Mac
export PYTHONPATH=/path/to/project

# Windows (CMD)
set PYTHONPATH=C:\path	o\project

# Windows (PowerShell)
$env:PYTHONPATH = "C:\path	o\project"

# 运行脚本
python scripts/get_market_data.py --stock_list 688318.SH --period 1d

或者使用 -m 方式运行:

cd /path/to/project
python -m scripts.get_market_data --stock_list 688318.SH --period 1d

Enum Values

period (周期)

  • 1m - 1分钟
  • 5m - 5分钟
  • 15m - 15分钟
  • 30m - 30分钟
  • 1h - 60分钟(1小时)
  • 1d - 1天
  • 1w - 1周
  • 1mon - 1月
  • 1q - 1季
  • 1y - 1年
  • tick - 分笔

dividend_type (复权类型)

  • none - 不复权
  • front - 前复权
  • back - 后复权

market (市场)

  • AG - A股
  • HK - 港股
  • US - 美股
  • QH - 国内期货
  • QQ - 股票期权
  • NQ - 新三板
  • ZZ - 中证和国证指数
  • ZS - 沪深京指数

ipo_type

  • 0 - 新股申购信息
  • 1 - 新发债信息
  • 2 - 新股和新发债信息

ipo_date

  • 0 - 只获取今天信息
  • 1 - 获取今天及以后信息
安全使用建议
This skill wraps the TongdaXin (TQ) local client and expects you to install and run the official TQ terminal and its Python plugins (TPythClient.dll, tdxrpcx64.dll). Before installing or running: 1) only install the official TongdaXin client from a trusted source; 2) review lib/tqcenter.py (it's the large integration library) if you need to verify any network calls or file operations beyond the TQ API; 3) be aware the scripts can subscribe to live market data and send warnings/messages to the TQ client (they are not requesting external API keys or cloud credentials). If you do not have the TQ client or do not want code that loads native DLLs, do not install or run this skill.
功能分析
Type: OpenClaw Skill Name: financial-data-fetcher Version: 1.0.0 The bundle is a comprehensive Python integration for the TongdaXin (TQ) financial trading terminal, designed to fetch market data, execute technical formulas, and manage stock sectors. The core logic in `lib/tqcenter.py` wraps a local DLL (`TPythClient.dll`) and includes functionality to export data directly into the terminal's UI by moving generated XML and JSON files into specific application directories. While the code performs sensitive operations like loading external libraries and manipulating local files, these actions are well-documented and strictly aligned with the stated purpose of providing quantitative trading tools for the TongdaXin ecosystem, with no evidence of malicious intent or data exfiltration.
能力评估
Purpose & Capability
Name/description (通达信 TQ 数据抓取) align with the included scripts and the large lib/tqcenter.py library: all scripts call tq.initialize(...) and tq.* APIs for market/financial/sector operations. No unrelated credentials, cloud providers, or surprising binaries are requested.
Instruction Scope
SKILL.md instructs installing Python deps (numpy,pandas), setting PYTHONPATH, and installing/using the TongdaXin TQ terminal — which matches the code that calls TQ strategy interfaces. The runtime instructions do not ask to read unrelated system files or exfiltrate arbitrary data. Note: docs and QA mention loading TPythClient.dll/tdxrpcx64.dll from a local TQ install (expected for this integration).
Install Mechanism
No external install spec or remote downloads are present; the skill is distributed with its code files. There are no brew/npm/URL-based installers that would fetch arbitrary code at install time.
Credentials
The skill does not declare or require environment variables or secrets. It does ask the user to install the local TongdaXin client and potentially add its Python plugin path to PYTHONPATH/PATH to allow the DLL-based integration — this matches the TQ client usage in the code and is proportionate.
Persistence & Privilege
always:false and no special platform privileges requested. The skill does not attempt to modify other skill configurations or request persistent system-wide changes beyond the normal expectation of installing a local TQ client and configuring PYTHONPATH.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install financial-data-fetcher
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /financial-data-fetcher 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release of financial-data-fetcher: - 提供基于通达信 TQ 策略接口的金融数据获取工具 - 支持丰富的API脚本,包括行情、财务、板块、市场、新股、分红、ETF、可转债等数据获取 - 包含行情订阅、数据刷新与数据下载等辅助功能 通达信环境(核心依赖) - 通达信金融终端 TQ 版 - 必须已安装且安装目录为:C:\new_tdx64 - 通达信客户端必须保持运行 - 本工具通过 TQ 策略接口与通达信客户端进行数据交互 - TQ 策略接口必须已启用 - 在通达信软件中开启 TQ 策略功能
元数据
Slug financial-data-fetcher
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Financial data fetcher 是什么?

一个基于通达信 TQ 策略接口的金融数据获取工具,提供多种API脚本用于获取股票行情、财务数据、板块信息等。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 204 次。

如何安装 Financial data fetcher?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install financial-data-fetcher」即可一键安装,无需额外配置。

Financial data fetcher 是免费的吗?

是的,Financial data fetcher 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Financial data fetcher 支持哪些平台?

Financial data fetcher 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Financial data fetcher?

由 ねこさん(@sparkmao)开发并维护,当前版本 v1.0.0。

💬 留言讨论