SuperAPI AI Directory

stock-analyzer

Data & analytics

View repository

Updated 10-14 11:16

About this skill

Stock Analyzer Skill

Value investing-oriented stock analysis tool, integrating the investment philosophies of Buffett and Duan Yongping.

✅ Currently built into the script:Buffett/Duan Yongping qualitative assessment + five-dimensional value investing framework, with output automatically generated according to a unified template.

Core Philosophy

💡 Buy the company, not the stock — Duan Yongping
💡 Be friends with time — Hold high-quality companies for the long term
💡 Left-side trading — Be greedy when others are fearful

📚 Analysis Methodology

For the detailed five-dimensional value investing analysis methodology, see: METHODOLOGY.md

This methodology includes:

  • 🧭 Buffett + Duan Yongping "good company" qualitative assessment (business/profit model/corporate culture)
  • 📊 Market environment and event-driven analysis
  • 🗓️ Market clock (midterm election cycle / holiday effect / monthly seasonality)
  • 🛡️ Defensive stock watchlist for downturns (investable targets by industry)
  • 📞 Options cash flow rules: layered positioning in out-of-the-money Long Calls, scale out in batches at 50%-100% unrealized gains and recycle into the underlying stock
  • 🏰 Duan Yongping five-dimensional moat scoring model
  • 💰 Per-share cash flow (FCF/OCF) in-depth analysis framework
  • 📈 Multi-dimensional valuation using forward P/E and PEG
  • 🎯 Three-stage DCF model and sensitivity analysis
  • 📝 Standardized analysis report template (including company business, profit model, corporate culture)

Two analysis tools

1. analyze-stock - Basic analysis

# 快速分析
analyze-stock AAPL
analyze-stock AMZN

# 保存报告
analyze-stock TSLA --save

# 不同格式
analyze-stock NVDA --format json

2. analyze-value - Value investing analysis (recommended)

# 价值投资深度分析
analyze-value AMZN
analyze-value AAPL
analyze-value 1810.HK

# 保存详细报告
analyze-value TSLA --save
analyze-value META --format md

3. analyze-earnings - Earnings interpretation workflow (official sources first)

# 生成任意公司的财报解读工作流报告(可复用)
analyze-earnings COIN
analyze-earnings AAPL --out /tmp/aapl-earnings.md

# 同时输出原始JSON,方便后续自动化处理
analyze-earnings MSFT --json

# 指定公司名(用于IR入口候选URL)
analyze-earnings BRK.B --company "Berkshire Hathaway"

analyze-value special features

0. Buffett + Duan Yongping good company assessment (new)

  • Company business: Explain in one sentence what the company sells, who its customers are, and where growth comes from
  • Profit model: Revenue structure, profit structure, cash flow sources, Capex attributes
  • Corporate culture: Management long-termism, capital allocation discipline, organizational execution culture
  • Four questions and four looks: Buffett's four questions + Duan Yongping's four looks, first determine "whether it is a good company"

1. Detailed forward P/E analysis

  • Current P/E: specific value + industry comparison
  • Historical P/E range: TTM vs Forward
  • Valuation assessment: 6-level scoring system (significantly undervalued → severely overvalued)
  • Industry comparison: percentage relative to industry average

2. Detailed cash flow analysis

  • FCF calculation process: OCF - CapEx = FCF
  • FCF per share: specific value + P/FCF ratio
  • FCF yield: compared with Treasury yields
  • Cash flow quality: 4-level evaluation system

3. Fundamental five-dimensional analysis

  • ROE/ROA: capital return efficiency
  • Gross margin/Net margin: Profitability
  • Debt-to-asset ratio: Financial health
  • Operating cash flow/Net income: Cash flow quality

4. Free cash flow per share (FCF per share)

  • Annual FCF: Total + per-share calculation
  • P/FCF valuation: Compare with industry
  • Historical trend: Changes over the past 3 years
  • Dividend capacity: FCF/Net income ratio

5. Detailed PEG valuation analysis

  • PEG calculation: Forward P/E ÷ EPS growth rate
  • Multiple time dimensions: 1-year/2-year PEG comparison
  • Benchmark comparison: Use PEG=1.0 as the benchmark
  • Investment value rating: 5-level scoring system

6. Detailed DCF valuation analysis

  • Three-stage model: High growth (3 years) → Medium growth (2 years) → Perpetual growth
  • Transparent parameters: FCF base value, growth rate, WACC, perpetual growth rate
  • Sensitivity analysis: 9 scenario combinations
  • Valuation range: Minimum-Maximum-Average intrinsic value

7. Value estimation for the next 1-5 years

• 1年后: $XXX (年化回报: +XX%) → 评价
• 3年后: $XXX (年化回报: +XX%) → 评价  
• 5年后: $XXX (年化回报: +XX%) → 评价

8. Left-side trading execution plan

目标仓位: 5-10%

• 第一批 (试仓20%): $价格区间 + 条件
• 第二批 (加仓30%): $价格区间 + 条件
• 重仓区 (35%): $价格区间 + 条件
• 极端区 (15%): <$价格 + 条件

9. "Time is a friend" holding logic

Automatically generate investment rationale in the style of Buffett/Duan Yongping:

  • Moat protects long-term competitiveness
  • ROE shows capital return capability
  • Free cash flow creates value
  • Sufficient margin of safety
  • Long-term holding for compound growth

10. Short-term options and implied volatility analysis (new)

  • Call/Put volume of the nearest-expiry options
  • Put/Call volume ratio and open interest ratio
  • Average implied volatility (IV) near ATM
  • Used to assist in judging short-term sentiment and volatility risk

11. Options cash flow strategy (user rules)

  • ThroughOut-of-the-money Long Call for layered positioning (default 10% / 20% OTM two tiers)
  • Expiration structure:At least 6 months, preferably more than 12 months(LEAPS may be used)
  • Output requirement: providespecific contract price levels(expiration date + strike price), not just a range
  • When the Long Call unrealized profit reaches +50%: Scale out in batches (about 30%-50%) to lock in cash flow
  • When the Long Call unrealized profit reaches +100%: Further reduce to a base position or take profit entirely
  • Profits taken are preferentially returned to the left-side accumulation zone for the underlying stock, forming a closed loop of "options cash flow → underlying stock reinvestment"

Example output

$ analyze-value AMZN

🔍 正在进行价值投资分析: AMZN...
💡 理念: 买公司,不是买股票 | 和时间做朋友 | 左侧交易

============================================================================
📊 Amazon.com Inc (AMZN) 价值投资分析报告
============================================================================

【核心数据】
• 股价: $205.5 | 市值: $2206.0B
• 52周区间: $164.4 - $246.6
• Forward P/E: 22.1x

【巴菲特式估值】
• DCF内在价值: $280.5
• 安全边际: +36.5%
  ✅ 安全边际充足 (>20%),符合巴菲特标准

【护城河分析】(段永平五维)
• 网络效应: ⭐⭐⭐⭐⭐
• 品牌护城河: ⭐⭐⭐⭐
• 技术护城河: ⭐⭐⭐⭐
• 成本优势: ⭐⭐⭐⭐⭐
• 切换成本: ⭐⭐⭐⭐⭐
• 综合评级: 极宽护城河 (4.4/5.0)

【未来1-5年价值估算】
• 1年后: $224.5 (年化回报: +9.2%)
• 3年后: $290.3 (年化回报: +12.1%)
• 5年后: $368.8 (年化回报: +12.4%)

【五维评分】
1. 估值/安全边际: ⭐⭐⭐⭐⭐
2. 护城河: ⭐⭐⭐⭐⭐
3. 现金流: ⭐⭐⭐⭐
4. 盈利能力: ⭐⭐⭐⭐⭐
5. 增长潜力: ⭐⭐⭐⭐
   综合评分: 4.4/5.0

【投资评级】
🎯 BUY ⭐⭐⭐⭐⭐

【左侧交易执行计划】
• 第一批 (试仓20%): $195-$215
• 第二批 (加仓30%): $175-$195
• 重仓区 (35%): $165-$175
• 极端区 (15%): <$165

【"时间是朋友"持有逻辑】
1. 极宽护城河保护企业长期竞争力
2. ROE 22.3% 显示优秀的资本回报能力
3. $32.2B 年自由现金流,为股东创造价值
4. 以低于内在价值 36% 的价格买入,安全边际充足
5. 持有3-5年,让企业价值复合增长

Five-dimensional scoring system

Dimension Weight Evaluation criteria
Valuation/Margin of safety 20% DCF intrinsic value vs current price
Moat 20% Five-dimensional moat score
Cash flow 20% FCF health
Profitability 20% ROE, ROA, profit margin
Growth potential 20% EPS growth expectation

Investment rating criteria

Overall Score Margin of Safety Rating Action Recommendation
≥4.5 >20% STRONG BUY ⭐⭐⭐⭐⭐ Heavy Buy
≥4.0 >10% BUY ⭐⭐⭐⭐ Build Position in Batches
≥3.5 - HOLD ⭐⭐⭐ Hold and Observe
<3.5 - AVOID ⭐⭐ Avoid

Install

# 确保依赖已安装
pip install yahooquery

# 添加到 PATH
export PATH="$HOME/.openclaw/workspace/skills/stock-analyzer:$PATH"

Data Sources

  • Yahoo Finance (via yahooquery)
  • SEC EDGAR submissions API (for the latest 8-K/10-Q/10-K list; if rate-limited, it will be noted in the report)
  • Company Investor Relations pages (via candidate entry points in the workflow + manual verification in a browser)
  • Real-time stock price, financial data, analyst forecasts

Disclaimer

This tool provides analytical reference based on the value investing philosophy and does not constitute investment advice. Investing involves risk; exercise caution when entering the market.

Please Remember:

  • All valuation models have limitations
  • DCF depends on assumptions about future growth
  • Please make decisions based on your own risk tolerance
  • Long-term holding requires a deep understanding of the company

🕰️ "Time is the friend of the wonderful company, the enemy of the mediocre." — Warren Buffett