stock-analyzer

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

A股股票分析

A-share Stock Analysis

概览

Overview

用这个 skill 管理本地 A 股观察池,并通过固定脚本生成结构化交易建议。标准流程不是只看单点实时数据,而是先看持仓,再结合历史行情和实时行情判断趋势与阶段,然后分析板块和板块内最强三只股票,最后输出带过程说明的操作建议。
Use this skill to manage local A-share watchlists and generate structured trading recommendations through fixed scripts. The standard process does not only look at single-point real-time data; instead, it first checks positions, then judges trends and phases by combining historical and real-time market data, analyzes sectors and the top three strongest stocks within the sector, and finally outputs operational recommendations with process explanations.

工作流

Workflow

1. 先判断请求类型

1. First Determine Request Type

把任务归到以下几类之一:
  • 股票池维护:新增、移动、更新、查看或删除本地观察池与持仓池条目。
  • 元数据补全:批量补股票简称或概念板块。
  • 数据抓取:获取最新个股资料、板块龙头或风险事件。
  • 完整分析:结合板块对标和风险提示,输出买入、观察、持有、减仓或卖出的建议。
Categorize the task into one of the following types:
  • Watchlist Maintenance: Add, move, update, view or delete entries in local watchlists and position pools.
  • Metadata Completion: Batch fill in stock abbreviations or concept sectors.
  • Data Fetching: Obtain the latest individual stock information, sector leaders or risk events.
  • Comprehensive Analysis: Output recommendations of Buy, Watch, Hold, Reduce Position or Sell combined with sector benchmarking and risk prompts.

2. 使用固定脚本

2. Use Fixed Scripts

优先运行本 skill 自带脚本,不要临时重写抓取逻辑:
  • scripts/watchlist_manager.py
    • 维护
      watchlist
      positions
    • 支持
      --auto-symbol
      根据名称反查股票代码
    • 支持
      --auto-name
      自动补股票简称
    • 支持
      enrich --auto-symbol --auto-name
      批量回填空的代码和名称字段
    • 当用户修正概念板块时,直接写回
      watchlists.json
      条目
  • scripts/fetch_stock_profile.py
    • 抓取个股资料、行情快照、最新基本面、资金流和概念板块
  • scripts/fetch_sector_leaders.py
    • 解析股票所属概念板块,并排序出最强三只对标股
  • scripts/fetch_risk_events.py
    • 优先读取当日风险缓存;需要时联网刷新未来业绩披露、近期财报发布、减持公告和负面新闻
  • scripts/refresh_daily_risks.py
    • 批量刷新股票池的每日风险缓存,并写入本地
      data/risk_cache/
  • scripts/stock_score.py
    • 汇总其他脚本数据,生成固定输出结构和最终建议
除非脚本确实缺少必需字段,否则不要发明另一套数据路径。脚本失败时,要明确说明失败点和缺失数据。
Prioritize running the scripts built into this skill, do not temporarily rewrite fetching logic:
  • scripts/watchlist_manager.py
    • Maintain
      watchlist
      and
      positions
    • Support
      --auto-symbol
      to reverse-check stock codes based on names
    • Support
      --auto-name
      to automatically fill in stock abbreviations
    • Support
      enrich --auto-symbol --auto-name
      to batch fill empty code and name fields
    • When users correct concept sectors, directly write back to entries in
      watchlists.json
  • scripts/fetch_stock_profile.py
    • Fetch individual stock information, market snapshots, latest fundamentals, capital flows and concept sectors
  • scripts/fetch_sector_leaders.py
    • Parse the concept sectors that stocks belong to, and sort out the top three strongest benchmark stocks
  • scripts/fetch_risk_events.py
    • Prioritize reading the day's risk cache; refresh future performance disclosures, recent financial report releases, share reduction announcements and negative news online when needed
  • scripts/refresh_daily_risks.py
    • Batch refresh the daily risk cache of stock pools and write to local
      data/risk_cache/
  • scripts/stock_score.py
    • Summarize data from other scripts, generate fixed output structure and final recommendations
Do not invent another set of data paths unless the scripts are indeed missing required fields. When a script fails, clearly explain the failure point and missing data.

2.1 完整分析的固定执行顺序

2.1 Fixed Execution Sequence for Comprehensive Analysis

做持仓分析时,按下面的顺序执行,不要跳步:
  1. 查看当前持仓
  2. 查询目标股历史行情
  3. 查询目标股实时行情
  4. 结合历史行情和实时行情判断趋势、所处阶段、是否出现关键异动
  5. 查询所属板块数据,判断板块趋势
  6. 查询同板块最强三只个股
  7. 分析这三只个股的历史走势和今日表现,作为目标股的横向参考
  8. 如果财报刚披露或出现异常大跌,再辅助联网搜索是否存在“不及预期”信号
  9. 汇总分析过程,给出每个持仓的操作建议
When conducting position analysis, follow the sequence below without skipping steps:
  1. Check current positions
  2. Query historical market data of target stocks
  3. Query real-time market data of target stocks
  4. Judge trends, current phases and whether key abnormal movements occur by combining historical and real-time market data
  5. Query sector data of the target stocks and judge sector trends
  6. Query the top three strongest stocks in the same sector
  7. Analyze the historical trends and today's performance of these three stocks as horizontal references for the target stocks
  8. If financial reports have just been disclosed or there is an abnormal sharp drop, supplement with online searches to determine if there are signals of "falling short of expectations"
  9. Summarize the analysis process and give operational recommendations for each position

2.2 风险事件的每日刷新

2.2 Daily Refresh of Risk Events

风险提示要尽量发生在事实以前,而不是只在大跌后补解释。
  • 每个交易日至少刷新一次
    positions
    的风险缓存
  • 风险缓存默认保存到
    data/risk_cache/<symbol>.json
  • 单票分析时优先读取当天缓存,缺失时再联网刷新
  • 刷新的重点包括:
    • 未来几天是否有业绩披露计划
    • 近期是否刚发布年报、季报或业绩预告
    • 近期是否有减持公告
    • 近期是否有明显负面新闻
建议命令(以下路径相对于本 skill 根目录,即
skills/stock-analyzer/
):
  • python scripts/refresh_daily_risks.py --bucket positions
  • python scripts/fetch_risk_events.py 002837 --refresh --pretty
  • Windows 任务计划程序可直接调用插件根目录下的
    run_daily_refresh.bat
  • 也可以运行插件根目录下的
    register_daily_refresh_task.ps1
    自动创建每天
    08:30
    /
    12:30
    的计划任务
  • 注册命令示例:
    • powershell -NoProfile -ExecutionPolicy Bypass -File .\register_daily_refresh_task.ps1
    • 如果同名任务已存在:
      powershell -NoProfile -ExecutionPolicy Bypass -File .\register_daily_refresh_task.ps1 -Force
其中第 4 步必须显式判断这些内容:
  • 当前趋势:上升、震荡、走弱或破位
  • 所处阶段:启动、主升、加速、分歧、高位震荡、退潮等
  • 关键异动:大涨、大跌、突然放量、放量滞涨、缩量反弹、跌破重要均线、突破阶段高点
如果出现关键异动,要把该信号单独拎出来解释,不能只给结论。
出现以下任一情形时,允许并建议辅助联网搜索:
  • 财报披露日前后 3 个交易日
  • 当日跌幅明显偏大,例如
    <= -7%
  • 放量大跌
  • 用户明确提到“业绩不及预期”或“财报雷”
搜索目的不是替代行情数据,而是判断是否存在这些附加信息:
  • 财报是否低于市场预期
  • 是否出现业绩快报、业绩预告、年报或季报中的负面表述
  • 市场主流解读是否把当日大跌归因于财报不及预期
Risk prompts should be given as early as possible, rather than only providing explanations after a sharp drop.
  • Refresh the risk cache of
    positions
    at least once per trading day
  • Risk cache is saved to
    data/risk_cache/<symbol>.json
    by default
  • Prioritize reading the day's cache when analyzing individual stocks; refresh online if the cache is missing
  • Key points of refresh include:
    • Whether there is a performance disclosure plan in the next few days
    • Whether annual reports, quarterly reports or performance forecasts have just been released recently
    • Whether there are share reduction announcements recently
    • Whether there are obvious negative news recently
Recommended commands (paths below are relative to the root directory of this skill, i.e.,
skills/stock-analyzer/
):
  • python scripts/refresh_daily_risks.py --bucket positions
  • python scripts/fetch_risk_events.py 002837 --refresh --pretty
  • Windows Task Scheduler can directly call
    run_daily_refresh.bat
    in the plugin root directory
  • You can also run
    register_daily_refresh_task.ps1
    in the plugin root directory to automatically create scheduled tasks at
    08:30
    /
    12:30
    every day
  • Example registration commands:
    • powershell -NoProfile -ExecutionPolicy Bypass -File .\register_daily_refresh_task.ps1
    • If a task with the same name already exists:
      powershell -NoProfile -ExecutionPolicy Bypass -File .\register_daily_refresh_task.ps1 -Force
The following contents must be explicitly judged in Step 4:
  • Current trend: Upward, oscillating, weakening or breaking below support
  • Current phase: Initiation, main uptrend, acceleration, divergence, high-level oscillation, retreat, etc.
  • Key abnormal movements: Sharp rise, sharp drop, sudden volume increase, volume increase with stagnant price, volume decrease with rebound, breaking below important moving averages, breaking through stage highs
If key abnormal movements occur, this signal must be explained separately, not just giving conclusions.
Auxiliary online searches are allowed and recommended in any of the following situations:
  • Within 3 trading days before or after the financial report disclosure date
  • Obvious large drop on the day, e.g.,
    <= -7%
  • Sharp drop with increased volume
  • Users explicitly mention "performance falling short of expectations" or "financial report thunder"
The purpose of searching is not to replace market data, but to judge whether there is such additional information:
  • Whether the financial report falls below market expectations
  • Whether there are negative statements in performance bulletins, performance forecasts, annual reports or quarterly reports
  • Whether the mainstream market interpretation attributes the day's sharp drop to financial reports falling short of expectations

3. 板块优先使用本地覆盖

3. Prioritize Local Coverage for Sectors

先检查
watchlists.json
条目中的
concept_sector
。如果没有填写,再由
fetch_stock_profile.py
fetch_sector_leaders.py
实时解析概念板块。用户显式修正概念板块时,要通过
watchlist_manager.py
直接写回条目本身。
First check the
concept_sector
field in entries of
watchlists.json
. If it is not filled, then parse the concept sector in real-time via
fetch_stock_profile.py
or
fetch_sector_leaders.py
. When users explicitly correct concept sectors, directly write back to the entries via
watchlist_manager.py
.

3.1 先补名称,再补板块

3.1 Fill in Names First, Then Sectors

如果用户只给了股票名称,没有给代码,先用
watchlist_manager.py
自动反查代码:
  • 单条新增:
    add 名称 --auto-symbol
  • 批量补全:
    enrich --auto-symbol
如果本地条目的
name
为空,优先用
watchlist_manager.py
自动回填股票简称:
  • 单条新增或更新:
    add --auto-name
    update --auto-name
  • 批量补全:
    enrich --auto-name
如果代码、名称或板块实时补全失败:
  • 明确说明失败来源,比如
    quote_snapshot
    stock_info
  • 保留已有本地数据,不要用猜测值覆盖
If users only provide stock names without codes, first use
watchlist_manager.py
to automatically reverse-check codes:
  • Single entry addition:
    add <name> --auto-symbol
  • Batch completion:
    enrich --auto-symbol
If the
name
field of local entries is empty, prioritize using
watchlist_manager.py
to automatically fill in stock abbreviations:
  • Single entry addition or update:
    add --auto-name
    or
    update --auto-name
  • Batch completion:
    enrich --auto-name
If real-time completion of codes, names or sectors fails:
  • Clearly explain the source of failure, such as
    quote_snapshot
    or
    stock_info
  • Retain existing local data, do not overwrite with guessed values

4. 按固定结构输出

4. Output in Fixed Structure

做完整分析时,始终按这个顺序输出:
  1. 标的基本信息
  2. 历史行情与趋势判断
  3. 实时行情与关键异动
  4. 所属概念板块与板块趋势
  5. 板块最强三只对标表
  6. 对标股历史走势与今日表现参考
  7. 技术面、基本面、风险面评分
  8. 建议动作:
    买入
    观察
    持有
    减仓
    卖出
  9. 仓位建议
  10. 止损和止盈条件
  11. 风险事件提示
  12. 简短结论
使用
references/对标分析模板.md
中的模板。
When conducting comprehensive analysis, always output in the following order:
  1. Basic information of the target stock
  2. Historical market data and trend judgment
  3. Real-time market data and key abnormal movements
  4. Belonging concept sector and sector trend
  5. Benchmark table of the top three strongest stocks in the sector
  6. Reference of historical trends and today's performance of benchmark stocks
  7. Scores of technical aspects, fundamental aspects and risk aspects
  8. Recommended action:
    Buy
    ,
    Watch
    ,
    Hold
    ,
    Reduce Position
    ,
    Sell
  9. Position recommendation
  10. Stop-loss and take-profit conditions
  11. Risk event prompts
  12. Brief conclusion
Use the template in
references/对标分析模板.md
.

5. 保守处理失败场景

5. Conservatively Handle Failure Scenarios

如果实时数据不完整或不可用:
  • 说明是哪个脚本失败、缺了哪些字段。
  • 如果用户已经提供数据,可以用,但要明确标记为用户提供。
  • 板块对标或风险事件不可用时,不要给出强结论。
  • 如果
    concept_sector
    未解析成功,必须明确提示用户是否手动补充板块信息后再重跑分析,不能静默跳过板块环节。
If real-time data is incomplete or unavailable:
  • Explain which script failed and which fields are missing.
  • If users have provided data, it can be used, but must be clearly marked as user-provided.
  • Do not give strong conclusions when sector benchmarking or risk events are unavailable.
  • If
    concept_sector
    fails to be parsed, must clearly prompt users whether to manually supplement sector information and re-run the analysis, cannot silently skip the sector link.

数据文件

Data Files

这个 skill 把本地状态存到
data/
下:
  • data/watchlists.json
    :观察池和持仓池
  • data/risk_cache/
    :按股票保存的每日风险扫描结果
JSON 结构见
references/股票池结构.md
This skill stores local status under
data/
:
  • data/watchlists.json
    : Watchlists and position pools
  • data/risk_cache/
    : Daily risk scan results saved by stock
See
references/股票池结构.md
for JSON structure.

参考资料

Reference Materials

按需加载这些文件:
  • references/数据来源.md
    • 数据源优先级、实时数据假设、失败回退方式
  • references/股票池结构.md
    • 本地 JSON 布局和字段说明
  • references/A股评分规则.md
    • 技术面、基本面、风险面的评分规则
  • references/对标分析模板.md
    • 固定对标表和结论结构
Load these files as needed:
  • references/数据来源.md
    • Data source priorities, real-time data assumptions, and fallback methods for failures
  • references/股票池结构.md
    • Local JSON layout and field descriptions
  • references/A股评分规则.md
    • Scoring rules for technical aspects, fundamental aspects and risk aspects
  • references/对标分析模板.md
    • Fixed benchmark table and conclusion structure