金融市场数据符号库
将以下提示词粘贴到你的 AI 对话框中:
请根据 https://skillhub.cn/install/skillhub.md,安装 @kunlungrowth/finance-market-data-db。
技能介绍
你在搭建数据层时大概率会遇到这些麻烦
做量化研究或者标的筛选时,第一个问题往往不是“行情从哪里来”,而是“标的的基本盘怎么管”。很多团队的数据库里同时塞着 A 股、港股、美股和 ETF,结果出现跨市场同名错配:某只股票在港交所和纽交所都有类似代码,一个 symbol 字段直接把两者混在一起。退市、停牌标的没有状态标记,回测时被当成正常标的计算,导致净值曲线失真。更常见的是把元数据和行情数据放在一起,以为拉到一个表里就完事,最后发现历史价格缺失,元数据反而连带污染了行情源。
这个技能把元数据拆成四个可落地的层次
它不提供实时行情,而是把标的管理拆成清晰的分层结构:标识层负责 代码、名称、交易所 和 资产类别;分类层覆盖行业、板块和指数归属;关系层处理 ETF 跟踪标的、指数成分股、配对交易关系;时序层只保留价格和净值字段,实际数据需要另接可靠行情源。使用步骤也很工程化:先按资产类别建立本地符号表,用唯一 key 关联不同数据源,给退市或暂停标的加状态标记,并且明确区分元数据和行情。内置检查清单会提醒你验证唯一标识、退市状态、数据源可追溯性,避免常见的元数据污染。
适用边界和容易踩的坑
它适合做股票/基金筛选器、统一标的基本信息、教学性量化数据整理。但不要指望它给出实时价格,也不要用它替代行情系统。跨市场同名、退市标的未标记、元数据当行情用、数据过期不刷新,都是典型陷阱。使用时需要注意数据授权与合规,相关决策以官方或持牌机构口径为准,AI 输出不替代专业判断。
Engineering pain points it addresses
Before you worry about tick data or backtesting engines, you usually hit a more boring but equally fatal problem: security metadata is messy. Teams often dump A-shares, Hong Kong stocks, US equities and ETFs into one table, then a plain symbol column merges instruments across markets. Delisted or suspended securities are left unmarked, so they silently corrupt backtests. Worse, people treat reference data and market data as the same thing, only to find that missing prices poison the whole pipeline.
How the skill structures the work
This skill focuses on metadata, not live quotes. It splits the problem into four practical layers: the identity layer for 代码 (symbol), 名称 (name), 交易所 (exchange) and 资产类别 (asset class); the classification layer for industry, sector and index membership; the relation layer for ETF tracking targets, index constituents and pairing relationships; and the time-series layer for price and NAV, with actual market data coming from a separate provider. The workflow is equally pragmatic: build local symbol tables by asset class, link external sources through a unique key, mark delisted or suspended instruments, and keep metadata separate from market data. The built-in checklist helps you verify unique identifiers, delisting status, and data source traceability.
Boundaries and pitfalls
Use it when you are building a stock/fund screener, unifying security reference data, or preparing teaching-oriented quantitative datasets. Do not expect real-time prices from it, and do not replace a market-data system with it. Typical traps include cross-market symbol collisions, unmarked delisted names, treating metadata as quotes, and stale reference data. Always respect data licensing and compliance, and rely on official or licensed-institution guidance for investment decisions. AI output does not replace professional judgment.
使用场景
- 搭建股票或 ETF 筛选器时,需要先统一管理标的基本信息与资产类别。
- 为回测准备数据时,要清理退市标的并建立跨数据源唯一标识关联。
- 做教学性量化整理时,要区分元数据层与行情层,避免数据口径混乱。
- 维护指数成分股或 ETF 跟踪关系时,需要结构化记录标的归属和配对关系。
适合人员
- 量化研究员:需要为策略回测准备干净的标的元数据与分类信息。
- 金融数据工程师:负责搭建标的数据库,并处理跨市场唯一标识和状态标记。
- 量化教学讲师:希望为学生演示如何整理股票、ETF 与指数成分股数据。
- 研究平台开发者:要实现统一的标的筛选与元数据查询能力。