financialprice

Visual comparison of price trends and drawdowns for multiple A-share, HK, and US stock tickers. Supports one-click switch between raw values and normalized values, custom drawdown thresholds, and drag-selection to calculate period returns and drawdowns.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "financialprice" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-9d3086d82ada9b230085cf5140a302f3918f4acfcc1e48f15c5295db5e3f7a59. Verify the upstream source and version against https://skillhub.cn/skills/user_6a41fe13/financialprice before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Visual comparison of price trends and drawdowns for multiple A-share, HK, and US stock tickers. Supports one-click switch between raw values and normalized values, custom drawdown thresholds, and drag-selection to calculate period returns and drawdowns.

0 Downloads

Introduction source: third_party · user_6a41fe13 · 1.1.0 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Audience
Not specified in the source documentation.
Inputs and outputs
Translation pending; see source documentation.
Software, accounts and paid services
Not specified in the source documentation.
Limits and differences
Not specified in the source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: financialprice
slug: financialprice
displayName: 多标的价格对比及回撤分析
description: 可视化对比各关注标的的价格变动趋势,并进一步分析各标的价格变化及回撤。覆盖 A股/港股/美股,支持原始值与归一值一键切换、回撤区间自动标注(阈值默认 5%,可自定义)、周期涨跌幅拖选测算。Use when 用户需要分析价格变化趋势、分析回撤,或对比多个标的的历史收盘价走势与区间表现时。
summary: 可视化对比 A股/港股/美股多标的的价格走势与回撤,支持原始值/归一值一键切换、自定义回撤阈值、周期涨跌幅拖选测算。
tags: [金融, 股票, 可视化, 回撤分析]
version: "1.1.0"
triggers:
  - "分析价格变化趋势"
  - "标的回撤分析"
  - "历史回撤区间"
  - "价格走势对比"
  - "价格变动可视化"
  - "标的涨幅对比"
token_budget:
  L0_trigger: 200
  L1_core: 1500
  L2_deep: 6000
  hard_cap: 12000
template: data-driven
sources:
  template: sources.template.yaml
author: skill-creator-king
scaffold: skill-creator-king

financialprice

Purpose

当用户需要可视化对比各关注标的的价格变动趋势,并进一步分析各标的价格变化及回撤时,本 skill 负责:

  1. 从配置数据源(MCP 优先,akshare / yfinance 兜底)获取历史收盘价;
  2. 生成一份规范 CSV 与交互式 Plotly 看板;
  3. 提供汇总对比、单标的回撤、周期涨跌幅拖选等可视化交互。

本 skill 仅做历史数据可视化与测算,不构成投资建议。

Context

领域:金融量化可视化(跨市场历史价格分析)。

数据依赖(🔒 必须声明):

  • ✅ 配置数据源:MCP(westock-mcp / tdx-connector)优先,akshare / yfinance 兜底。
  • ❌ 严禁 WebSearch / 网络搜索获取价格数据。
  • 数据维度:当日及历史收盘价;覆盖 A股(人民币)/ 港股(港币)/ 美股(美元);精确到小数点后两位。

适用场景:用户要对比多个标的走势、或分析单标的回撤与区间表现时。

文件结构

详见 README.md

数据源(🔒 强约束)

🔒 所有分析数据仅来源于本 skill 配置的数据源,绝对禁止使用 WebSearch / 网络搜索获取价格数据。

  1. 优先 MCP 数据源(Agent 在对话中直接调用):
    • westock-mcp(腾讯自选股,覆盖 A股/港股/美股)
    • tdx-connector(通达信,覆盖 A股/港股/美股)
    • 获取标的的当日及历史收盘价(日 K 的 close 字段)。
  2. 兜底数据源(MCP 不可用或数据不全时,由 scripts/fetch_data.py 调用):
    • akshare:A股(stock_zh_a_hist)、港股(stock_hk_hist)
    • yfinance:美股(如 AAPL)
  3. 市场与货币映射(详见 references/data-sources.md):
    • A股 → 人民币(¥)|港股 → 港币(HK$)|美股 → 美元($)
  4. 精度:所有价格数据精确到小数点后两位。
  5. 禁止:不得使用 WebSearch、不得引用网页文章中的价格数字、不得编造数据。

⚠️ 若 MCP 与兜底数据源均无法取得某标的真实数据,必须明确告知用户该标的缺失,不得用估算值填充图表。

工作流

步骤 1:接收标的与区间

  1. 解析用户关注的标的(名称/代码),识别其市场(A股/港股/美股)与对应货币。
  2. 确认分析区间(默认:今年以来至当日;用户可指定起止日期)。
  3. 若用户未给代码,按 references/data-sources.md 的市场-代码约定提示补全。

步骤 2:采集历史收盘价

  1. 优先调用 MCP(westock-mcp 的 data_kline / tdx-connector 的 tdx_kline),取日级 close,写入中间文件 raw_prices.json(schema 见 references/data-sources.md)。
  2. 若 MCP 不可用或部分标的缺失 → 运行 scripts/fetch_data.py 兜底补齐,输出同样的 raw_prices.json。
  3. 校验:每个标的须含≥2 个交易日的 close,且均为两位小数精度。

步骤 3:生成交付物

运行 scripts/build_dashboard.py <raw_prices.json> <输出目录> [--threshold 0.05]:

  • 产出 规范 CSV:所有标的源数据合并为一个文件 prices_source.csv,字段见「输出文件约定」。
  • 产出 交互式 Plotly 看板 price_dashboard.html,满足下方全部可视化规范。
  • --threshold 可选,控制回撤标注阈值(小数,默认 0.05 即 >5%);看板板块标题与阴影标注随该值动态变化。
  • 看板 HTML 由 assets/dashboard_template.html 模板注入数据生成(视图与逻辑分离,避免双写)。

步骤 4:交付与说明

  1. 通过 present_files 同时给出 price_dashboard.html 与 prices_source.csv。
  2. 用文字简述关键结论(如最大回撤标的、区间领涨标的),但结论须完全基于 CSV/看板中的真实数据。

交互式可视化规范(🔒 强制)

所有图表支持中文显示(标题、坐标轴标签、图例、表格均无乱码),交由 price_dashboard.html 实现:

  1. 各标的价格变化汇总图
    • 同一图表叠加展示各标的价格走势。
    • 右上角两个按钮:原始值 / 归一值 切换视图(归一值=各标的首日收盘=100 的基准化序列)。
    • 图下方表格列示各标的 过去一周 / 一个月 / 一个季度 / 今年以来 的涨幅。
  2. 各标的单独价格变化与回撤分析图
    • 为每个标的分别绘制「价格 + 回撤」分析图并逐个列示。
    • 图上以阴影/颜色标注历次回撤超过阈值(默认 >5%,可由 --threshold 调整)的周期区间。
    • 图下方表格列示每次回撤的 起止时间、持续时间、最大回撤数值。
  3. 通用交互功能
    • 右侧数据提示框(不与图表重叠):悬停时显示竖直参考线 + 提示框,内容为 日期 + 各标的原始值/归一值。
    • 周期涨跌幅模式:右上角开关;开启后用户可拖选时间区间,图表显示两根竖直参考线标记起止,提示框显示 起止日期 + 区间内各标的涨跌幅。

Output

本 skill 的最终交付物为两个文件(通过 present_files 一并给出):

price_dashboard.html   交互式 Plotly 看板(汇总对比 + 单标的回撤 + 右侧提示框 + 周期涨跌幅拖选)
prices_source.csv      规范源数据(所有标的合并,含非交易日行与货币单位)

文字结论(如领涨标的、最大回撤标的)须完全基于上述 CSV/看板中的真实数据,不臆测。

输出文件约定

🔒 本 skill 涉及文件产出,约定如下:

  • 输出目录:用户指定目录;未指定时使用当前工作目录。脚本内置 os.makedirs(out_dir, exist_ok=True)。
  • 文件命名:
    • prices_source.csv — 所有标的合并的规范源数据。
    • price_dashboard.html — 交互式 Plotly 看板。
    • raw_prices.json — 中间数据(由 Agent / fetch_data.py 产出,供 build_dashboard.py 读取)。
  • 文件格式:
    • CSV 表头:标的名称,标的代码,市场,货币单位,交易日期,当日收盘价,是否交易日
    • 每行一条「标的-日期」记录;非交易日保留该行,字段 是否交易日 标注「非交易日」,收盘价取最近交易日收盘价(前向填充,两位小数)。
  • 覆盖策略:同名文件直接覆盖,并在控制台提示已覆盖路径。
  • 错误输出:脚本以 {"ok": false, "error": "..."} 结构化 JSON 输出到 stderr,不抛出未捕获异常、不暴露系统路径。

Notes

  • 边界:本 skill 仅做历史价格可视化与回撤/涨幅测算,不构成任何投资建议。
  • 已知限制:归一值仅用于横向形态对比,不代表收益可比(跨市场货币不同);回撤阈值默认 5%,可通过 build_dashboard.py --threshold 自定义。
  • 涨幅口径:过去一周/一月/一季按自然日回看约 7/30/90 天取 ≤ 目标日的最近交易日,非交易日口径(刻意保留,便于跨市场对齐)。
  • 数据时效:看板数据截止于 raw_prices.json 的生成时间,不含实时行情。
  • 看板加载:Plotly.js 走 CDN 并带 SRI 校验(integrity + crossorigin);数据已内嵌 HTML。离线渲染方案见 README.md。
  • 🔒 修改纪律:本 skill 由 skill-creator-king 创建。修改后必须加载 SCK 运行 validate.py + quality-audit.py(用原生 C:/... 路径),并跑 tests/test.py,修到 0 HIGH、测试全绿为止。

Further Reading

  • references/data-sources.md — 市场/代码/货币映射与 raw_prices.json schema
  • references/chart-spec.md — 看板交互实现细则(供维护参考)
  • scripts/markets.py — 市场/货币/代码识别的单一数据源(fetch_data.py 复用)
  • assets/dashboard_template.html — 看板 HTML 模板(build_dashboard.py 注入数据)
  • data/sources.yaml — 数据源配置与禁止项声明

Current listing version

1.1.0

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value85/100

Highlights

  • 提供跨市场(A股/港股/美股)多标的价格走势可视化与回撤分析,满足金融量化分析需求
  • 支持原始值/归一值切换、自定义回撤阈值、周期涨跌幅拖选测算,功能实用性强
Trigger Precision90/100

Highlights

  • 触发词覆盖全面,包括"分析价格变化趋势"、"标的回撤分析"等,边界清晰
Structure and Standards95/100

Highlights

  • Phase/步骤清晰,含端到端示例,frontmatter完整,单文件结构规范
Execution Reliability90/100

Highlights

  • 工具来源明确(MCP优先,akshare/yfinance兜底),参数正确,覆盖主要异常,错误输出结构化
Evidence Verifiability (mean of the first four)90/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Not specified in the source documentation.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.