Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Fetch daily multi-ticker stock data with RSI, Bollinger Bands, Stochastic, and BUY/HOLD/SELL signals.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
SKILL.md
1---2name: stock-analysis3description: Analyze stocks and cryptocurrencies using Yahoo Finance data. Supports portfolio management (create, add, remove assets), crypto analysis (Top 20 by market cap), and periodic performance reports (daily/weekly/monthly/quarterly/yearly). 8 analysis dimensions for stocks, 3 for crypto. Use for stock analysis, portfolio tracking, earnings reactions, or crypto monitoring.4homepage: https://finance.yahoo.com5metadata: {"clawdbot":{"emoji":"๐","requires":{"bins":["uv"],"env":[]},"install":[{"id":"uv-brew","kind":"brew","formula":"uv","bins":["uv"],"label":"Install uv (brew)"}]}}6---78# Stock Analysis (v5.0)910Analyze US stocks and cryptocurrencies using Yahoo Finance data. Includes portfolio management, crypto support, and periodic analysis.1112## Quick Start1314**IMPORTANT:** Pass ONLY the stock ticker symbol(s) as arguments. Do NOT add extra text, headers, or formatting in the command.1516Analyze a single ticker:1718```bash19uv run {baseDir}/scripts/analyze_stock.py AAPL20uv run {baseDir}/scripts/analyze_stock.py MSFT --output json21```2223Compare multiple tickers:2425```bash26uv run {baseDir}/scripts/analyze_stock.py AAPL MSFT GOOGL27```2829## Cryptocurrency Analysis (v5.0)3031Analyze top 20 cryptocurrencies by market cap:3233```bash34uv run {baseDir}/scripts/analyze_stock.py BTC-USD35uv run {baseDir}/scripts/analyze_stock.py ETH-USD SOL-USD36```3738**Supported Cryptos:**39BTC-USD, ETH-USD, BNB-USD, SOL-USD, XRP-USD, ADA-USD, DOGE-USD, AVAX-USD, DOT-USD, MATIC-USD, LINK-USD, ATOM-USD, UNI-USD, LTC-USD, BCH-USD, XLM-USD, ALGO-USD, VET-USD, FIL-USD, NEAR-USD4041**Crypto Analysis Dimensions:**42- Market cap (large/mid/small classification)43- Category (Smart Contract L1, DeFi, Payment, etc.)44- BTC correlation (30-day)45- Momentum (RSI, price range)46- Market context (VIX, general market regime)4748## Portfolio Management (v5.0)4950Create and manage portfolios with mixed assets (stocks + crypto):5152```bash53# Create portfolio54uv run {baseDir}/scripts/portfolio.py create "My Portfolio"5556# Add assets57uv run {baseDir}/scripts/portfolio.py add AAPL --quantity 100 --cost 150.0058uv run {baseDir}/scripts/portfolio.py add BTC-USD --quantity 0.5 --cost 40000 --portfolio "My Portfolio"5960# View holdings with current P&L61uv run {baseDir}/scripts/portfolio.py show6263# Update/remove assets64uv run {baseDir}/scripts/portfolio.py update AAPL --quantity 15065uv run {baseDir}/scripts/portfolio.py remove BTC-USD6667# List/delete portfolios68uv run {baseDir}/scripts/portfolio.py list69uv run {baseDir}/scripts/portfolio.py delete "My Portfolio"70```7172**Portfolio Storage:** `~/.clawdbot/skills/stock-analysis/portfolios.json`7374## Portfolio Analysis (v5.0)7576Analyze all assets in a portfolio with optional period returns:7778```bash79# Analyze portfolio80uv run {baseDir}/scripts/analyze_stock.py --portfolio "My Portfolio"8182# With period returns (daily/weekly/monthly/quarterly/yearly)83uv run {baseDir}/scripts/analyze_stock.py --portfolio "My Portfolio" --period weekly84uv run {baseDir}/scripts/analyze_stock.py -p "My Portfolio" --period monthly85```8687**Portfolio Summary includes:**88- Total cost, current value, P&L89- Period return (if specified)90- Concentration warnings (>30% in single asset)91- Recommendation summary (BUY/HOLD/SELL counts)9293**Examples:**94- โ CORRECT: `uv run {baseDir}/scripts/analyze_stock.py BAC`95- โ CORRECT: `uv run {baseDir}/scripts/analyze_stock.py BTC-USD`96- โ WRONG: `uv run {baseDir}/scripts/analyze_stock.py === BANK OF AMERICA (BAC) - Q4 2025 EARNINGS ===`97- โ WRONG: `uv run {baseDir}/scripts/analyze_stock.py "Bank of America"`9899Use the ticker symbol only (e.g., BAC, not "Bank of America"). For crypto, use the -USD suffix (e.g., BTC-USD).100101## Analysis Components102103The script evaluates eight key dimensions:1041051. **Earnings Surprise (30% weight)**: Actual vs expected EPS, revenue beats/misses1062. **Fundamentals (20% weight)**: P/E ratio, profit margins, revenue growth, debt levels1073. **Analyst Sentiment (20% weight)**: Consensus ratings, price target vs current price1084. **Historical Patterns (10% weight)**: Past earnings reactions, volatility1095. **Market Context (10% weight)**: VIX, SPY/QQQ trends, market regime1106. **Sector Performance (15% weight)**: Stock vs sector comparison, sector trends1117. **Momentum (15% weight)**: RSI, 52-week range, volume, relative strength1128. **Sentiment Analysis (10% weight)**: Fear/Greed Index, short interest, VIX term structure, insider trading, put/call ratio113114**Sentiment Sub-Indicators:**115- **Fear & Greed Index (CNN)**: Contrarian signal (extreme fear = buy opportunity, extreme greed = caution)116- **Short Interest**: High shorts + squeeze potential = bullish; justified shorts = bearish117- **VIX Term Structure**: Contango = complacency/bullish; backwardation = stress/bearish118- **Insider Activity**: Net buying/selling from SEC Form 4 filings (90-day window)119- **Put/Call Ratio**: High ratio = excessive fear/bullish; low ratio = complacency/bearish120121Weights auto-normalize if some components unavailable.122123**Special Timing Checks:**124- Pre-earnings warning (< 14 days): Recommends HOLD instead of BUY125- Post-earnings spike detection (> 15% in 5 days): Flags "gains priced in"126- Overbought conditions (RSI > 70 + near 52w high): Reduces confidence127128## Timing Warnings & Risk Flags129130The script detects high-risk scenarios:131132### Earnings Timing133- **Pre-Earnings Period**: If earnings < 14 days away, BUY signals become HOLD134- **Post-Earnings Spike**: If stock up > 15% in 5 days after earnings, warns "gains may be priced in"135136### Technical Risk137- **Overbought Conditions**: RSI > 70 + near 52-week high = high-risk entry138139### Market Risk140- **High VIX**: Market fear (VIX > 30) reduces confidence in BUY signals141- **Risk-Off Mode (v4.0.0)**: When safe-havens (GLD, TLT, UUP) rise together, reduces BUY confidence by 30%142- Detects flight to safety across gold, treasuries, and USD143- Triggers when GLD โฅ +2%, TLT โฅ +1%, UUP โฅ +1% (5-day change)144145### Sector Risk146- **Sector Weakness**: Stock may look good but sector is rotating out147148### Geopolitical Risk (v4.0.0)149The script now scans breaking news (last 24h) for crisis keywords and automatically flags affected stocks:150151- **Taiwan Conflict**: Semiconductors (NVDA, AMD, TSM, INTC, etc.) โ 30% confidence penalty152- **China Tensions**: Tech/Consumer (AAPL, QCOM, NKE, SBUX, etc.) โ 30% confidence penalty153- **Russia-Ukraine**: Energy/Materials (XOM, CVX, MOS, CF, etc.) โ 30% confidence penalty154- **Middle East**: Oil/Defense (XOM, LMT, RTX, etc.) โ 30% confidence penalty155- **Banking Crisis**: Financials (JPM, BAC, WFC, C, etc.) โ 30% confidence penalty156157If a ticker is not in the affected list but its sector is exposed, applies a 15% confidence penalty.158159**Example Alert:**160```161โ ๏ธ SECTOR RISK: Tech supply chain and consumer market exposure (detected: china, tariff)162```163164### Breaking News Alerts (v4.0.0)165- Scans Google News RSS for crisis keywords (war, recession, sanctions, disasters, etc.)166- Displays up to 2 breaking news alerts in caveats (last 24 hours)167- Uses 1-hour cache to avoid excessive API calls168169## Output Format170171**Default (text)**: Concise buy/hold/sell signal with 3-5 bullet points and caveats172173**JSON**: Structured data with scores, metrics, and raw data for further analysis174175## Limitations176177- **Data freshness**: Yahoo Finance may lag 15-20 minutes178- **Sentiment data staleness**:179- Short interest data lags ~2 weeks (FINRA reporting schedule)180- Insider trades may lag filing by 2-3 days181- VIX term structure only updates during futures trading hours182- **Breaking news limitations (v4.0.0)**:183- Google News RSS may lag by 15-60 minutes184- Keyword matching may have false positives/negatives185- Does not analyze sentiment, only detects keywords186- 1-hour cache means alerts may be slightly stale187- **Missing data**: Not all stocks have analyst coverage, options chains, or complete fundamentals188- **Execution time**: 3-5s per stock with async parallel fetching and caching (shared indicators cached for 1h)189- **Disclaimer**: All outputs include prominent "not financial advice" warning190- **US markets only**: Non-US tickers may have incomplete data191192## Error Handling193194The script gracefully handles:195- Invalid tickers โ Clear error message196- Missing analyst data โ Signal based on available metrics only197- API failures โ Retry with exponential backoff, fail after 3 attempts198