shouldnotappearcalm/hk-us-market-skill · Archived

market-data

港股与美股数据能力。支持实时、历史K线、技术指标、估值与机构持仓、行业ETF与美国宏观,且?

First seen Aug 4, 2026

Installation

$ npx skills add shouldnotappearcalm/hk-us-market-skill --skill market-data

Stronger alternatives

This repository is archived — consider an actively maintained alternative.

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 3
Default branch main
Open issues 0
Status Archived

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 3,473 B
  • docs SUMMARY.md 170 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 1 installs

SKILL.md

HK+US 数据能力

目标

以 Python 脚本直接拉数,不依赖 MCP。默认免密可运行,并提供多渠道兜底策略。

目录

  • scripts/fetchrealtimehkus.py
  • scripts/fetchhistoryhkus.py
  • scripts/fetchtechnicalhkus.py
  • scripts/fetchfundamentalhkus.py
  • scripts/fetchsectorhkus.py
  • scripts/fetchmacrous.py
  • scripts/fetchuniversehkus.py
  • scripts/fetchmarketrealtime_hkus.py
  • scripts/healthcheck_sources.py

安装依赖

pip3 install yfinance pandas numpy requests pandas_datareader yahooquery pytest

代码规范

  • US 代码统一输出为 EXCHANGE:TICKER,如 NASDAQ:AAPL
  • HK 代码统一输出为 NNNN.HK,如 0700.HK
  • 结果统一包含:

- sourceprimary - sourceactual - fallbackused - fallbackchain

渠道优先级

US / HK(行情与K线)

  • 实时:tencentquote -> sinaquote -> yahooqueryrealtime -> yfinance -> yahoochart
  • 历史/技术:tencenthistory -> sinahistory -> yfinance -> yahooqueryhistory -> yahoochart

腾讯、新浪均区分港/美代码。实时用 usAAPL / hk00700;K 线用 fqkline/get,美股需带交易所后缀(如 usAAPL.OQ、usJPM.N、usSPY.AM,由 qt 行情自动解析)。分钟 K 港股走 minute/query;美股盘中仅返回当前分钟快照,历史分钟由 Yahoo 兜底。实时结果含 market_state 与 premarket;盘中若主源未带盘前,会用 Yahoo 补齐。

其他

  • 基本面(US):yfinance -> yahooquery
  • 宏观:fredreader -> fredcsv

快速命令

# 实时
python3 scripts/fetch_realtime_hkus.py --symbol AAPL --json
python3 scripts/fetch_realtime_hkus.py --batch AAPL,TSLA,0700.HK --json

# 历史
python3 scripts/fetch_history_hkus.py --symbol AAPL --interval 1d --days 180 --json
python3 scripts/fetch_history_hkus.py --batch AAPL,MSFT,0700.HK --workers 8 --json

# 技术
python3 scripts/fetch_technical_hkus.py AAPL --days 180 --interval 1d --json

# 基本面
python3 scripts/fetch_fundamental_hkus.py --symbol AAPL --json

# 行业与ETF
python3 scripts/fetch_sector_hkus.py --sector-name 半导体 --days 60 --json
python3 scripts/fetch_sector_hkus.py --symbol 0700.HK --json

# 美国宏观
python3 scripts/fetch_macro_us.py --interest-rates --days 365 --json
python3 scripts/fetch_macro_us.py --inflation-employment --months 36 --json
python3 scripts/fetch_macro_us.py --economic-growth --quarters 24 --json

# 渠道健康检查
python3 scripts/healthcheck_sources.py --us-symbol AAPL --hk-symbol 0700.HK

# 拉全市场股票清单
python3 scripts/fetch_universe_hkus.py --market all --json
python3 scripts/fetch_universe_hkus.py --market us --json
python3 scripts/fetch_universe_hkus.py --market hk --json

# 拉市场当前交易数据(可全市场)
python3 scripts/fetch_market_realtime_hkus.py --market all --universe-limit 800 --top 200 --json
python3 scripts/fetch_market_realtime_hkus.py --market us --universe-limit 1000 --top 100 --sort volume_desc --json
python3 scripts/fetch_market_realtime_hkus.py --symbols NASDAQ:AAPL,NYSE:MSFT,0700.HK --json

输出规则

  • 默认输出简版摘要
  • 带 --json 时输出完整结构
  • 若主备源都失败,返回错误标识 source_unavailable