Files
Yaojia Wang e798fce6a8
All checks were successful
continuous-integration/drone/push Build is passing
feat: add quant layer, portfolio-review, and strategy-backtest skills
fundamental-analysis: added statistical risk layer
- normality test (Jarque-Bera) — validates Sharpe/VaR reliability
- unit root test (ADF) — validates technical analysis applicability
- rolling skew/kurtosis — tail risk monitoring
- interpretation rules for crash risk detection

portfolio-review (NEW): portfolio health check and similarity search
- HRP optimization, correlation matrix, risk parity weights
- t-SNE clustering for hidden correlations
- stock similarity search for diversification
- rule-engine BUY_MORE/HOLD/SELL per holding

strategy-backtest (NEW): historical strategy validation
- SMA crossover, RSI mean-reversion, buy-and-hold, momentum
- comparison framework with Sharpe, max DD, win rate
- validation workflow for trade-analyze recommendations

Coverage: 67% → 79% of API endpoints (104/131)
2026-03-21 19:19:40 +01:00

5.3 KiB

name, description, user-invocable, metadata
name description user-invocable metadata
fundamental-analysis Professional fundamental analysis — valuation, growth quality, financial health, risk metrics, institutional positioning via openbb-invest-api true
openclaw
emoji requires
📋
bins
curl

Fundamental Analysis

Generate a professional-grade fundamental analysis. Think like a buy-side equity analyst.

Data Collection

BASE=https://invest-api.k8s.home

# Company overview (quote + profile + metrics + financials in one call)
curl -sk "$BASE/api/v1/stock/{TICKER}/summary"

# Analyst consensus estimates
curl -sk "$BASE/api/v1/stock/{TICKER}/estimates"

# Analyst upgrades/downgrades with price targets
curl -sk "$BASE/api/v1/stock/{TICKER}/upgrades"

# Analyst buy/hold/sell counts
curl -sk "$BASE/api/v1/stock/{TICKER}/recommendations"

# Quantitative risk: Sharpe, volatility, max drawdown
curl -sk "$BASE/api/v1/stock/{TICKER}/performance?days=365"

# CAPM: beta, alpha, systematic vs idiosyncratic risk
curl -sk "$BASE/api/v1/stock/{TICKER}/capm"

# Sortino ratio (downside risk — better than Sharpe for asymmetric returns)
curl -sk "$BASE/api/v1/stock/{TICKER}/sortino?days=365"

# Omega ratio (full distribution gain/loss)
curl -sk "$BASE/api/v1/stock/{TICKER}/omega?days=365"

# Normality test (are returns normally distributed? If not, Sharpe/VaR underestimates risk)
curl -sk "$BASE/api/v1/stock/{TICKER}/normality?days=365"

# Unit root test (does the price have a trend, or is it random walk?)
curl -sk "$BASE/api/v1/stock/{TICKER}/unitroot?days=365"

# Rolling skewness (negative skew = increasing downside tail risk)
curl -sk "$BASE/api/v1/stock/{TICKER}/rolling/skew?days=365&window=30"

# Rolling kurtosis (high = fat tails, extreme moves more likely)
curl -sk "$BASE/api/v1/stock/{TICKER}/rolling/kurtosis?days=365&window=30"

# Share statistics (float, shares outstanding, short % of float)
curl -sk "$BASE/api/v1/stock/{TICKER}/share-statistics"

# Institutional holders (13F — who's buying/selling)
curl -sk "$BASE/api/v1/stock/{TICKER}/institutional"

# Dividend history (if applicable)
curl -sk "$BASE/api/v1/stock/{TICKER}/dividends"

# Upcoming earnings date
curl -sk "$BASE/api/v1/calendar/earnings?start_date=$(date +%Y-%m-%d)&end_date=$(date -d '+30 days' +%Y-%m-%d 2>/dev/null || date -v+30d +%Y-%m-%d)"

Report Structure

## {TICKER} Fundamental Analysis — {date}

### Valuation
- P/E: {value} vs S&P 500 avg (~22) — [cheap / fair / rich]
- P/B: {value}
- EV/EBITDA: {if available}
- Price vs consensus target: ${current} vs ${target} ({upside/downside}%)
- Price target range: ${low} — ${high}

### Growth Quality
- Revenue YoY: {%} — trend [accelerating / decelerating / stable]
- EPS YoY: {%}
- ROE: {%} — [excellent >20% / strong >15% / moderate >10% / weak <10%]
- ROA: {%}
- Net margin: {%} — [expanding / compressing]
- Forward estimates: {consensus EPS for next quarter/year}

### Financial Health
- Debt-to-Equity: {ratio} — [conservative <0.5 / moderate / leveraged >1.5]
- Current Ratio: {ratio} — [healthy >1.5 / tight <1.0]
- Free Cash Flow: {trend and magnitude}
- Cash position: {if available}

### Risk Profile
- Beta: {value} — [defensive <0.8 / market ~1.0 / aggressive >1.2]
- CAPM alpha: {%} — [outperforming / underperforming vs market]
- Sharpe (1Y): {value} — [poor <0.5 / good >1.0 / excellent >2.0]
- Sortino (1Y): {value} — Sortino > Sharpe suggests positive skew (good)
- Max drawdown (1Y): {%}
- Omega ratio: {value}

### Statistical Risk (Quant Layer)
- Normality: {Jarque-Bera p-value} — [normal (p>0.05): Sharpe/VaR reliable / non-normal (p<0.05): use Sortino/Omega instead]
- Unit root (ADF): {p-value} — [trend present (p<0.05): technicals valid / random walk (p>0.05): technicals unreliable]
- Rolling skew (30d): {latest value} — [negative = growing downside tail / positive = upside tail / near 0 = symmetric]
- Rolling kurtosis (30d): {latest value} — [>3 = fat tails, extreme moves likely / <3 = thin tails, well-behaved]
- ⚠️ If non-normal + negative skew + high kurtosis = **elevated crash risk**, reduce position size

### Institutional & Ownership
- Float: {shares} ({% of total})
- Short % of float: {%} — [low <5% / moderate / high >15%]
- Top institutional holders: {names if available}
- Recent institutional activity: [net buying / net selling / stable]

### Analyst Consensus
- Ratings: {strong buy} strong buy / {buy} buy / {hold} hold / {sell} sell
- Recent actions: {last 2-3 upgrades/downgrades with firm names}
- Upcoming earnings: {date if within 30 days — FLAG if within 7 days}

### Dividend (if applicable)
- Yield: {%}
- Payout ratio: {%}
- Growth streak: {years}

### Signal: [BULLISH / BEARISH / NEUTRAL]
### Confidence: {1-10}
### Key Risk: {one-line}

Rules

  • Use ONLY data from API responses
  • Compare metrics to sector peers, not just absolute thresholds
  • Flag earnings within 7 days as a major catalyst/risk
  • Sortino > Sharpe for stocks with asymmetric return profiles
  • High short interest + upcoming catalyst = potential squeeze
  • If normality test fails: Sharpe/VaR are unreliable, emphasize Sortino and Omega instead
  • If unit root test fails (random walk): de-emphasize technical signals in your assessment
  • Negative rolling skew + high kurtosis = crash risk flag — recommend smaller position
  • Keep under 600 words