--- name: sentiment-analysis description: Professional sentiment analysis — multi-source sentiment scoring, insider flow, smart money tracking, social signals via openbb-invest-api user-invocable: true metadata: { "openclaw": { "emoji": "🎭", "requires": { "bins": ["curl"] } } } --- # Sentiment Analysis Generate a professional-grade sentiment report. Think like a sentiment quant — track smart money, not retail noise. ## Data Collection ```bash BASE=https://invest-api.k8s.home # Composite sentiment score (aggregated multi-source) curl -sk "$BASE/api/v1/stock/{TICKER}/sentiment" # Per-article news sentiment (Alpha Vantage) curl -sk "$BASE/api/v1/stock/{TICKER}/news-sentiment?limit=30" # Insider trades (SEC Form 4 — CEO/CFO buys and sells) curl -sk "$BASE/api/v1/stock/{TICKER}/insider-trades" # SEC insider filings (detailed Form 4) curl -sk "$BASE/api/v1/stock/{TICKER}/sec-insider" # Recent upgrades/downgrades curl -sk "$BASE/api/v1/stock/{TICKER}/upgrades" # Analyst recommendations count curl -sk "$BASE/api/v1/stock/{TICKER}/recommendations" # Reddit sentiment and mentions curl -sk "$BASE/api/v1/stock/{TICKER}/reddit-sentiment" # Social sentiment (Finnhub — Reddit + Twitter) curl -sk "$BASE/api/v1/stock/{TICKER}/social-sentiment" # Institutional holders (13F — smart money positions) curl -sk "$BASE/api/v1/stock/{TICKER}/institutional" # Short selling pressure curl -sk "$BASE/api/v1/stock/{TICKER}/shorts/volume" curl -sk "$BASE/api/v1/stock/{TICKER}/shorts/interest" curl -sk "$BASE/api/v1/stock/{TICKER}/shorts/ftd" # Dark pool activity (institutional block trades) curl -sk "$BASE/api/v1/darkpool/{TICKER}/otc" # Share statistics (float, short % of float) curl -sk "$BASE/api/v1/stock/{TICKER}/share-statistics" # Congress trades (political insider trading) curl -sk "$BASE/api/v1/regulators/congress/trades" ``` ## Report Structure ``` ## {TICKER} Sentiment Analysis — {date} ### Composite Sentiment - Score: {value} (-1.0 to +1.0) — [strongly bearish / bearish / neutral / bullish / strongly bullish] - Breakdown: news {score}, analysts {score}, upgrades {score}, social {score} ### News Flow - Articles analyzed: {count} - Sentiment distribution: {bullish}% bullish / {neutral}% neutral / {bearish}% bearish - Dominant themes: {top 2-3 topics} - Notable headlines: {1-2 most impactful} ### Smart Money Signals #### Insider Activity (last 90 days) - Net insider transactions: {count buys} buys / {count sells} sells = {net} - Notable: {largest trade with name, title, amount} - Signal: [strong buy signal / selling for diversification / red flag] #### Institutional Flow - Major holders: {top 3 names if available} - Recent 13F activity: [net accumulation / net distribution / stable] #### Congress Trades - Any recent trades in {TICKER}: [yes — details / none found] ### Short Selling Intelligence - Short volume: {%} of daily volume — [normal <25% / elevated 25-40% / extreme >40%] - Short interest: {shares} ({days_to_cover} days to cover) - Short % of float: {%} — [low <5% / moderate / crowded >15%] - Fails-to-deliver: {trend} — [rising = naked shorting concern / stable / declining] - Dark pool volume: {%} of total — [normal / elevated institutional activity] - Squeeze potential: [low / moderate / high] based on short interest + days to cover + catalyst ### Analyst Actions (last 30 days) - Upgrades: {count} | Downgrades: {count} - Most significant: {firm, action, price target} - Consensus shift: [improving / deteriorating / stable] ### Social & Retail - Reddit mentions rank: #{rank} in WSB/stocks - Reddit sentiment: {bullish/bearish/mixed} - Social media buzz: [trending up / stable / fading] - ⚠️ Note: Social sentiment is a contrarian indicator at extremes ### Signal: [BULLISH / BEARISH / NEUTRAL] ### Confidence: {1-10} ### Key Insight: {the single most actionable sentiment finding} ``` ## Rules - **Smart money > retail noise**: Weight insider buys and institutional flow higher than Reddit - Insider buying is a strong signal (insiders buy for one reason: they expect the price to go up) - Insider selling is a weak signal (insiders sell for many reasons: taxes, diversification, estate planning) - High short interest alone is not bearish — combine with catalyst for squeeze assessment - Congress trades within 30 days of legislation = potential MNPI concern - Keep under 500 words