← Back to Skills Marketplace
sparkmao

Financial data fetcher

by ねこさん · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
204
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install financial-data-fetcher
Description
一个基于通达信 TQ 策略接口的金融数据获取工具,提供多种API脚本用于获取股票行情、财务数据、板块信息等。
README (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 - 获取今天及以后信息
Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install financial-data-fetcher
  3. After installation, invoke the skill by name or use /financial-data-fetcher
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release of financial-data-fetcher: - 提供基于通达信 TQ 策略接口的金融数据获取工具 - 支持丰富的API脚本,包括行情、财务、板块、市场、新股、分红、ETF、可转债等数据获取 - 包含行情订阅、数据刷新与数据下载等辅助功能 通达信环境(核心依赖) - 通达信金融终端 TQ 版 - 必须已安装且安装目录为:C:\new_tdx64 - 通达信客户端必须保持运行 - 本工具通过 TQ 策略接口与通达信客户端进行数据交互 - TQ 策略接口必须已启用 - 在通达信软件中开启 TQ 策略功能
Metadata
Slug financial-data-fetcher
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Financial data fetcher?

一个基于通达信 TQ 策略接口的金融数据获取工具,提供多种API脚本用于获取股票行情、财务数据、板块信息等。 It is an AI Agent Skill for Claude Code / OpenClaw, with 204 downloads so far.

How do I install Financial data fetcher?

Run "/install financial-data-fetcher" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Financial data fetcher free?

Yes, Financial data fetcher is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Financial data fetcher support?

Financial data fetcher is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Financial data fetcher?

It is built and maintained by ねこさん (@sparkmao); the current version is v1.0.0.

💬 Comments