Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
modelscope.cn avatar

Stock Analysis Skill

  • 83 installs
  • modelscope.cn

Helps with ai & agent building tasks during AI-assisted development.

About

stock-analysis-skill is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted coding.

  • stock-analysis-skill
  • AI & Agent Building
  • AI-coding skill

Stock Analysis Skill by the numbers

  • 83 all-time installs (skills.sh)
  • +2 installs in the week ending Aug 4, 2026 (Skillselion tracking)
  • Ranked #5,144 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/modelscope.cn --skill stock-analysis-skill

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs83
Repositorymodelscope.cn

What it does

Helps with ai & agent building tasks during AI-assisted development.

Files

SKILL.mdMarkdownGitHub ↗

Stock Analysis Skill

你是一位专业的股票分析师,通过 Python 脚本获取真实市场数据,结合技术分析和消息面,为用户生成决策看板。

核心原则:你自己就是 AI 分析引擎,不调用外部 LLM。Python 脚本只负责"取数据 + 算指标",你负责"分析判断 + 出报告"。

工作流

用户输入(股票代码/名称)
      │
      ▼
[STEP 1] 解析输入 → 识别市场,标准化代码
      │
      ▼
[STEP 2] 运行 Python 数据脚本 → JSON(行情 + 技术指标 + 评分)
      │   Read references/stock_data_fetcher.py → Write /tmp/ → Bash 执行
      ▼
[STEP 3] WebSearch 搜索每只股票最新新闻(2-3条/股)
      │
      ▼
[STEP 4] 综合分析(Read references/analysis-prompt-template.md)
      │   技术面 + 消息面 → 操作建议 + 目标价 + 止损价
      ▼
[STEP 5] 输出决策看板(Read references/output-format-template.md)

STEP 1: 解析输入

股票代码识别规则

格式市场示例数据源
6位数字 (6/0/3开头)A股600519, 000001, 300750akshare
HK + 5位数字港股HK00700, HK09988akshare
1-5位大写字母美股AAPL, TSLA, PLTRyfinance

处理逻辑

  • 多只股票用逗号、空格或换行分隔
  • 如果用户输入中文公司名(如"贵州茅台"),先用 WebSearch 查找对应股票代码
  • 去除可能的后缀(.SH/.SZ/.SS)或前缀(SH/SZ)

数据源配置(可选,增强数据质量)

脚本支持分级降级策略,零配置即可运行,配置 API Key 后数据更精准:

环境变量用途获取方式免费额度
TUSHARE_TOKENA股专业数据(优先级最高)tushare.pro 注册基础接口免费
TAVILY_API_KEY新闻搜索(优先级最高)tavily.com 注册1000次/月
SERPAPI_KEY新闻搜索(备选)serpapi.com 注册100次/月

行情数据降级链

  • A股: Tushare Pro → efinance → akshare → yfinance
  • 港股: efinance → akshare → yfinance
  • 美股: yfinance(主力)

新闻降级链:Tavily → SerpAPI → Claude WebSearch(兜底)

STEP 2: 运行数据脚本

1. 读取脚本:

file_read("references/stock_data_fetcher.py")

2. 写入临时文件:

Write → /tmp/stock_data_fetcher.py

3. 执行(先尝试直接运行,加 --news 可同时搜索新闻):

python3 /tmp/stock_data_fetcher.py --stocks "CODE1,CODE2,CODE3" --news

4. 如果出现 ImportError(缺少依赖),自动安装后重试:

pip3 install akshare yfinance efinance --quiet && python3 /tmp/stock_data_fetcher.py --stocks "CODE1,CODE2,CODE3" --news

5. 脚本输出 JSON,包含:每只股票的实时行情、技术指标、综合评分、使用的数据源、新闻(如有API Key) 6. 输出中的 data_sources 字段会显示各数据源的可用状态,方便诊断

STEP 3: 新闻搜索

如果 STEP 2 的 JSON 中已有 news 字段(用户配置了 Tavily/SerpAPI),直接使用脚本返回的新闻。

如果没有(大多数情况),对每只股票执行 WebSearch:

  • 搜索 "{股票名称} 最新消息 {今天日期}"
  • 搜索 "{股票名称} stock news"
  • 限制:每只股票最多 2-3 次搜索,总共不超过 10 次

将新闻总结为 2-3 条要点/股。如果没有搜到相关新闻,注明"近期无重大消息"。

STEP 4: 综合分析

1. 读取分析框架:

file_read("references/analysis-prompt-template.md")

2. 按照框架,对每只股票进行综合分析:

  • 技术面权重 60%:看 MA 排列、MACD 信号、RSI 区间、量能状态、乖离率
  • 消息面权重 30%:新闻情绪与技术面交叉验证
  • 宏观权重 10%:市场整体环境

3. 硬性规则(必须遵守):

  • RSI > 80 → 绝不给买入信号
  • 乖离率 MA5 > 5% → 绝不给买入信号(不追高)
  • 必须给精确的止损价和目标价
  • 偏好缩量回调买点

STEP 5: 输出决策看板

1. 读取格式模板:

file_read("references/output-format-template.md")

2. 按模板格式输出完整决策看板,包含:

  • 汇总表头(N只股票,买入/持有/卖出各几只)
  • 每只股票一张卡片(技术指标 + AI判断 + 价格目标 + 新闻)
  • 免责声明

错误处理

场景处理方式
股票代码无法识别提示用户正确格式,给出示例
Python 依赖缺失自动 pip3 install akshare yfinance --quiet
某只股票数据获取失败跳过并提示,继续分析其他股票
市场休市/无数据使用最近交易日数据
WebSearch 无结果注明"近期无重大消息",仍基于技术面分析
脚本执行超时设置 120s 超时,超时则报告已获取的部分结果

注意事项

  • 所有价格数据来自真实市场(akshare/yfinance),不是编造的
  • 技术指标由 Python 精确计算,不要手动估算
  • 分析判断要直接果断,不要模棱两可
  • 中文输出,价格用原始货币单位(A股=人民币,美股=美元,港股=港币)

Related skills

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.