analyze-stock

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Analyze Stock — 一键股票综合分析

Analyze Stock — One-Click Comprehensive Stock Analysis

输入公司名称或股票代码,自动并行采集五个维度的数据,综合分析后输出标准报告。
Enter the company name or stock ticker, and data from five dimensions will be automatically collected in parallel. A standard report will be output after comprehensive analysis.

When to Use

When to Use

当用户请求以下操作时触发:
  • "分析腾讯" / "分析贵州茅台" / "分析 600519"
  • "analyze NVDA" / "analyze Tesla"
  • "XX股票怎么样" / "XX最近为什么涨/跌"
  • "帮我看看XX" / "XX值得买吗"
Triggered when the user requests the following operations:
  • "Analyze Tencent" / "Analyze Kweichow Moutai" / "Analyze 600519"
  • "analyze NVDA" / "analyze Tesla"
  • "How is XX stock performing?" / "Why has XX risen/fallen recently?"
  • "Help me check XX" / "Is XX worth buying?"

Phase 0: 解析输入

Phase 0: Parse Input

根据用户输入,识别以下信息:
  1. 公司名称与股票代码
    • 如果用户给了代码则直接使用
    • 如果用户给了公司名,通过 WebSearch 查询对应代码
    • A股代码格式: 6位数字 (600519, 000858)
    • 美股代码格式: 英文字母 (NVDA, AAPL, TSLA)
  2. 识别市场类型
    • 6位纯数字 → A股
    • 英文字母 → 美股
    • 公司名含中文且为中国公司 → A股
    • 其他 → 美股
  3. 确定关键变量 (后续所有 Agent 都需要用到)
    • {ticker}
      : 股票代码
    • {company_name}
      : 公司全称
    • {company_name_en}
      : 公司英文名 (美股用)
    • {market}
      : "A股" 或 "美股"
    • {industry}
      : 所属行业
    • {website}
      : 公司官网 URL
如果无法确定官网或行业,先用一次 WebSearch 快速查询,不要跳过这一步

Identify the following information based on user input:
  1. Company Name and Stock Ticker
    • Use the ticker directly if provided by the user
    • If the user provides a company name, query the corresponding ticker via WebSearch
    • A-share ticker format: 6-digit number (600519, 000858)
    • U.S. stock ticker format: English letters (NVDA, AAPL, TSLA)
  2. Identify Market Type
    • 6-digit pure number → A-shares
    • English letters → U.S. stocks
    • Chinese company name with Chinese characters → A-shares
    • Others → U.S. stocks
  3. Determine Key Variables (Required by all subsequent Agents)
    • {ticker}
      : Stock ticker
    • {company_name}
      : Full company name
    • {company_name_en}
      : English company name (for U.S. stocks)
    • {market}
      : "A-shares" or "U.S. stocks"
    • {industry}
      : Belonging industry
    • {website}
      : Official company website URL
If the official website or industry cannot be determined, perform a quick WebSearch first, do not skip this step.

Phase 1: 并行数据采集 (5 个 Subagent)

Phase 1: Parallel Data Collection (5 Subagents)

关键要求: 以下 5 个 Task 必须放在同一条消息中发出,确保并行执行。
每个 Agent 使用
subagent_type: "general-purpose"

Key Requirement: The following 5 Tasks must be sent in the same message to ensure parallel execution.
Each Agent uses
subagent_type: "general-purpose"
.

Agent 1: 股价数据与技术指标

Agent 1: Stock Price Data and Technical Indicators

description: "采集{ticker}股价数据"
prompt 模板:
你是股价数据分析师。请获取 {company_name}({ticker}) 近7个交易日的股价数据。

任务:
1. 使用 WebSearch 搜索 "{ticker} stock price last 7 days {market}" 获取最近行情
2. 整理以下信息:
   - 近7个交易日每日收盘价和涨跌幅
   - 7天累计涨跌幅
   - 当前价格
   - 成交量变化趋势 (放量/缩量)
   - 关键技术信号 (如有: 均线多空排列、RSI超买超卖、明显支撑位/阻力位)
   - 与大盘同期涨跌幅对比

输出要求:
- 以结构化格式返回
- 重点突出: 7天涨跌幅、量价配合情况、技术面关键信号
- 控制在 500 字以内
- 不要给出投资建议
如果是 A股,且 akshare 已安装,可额外在 prompt 中指示:
如果可用,执行以下命令获取精确数据:
python {baseDir}/scripts/data_fetcher.py --code {ticker} --data-type valuation

description: "Collect {ticker} stock price data"
Prompt Template:
You are a stock price data analyst. Please obtain the stock price data of {company_name}({ticker}) for the last 7 trading days.

Tasks:
1. Use WebSearch to search "{ticker} stock price last 7 days {market}" to get the latest market data
2. Organize the following information:
   - Daily closing prices and price changes for the last 7 trading days
   - Cumulative price change over 7 days
   - Current price
   - Trading volume trend (increasing/decreasing/flat)
   - Key technical signals (if any: moving average bullish/bearish arrangement, RSI overbought/oversold, obvious support/resistance levels)
   - Comparison with the market's price change during the same period

Output Requirements:
- Return in a structured format
- Highlight: 7-day price change, volume-price coordination, key technical signals
- Keep within 500 words
- Do not provide investment advice
If it's A-shares and akshare is installed, you can additionally add the following instruction to the prompt:
If available, execute the following command to obtain accurate data:
python {baseDir}/scripts/data_fetcher.py --code {ticker} --data-type valuation

Agent 2: 新闻舆论分析

Agent 2: News Sentiment Analysis

description: "搜索{company_name}近期新闻"
prompt 模板:
你是财经新闻分析师。请搜索 {company_name}({ticker}) 最近7天的重要新闻和舆论。

任务:
1. 使用 WebSearch 搜索以下关键词 (至少搜2次不同关键词):
   - "{company_name} 最新新闻" 或 "{company_name} latest news"
   - "{ticker} 股票 本周" 或 "{ticker} stock this week"
2. 从搜索结果中挑选 3-5 条最重要的新闻
3. 使用 WebFetch 访问其中至少 2 条新闻的原文,验证内容真实性
4. 分析舆论整体倾向

输出要求:
- 列出 3-5 条关键新闻,每条包含: 日期、标题、来源、简要内容(1-2句)
- 整体舆论倾向判断: 正面 / 负面 / 中性,并说明理由
- 识别是否有重大事件 (财报发布、政策变化、管理层变动、产品发布、诉讼等)
- 控制在 600 字以内

description: "Search recent news about {company_name}"
Prompt Template:
You are a financial news analyst. Please search for important news and public opinion about {company_name}({ticker}) in the last 7 days.

Tasks:
1. Use WebSearch to search the following keywords (at least 2 different keyword combinations):
   - "{company_name} latest news" or "{company_name} latest news"
   - "{ticker} stock this week" or "{ticker} stock this week"
2. Select 3-5 most important news items from the search results
3. Use WebFetch to access at least 2 of the original news articles to verify content authenticity
4. Analyze the overall sentiment of public opinion

Output Requirements:
- List 3-5 key news items, each including: date, title, source, brief content (1-2 sentences)
- Overall sentiment judgment: Positive / Negative / Neutral, with reasons
- Identify whether there are major events (earnings release, policy changes, management changes, product launches, lawsuits, etc.)
- Keep within 600 words

Agent 3: 行业对比分析

Agent 3: Industry Comparison Analysis

description: "分析{industry}行业情况"
prompt 模板:
你是行业分析师。请分析 {company_name}({ticker}) 所在的 {industry} 行业近期情况。

任务:
1. 使用 WebSearch 搜索:
   - "{industry} 行业 近期趋势" 或 "{industry} industry trends"
   - "{company_name} 竞争对手" 或 "{company_name} competitors"
2. 整理以下信息:
   - 行业近期整体趋势 (上升/下行/平稳)
   - 影响行业的关键因素 (政策、技术、需求等)
   - 2-3 个主要竞争对手的近期股价表现
   - {company_name} 在行业中的大致地位

输出要求:
- 行业趋势概述 (2-3句)
- 竞争格局简表: 公司名、近7天涨跌、关键动态
- 该公司的相对优劣势 (1-2条)
- 控制在 500 字以内

description: "Analyze the {industry} industry situation"
Prompt Template:
You are an industry analyst. Please analyze the recent situation of the {industry} industry where {company_name}({ticker}) operates.

Tasks:
1. Use WebSearch to search:
   - "{industry} industry recent trends" or "{industry} industry trends"
   - "{company_name} competitors" or "{company_name} competitors"
2. Organize the following information:
   - Recent overall industry trend (rising/falling/stable)
   - Key factors affecting the industry (policies, technology, demand, etc.)
   - Recent stock price performance of 2-3 main competitors
   - General position of {company_name} in the industry

Output Requirements:
- Industry trend overview (2-3 sentences)
- Competitive landscape summary table: Company name, 7-day price change, key developments
- Relative strengths and weaknesses of the company (1-2 points)
- Keep within 500 words

Agent 4: 市场环境分析

Agent 4: Market Environment Analysis

description: "分析当前市场环境"
prompt 模板:
你是宏观市场分析师。请分析当前全球市场环境,重点关注与 {company_name}({ticker}) 相关的市场因素。

任务:
1. 使用 WebSearch 搜索最新市场数据:
   - 主要指数近期走势: {如果A股: "上证指数 深证成指 创业板指 本周"; 如果美股: "S&P 500 NASDAQ Dow Jones this week"}
   - "VIX index today" (恐慌指数)
   - 近期重大宏观事件或央行动态
2. 评估:
   - 大盘趋势方向: 上涨 / 下跌 / 震荡
   - 市场情绪: Risk-on (追逐风险) / Risk-off (规避风险)
   - VIX 水平及含义
   - 是否有重大宏观事件影响

输出要求:
- 市场环境一句话总结
- 大盘指数近7天表现 (涨跌幅)
- VIX 水平和波动率判断
- 影响当前市场的 1-2 个关键因素
- 控制在 400 字以内

description: "Analyze the current market environment"
Prompt Template:
You are a macro market analyst. Please analyze the current global market environment, focusing on market factors related to {company_name}({ticker}).

Tasks:
1. Use WebSearch to search the latest market data:
   - Recent trends of major indices: {If A-shares: "Shanghai Composite Index, Shenzhen Component Index, ChiNext Index this week"; If U.S. stocks: "S&P 500 NASDAQ Dow Jones this week"}
   - "VIX index today" (Volatility Index)
   - Recent major macro events or central bank dynamics
2. Evaluate:
   - Market trend direction: Rising / Falling / Volatile
   - Market sentiment: Risk-on (risk-seeking) / Risk-off (risk-averse)
   - VIX level and its implication
   - Whether there are major macro events impacting the market

Output Requirements:
- One-sentence summary of the market environment
- 7-day performance of major indices (price change)
- VIX level and volatility judgment
- 1-2 key factors affecting the current market
- Keep within 400 words

Agent 5: 公司官网与公告信息

Agent 5: Official Website and Announcement Information

description: "抓取{company_name}官网信息"
prompt 模板:
你是企业信息研究员。请获取 {company_name}({ticker}) 的官方最新动态。

任务:
1. 使用 WebFetch 访问公司官网: {website}
   - 查看首页是否有最新公告或新闻
2. 使用 WebSearch 搜索 "{company_name} 投资者关系" 或 "{company_name} investor relations"
   - 查找近期公告、财报摘要、业绩预告
3. 如果是上市公司,搜索最近的公告:
   - A股: "{company_name} 公告 巨潮资讯"
   - 美股: "{company_name} SEC filing" 或 "{company_name} earnings"

输出要求:
- 公司最新官方动态 (产品、战略、人事等)
- 最近一次财报/业绩的关键数据 (如有)
- 近期重要公告摘要 (如有)
- 控制在 400 字以内
- 如果官网无法访问,说明情况并依赖搜索结果

description: "Crawl {company_name} official website information"
Prompt Template:
You are a corporate information researcher. Please obtain the latest official updates of {company_name}({ticker}).

Tasks:
1. Use WebFetch to access the company's official website: {website}
   - Check if there are latest announcements or news on the homepage
2. Use WebSearch to search "{company_name} investor relations" or "{company_name} investor relations"
   - Look for recent announcements, earnings summaries, performance forecasts
3. If it's a listed company, search for recent announcements:
   - A-shares: "{company_name} announcement Juchao Information"
   - U.S. stocks: "{company_name} SEC filing" or "{company_name} earnings"

Output Requirements:
- Latest official company developments (products, strategies, personnel, etc.)
- Key data from the latest earnings report/performance (if available)
- Summary of recent important announcements (if any)
- Keep within 400 words
- If the official website is inaccessible, state the situation and rely on search results

Phase 2: 综合分析 (主线程)

Phase 2: Comprehensive Analysis (Main Thread)

等待 5 个 Agent 全部返回后,在主线程中完成以下分析。
Wait for all 5 Agents to return results, then complete the following analysis in the main thread.

Step 1: 信息汇总

Step 1: Information Summary

将 5 个 Agent 的结果整合,识别:
  • 各维度之间的 一致性信号 (如: 股价涨 + 新闻利好 + 行业向上 = 强看多)
  • 各维度之间的 矛盾信号 (如: 股价涨但新闻利空 = 可能存在隐患)
Integrate the results of the 5 Agents to identify:
  • Consistent signals between dimensions (e.g., rising stock price + positive news + upward industry trend = strong bullish signal)
  • Contradictory signals between dimensions (e.g., rising stock price but negative news = potential risks may exist)

Step 2: 因果归因

Step 2: Causal Attribution

分析近7天股价变动的原因,按影响力排序:
  1. 直接驱动因素: 公司层面事件 (财报、公告、产品、舆论)
  2. 行业传导因素: 行业政策、竞争格局变化
  3. 市场环境因素: 大盘走势、资金面、宏观事件
Analyze the reasons for stock price changes in the last 7 days, sorted by influence:
  1. Direct driving factors: Company-level events (earnings, announcements, products, public opinion)
  2. Industry transmission factors: Industry policies, changes in competitive landscape
  3. Market environment factors: Market trend, capital flow, macro events

Step 3: 趋势预测

Step 3: Trend Prediction

基于以上分析,给出:
  • 短期展望 (1-2周): 考虑技术面信号 + 即将到来的事件
  • 中期展望 (1-3月): 考虑基本面 + 行业趋势
  • 主要风险点: 可能导致走势反转的因素

Based on the above analysis, provide:
  • Short-term outlook (1-2 weeks): Consider technical signals + upcoming events
  • Medium-term outlook (1-3 months): Consider fundamentals + industry trends
  • Main risk points: Factors that may lead to trend reversal

Phase 3: 输出报告

Phase 3: Output Report

按以下格式输出最终报告:
markdown
undefined
Output the final report in the following format:
markdown
undefined

{company_name} ({ticker}) 综合分析报告

{company_name} ({ticker}) Comprehensive Analysis Report

分析日期: {date} | 分析周期: 近7个交易日 | 市场: {market}
Analysis Date: {date} | Analysis Period: Last 7 Trading Days | Market: {market}

一句话总结

One-Sentence Summary

{用一句话概括当前状况和核心判断}

{Summarize the current situation and core judgment in one sentence}

一、股价概览

I. Stock Price Overview

指标数值
当前价格¥/$XXX
7日涨跌幅+/-X.XX%
同期大盘+/-X.XX%
成交量趋势放量/缩量/持平
技术面信号XXX
IndicatorValue
Current Price¥/$XXX
7-Day Price Change+/-X.XX%
Corresponding Market+/-X.XX%
Trading Volume TrendIncreasing/Decreasing/Flat
Technical SignalsXXX

二、股价变动原因分析

II. Analysis of Stock Price Change Reasons

直接驱动因素

Direct Driving Factors

  1. ...
  1. ...

行业传导因素

Industry Transmission Factors

  1. ...
  1. ...

市场环境因素

Market Environment Factors

  1. ...
  1. ...

三、近期重要新闻

III. Recent Important News

日期事件影响
......利好/利空/中性
舆论倾向: 正面/负面/中性
DateEventImpact
......Positive/Negative/Neutral
Sentiment Tendency: Positive/Negative/Neutral

四、行业对比

IV. Industry Comparison

公司7日涨跌关键动态
{company_name}......
竞对A......
竞对B......
Company7-Day Price ChangeKey Developments
{company_name}......
Competitor A......
Competitor B......

五、市场环境

V. Market Environment

  • 大盘趋势: ...
  • 市场情绪: Risk-on / Risk-off
  • VIX: XX ({低/正常/高/极高}波动)
  • 关键宏观因素: ...
  • Market Trend: ...
  • Market Sentiment: Risk-on / Risk-off
  • VIX: XX (Low/Normal/High/Extremely High Volatility)
  • Key Macro Factors: ...

六、趋势展望

VI. Trend Outlook

短期 (1-2周)

Short-Term (1-2 Weeks)

  • ...
  • ...

中期 (1-3月)

Medium-Term (1-3 Months)

  • ...
  • ...

主要风险

Main Risks

  1. ...
  2. ...

声明: 本报告由 AI 自动生成,仅供参考,不构成任何投资建议。投资有风险,决策需谨慎。

同时将报告保存为文件: `{company_name}-analysis-{date}.md`,保存在当前工作目录。

---
  1. ...
  2. ...

Disclaimer: This report is automatically generated by AI, for reference only, and does not constitute any investment advice. Investment involves risks, and decisions should be made cautiously.

Also save the report as a file: `{company_name}-analysis-{date}.md` in the current working directory.

---

Error Handling

Error Handling

  • Agent 超时或失败: 如果某个 Agent 未返回结果,在报告中标注该维度为"数据缺失",其余维度照常分析
  • 股票代码无法识别: 提示用户确认代码或公司名称
  • akshare 未安装 (A股): 降级为纯 WebSearch 方式获取数据
  • 官网无法访问: 跳过官网抓取,依赖搜索引擎结果
  • Agent timeout or failure: If an Agent fails to return results, mark the dimension as "Data Missing" in the report, and analyze the remaining dimensions as usual
  • Unrecognizable stock ticker: Prompt the user to confirm the ticker or company name
  • akshare not installed (A-shares): Degrade to using only WebSearch to obtain data
  • Official website inaccessible: Skip crawling the official website and rely on search engine results

Notes

Notes

  • 每个 Agent 的输出严格限制字数,防止主线程上下文溢出
  • 综合分析阶段重在 交叉关联,而非简单罗列
  • 因果分析应区分 "相关" 与 "因果"
  • 趋势预测需明确标注不确定性
  • Strictly limit the output word count of each Agent to prevent main thread context overflow
  • The comprehensive analysis phase focuses on cross-correlation, not simple listing
  • Causal analysis should distinguish between "correlation" and "causality"
  • Trend predictions must clearly indicate uncertainty