Agentic Stock Actor avatar
Agentic Stock Actor

Pricing

Pay per usage

Go to Apify Store
Agentic Stock Actor

Agentic Stock Actor

Agentic Stock Actor is an AI trading assistant for swing traders. It tracks real-time data from Yahoo Finance, Reddit, Truth Social, and GPT-4 to spot buy-the-dip and sell-the-spike signals from priceโ€“sentiment divergences, and sends instant WhatsApp alerts.

Pricing

Pay per usage

Rating

0.0

(0)

Developer

Sachin Keswani

Sachin Keswani

Maintained by Community

Actor stats

1

Bookmarked

1

Total users

0

Monthly active users

9 days ago

Last modified

Share

๐ŸŽฏ Agentic Stock Actor

AI-Powered Stock Timing Agent with WhatsApp Notifications

Built for the Apify 1M Challenge Hackathon

Deployed on Apify Running Hourly Python 3.11 OpenAI GPT-4


๐Ÿ† Overview

Agentic Stock Actor is an AI-powered trading assistant that helps swing traders time their entries and exits by analyzing real-time data from 4 sources:

  • ๐Ÿ“Š Yahoo Finance: Stock prices, market data, and financial news
  • ๐Ÿ’ฌ Reddit: Community sentiment from r/wallstreetbets, r/stocks, r/investing, r/StockMarket
  • ๐Ÿ“ฑ Truth Social: @realDonaldTrump posts for political risk analysis
  • ๐Ÿค– GPT-4: Advanced sentiment analysis and trading signal generation

The actor identifies buy opportunities on dips and sell signals on spikes by detecting divergences between price action and sentiment. Get instant WhatsApp alerts when trading signals change!


โœจ Unique Features

๐Ÿ†• What Makes This Special:

  1. ๐Ÿ“ฑ WhatsApp Notifications - Get instant mobile alerts when signals change
  2. ๐Ÿ‡บ๐Ÿ‡ธ Trump Sentiment Analysis - Track @realDonaldTrump for market-moving posts
  3. ๐Ÿค– AI-Powered Reasoning - GPT-4 explains every signal with detailed analysis
  4. ๐Ÿ”” Signal Change Detection - Automatic notifications for BUYโ†’SELL, HOLDโ†’WATCH, etc.
  5. โฐ Fully Automated - Runs every hour, 24/7 on Apify platform

๐Ÿš€ Quick Start (5 Minutes)

1. Run on Apify Console

  1. Visit: https://console.apify.com/actors/43ZTkpbPq0YKf3djc
  2. Click "Start"
  3. Configure input:
{
"tickers": ["AAPL", "TSLA", "NVDA"],
"openaiApiKey": "YOUR_OPENAI_KEY",
"whatsappNumber": "+15551234567",
"twilioAccountSid": "ACxxxxx...",
"twilioAuthToken": "your_token",
"enableNotifications": true
}
  1. Get instant WhatsApp alerts! ๐Ÿ“ฑ

2. Set Up WhatsApp (Optional)

  1. Free Twilio account: https://www.twilio.com/try-twilio ($15 free credit)
  2. Activate WhatsApp sandbox (5 minutes)
  3. Add credentials to actor input
  4. Receive instant mobile notifications!

Full guide: See WHATSAPP_SETUP.md


๐Ÿ“Š What You Get

Trading Signals:

๐ŸŸข BUY Signal - AAPL (85% confidence)
๐Ÿ’ฐ Price: $182.50 (-1.2%)
๐Ÿ’ญ Sentiment: +0.68 (very positive)
๐Ÿ“ AI Reasoning:
"Strong positive sentiment from AI partnership announcement
while price dipped 2% below recent high. Excellent swing
trade entry point."
๐Ÿ”‘ Key Catalysts:
โ€ข AI partnership announcement
โ€ข Price near support level ($180)
โ€ข High volume (2.3x average)
โ€ข Positive Reddit sentiment (+0.65)
๐Ÿ“ฑ TRUMP IMPACT: MEDIUM
Trump mentioned AI sector positively (+0.40 sentiment)
โš–๏ธ Risk: MEDIUM
๐Ÿ’ก Entry Strategy:
"Enter below $185. Set stop-loss at $175. Target $200."
๐Ÿ• 14:00 UTC

WhatsApp Notification:

๐Ÿšจ URGENT SIGNAL CHANGE: AAPL
๐ŸŸก Previous: HOLD
๐ŸŸข *NEW: BUY*
๐Ÿ’ฐ $182.50
๐Ÿ’ญ +0.68
๐ŸŽฏ 85%
Strong positive sentiment from
partnership while price dipped...
๐Ÿ• 14:00 UTC

๐ŸŽฏ Features

Data Collection (4 Sources):

  • โœ… Yahoo Finance: Real-time prices, news, market data
  • โœ… Reddit: 4 major investing subreddits (25M+ members)
  • โœ… Truth Social: @realDonaldTrump political sentiment
  • โœ… OpenAI GPT-4: AI analysis and reasoning

AI Analysis:

  • โœ… Sentiment Scoring: -1 (very negative) to +1 (very positive)
  • โœ… Market-Moving Events: Earnings, partnerships, FDA approvals, tariffs
  • โœ… Trump Impact: Political risk quantification (0x to 2.0x weight)
  • โœ… Divergence Detection: Sentiment vs. price mismatches
  • โœ… Technical Indicators: 52-week position, volume ratios

Trading Signals:

  • โœ… 4 Signal Types: BUY, SELL, HOLD, WATCH
  • โœ… Confidence Scores: 0-100% certainty
  • โœ… Risk Assessment: Low, Medium, High
  • โœ… Entry Strategies: Specific price levels and tactics
  • โœ… AI Reasoning: Detailed explanations

Notifications:

  • โœ… WhatsApp: Instant mobile alerts (via Twilio)
  • โœ… Signal Changes: BUYโ†’SELL, HOLDโ†’WATCH, etc.
  • โœ… Trump Alerts: When ticker is mentioned
  • โœ… Console Logs: Real-time logging
  • โœ… Dataset History: All notifications saved

Automation:

  • โœ… Hourly Schedule: Runs every hour automatically
  • โœ… Signal Tracking: Stores history in key-value store
  • โœ… Change Detection: Compares with previous run
  • โœ… Auto-Notifications: Sends alerts automatically

๐Ÿ“– How It Works

Every Hour:
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ 1. Scrape Yahoo Finance โ”‚
โ”‚ โ€ข Prices, news, market data โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ 2. Scrape Reddit (4 subreddits) โ”‚
โ”‚ โ€ข Posts, scores, comments โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ 3. Scrape Truth Social (@realDonaldTrump) โ”‚
โ”‚ โ€ข Recent posts, ticker mentions โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ 4. AI Sentiment Analysis (GPT-4) โ”‚
โ”‚ โ€ข News: -1 to +1 โ”‚
โ”‚ โ€ข Reddit: Community mood โ”‚
โ”‚ โ€ข Trump: Political impact (0x to 2.0x) โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ 5. Generate Trading Signal (GPT-4) โ”‚
โ”‚ โ€ข BUY/SELL/HOLD/WATCH โ”‚
โ”‚ โ€ข Confidence + Reasoning โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ 6. Detect Signal Changes โ”‚
โ”‚ โ€ข Compare with previous run โ”‚
โ”‚ โ€ข Identify significant changes โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ 7. Send WhatsApp Notification ๐Ÿ“ฑ โ”‚
โ”‚ โ€ข If signal changed โ”‚
โ”‚ โ€ข Instant mobile alert โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐ŸŽฎ Usage

Basic (News Only):

{
"tickers": ["AAPL", "TSLA"],
"openaiApiKey": "YOUR_KEY"
}

Advanced (With WhatsApp):

{
"tickers": ["AAPL", "TSLA", "NVDA"],
"openaiApiKey": "YOUR_OPENAI_KEY",
"whatsappNumber": "+15551234567",
"twilioAccountSid": "ACxxxxx...",
"twilioAuthToken": "your_token",
"enableNotifications": true,
"maxNewsPerTicker": 20,
"maxRedditPostsPerTicker": 50,
"maxTrumpPosts": 20,
"subreddits": ["wallstreetbets", "stocks", "investing", "StockMarket"]
}

๐Ÿ“ฑ WhatsApp Notifications

Get instant mobile alerts when trading signals change!

Example Message:

๐Ÿšจ URGENT: TSLA
๐ŸŸกโ†’๐ŸŸข HOLD to BUY
๐Ÿ’ฐ $378.50
๐ŸŽฏ 90% confidence
๐Ÿ“ฑ TRUMP MENTIONED TSLA!
"Tesla doing incredible work..."
Buy below $380
Stop: $365
Target: $420
๐Ÿ• 13:00 UTC

Setup (5 Minutes):

  1. Get Twilio account: https://www.twilio.com/try-twilio (FREE $15 credit)
  2. Activate WhatsApp: Send "join your-code" to Twilio's number
  3. Add to input: Phone number + Twilio credentials
  4. Done! Receive instant alerts ๐Ÿ“ฑ

Full guide: WHATSAPP_SETUP.md


๐Ÿ‡บ๐Ÿ‡ธ Trump Sentiment Analysis

Unique Feature: Track @realDonaldTrump's Truth Social posts for market impact!

Why It Matters:

  • ๐Ÿ“ˆ Trump's posts can move markets immediately
  • ๐Ÿ’ฅ Tariff announcements: Direct company impact
  • ๐ŸŽฏ Company mentions: Significant price swings
  • ๐Ÿ“Š Policy changes: Industry-wide effects

Impact Levels:

LevelWeightExample
HIGH2.0x"Tesla doing incredible work!" โ†’ BUY boost
MEDIUM0.7x"Tariffs on auto parts" โ†’ Industry impact
LOW0.3x"Manufacturing booming" โ†’ General positive

Example:

๐Ÿ“ฑ TRUMP IMPACT ALERT
๐Ÿšจ TSLA DIRECTLY MENTIONED!
Impact: HIGH (2.0x weight)
Sentiment: +0.90 (very positive)
Post: "Tesla doing incredible work on American
manufacturing. Great American company!"
Market Prediction: Strong positive reaction expected
Original sentiment: +0.45 โ†’ Trump-adjusted: +0.78
Signal: WATCH โ†’ BUY

Full guide: TRUTH_SOCIAL_INTEGRATION.md


๐Ÿ“Š Output Format

{
"ticker": "AAPL",
"signal": "BUY",
"confidence": 0.85,
"reasoning": "Strong positive sentiment...",
"key_catalysts": ["Partnership", "Price dip", "High volume"],
"risk_level": "medium",
"entry_strategy": "Enter below $185. Stop: $175. Target: $200.",
"current_price": 182.50,
"percent_change": -0.0124,
"position_52w": 0.73,
"volume_ratio": 2.3,
"sentiment_score": 0.68,
"news_sentiment": 0.75,
"reddit_sentiment": 0.58,
"trump_sentiment": 0.40,
"trump_impact_level": "medium",
"trump_mentioned_ticker": false,
"market_moving_events": ["partnership", "product launch"],
"trump_themes": ["AI", "Manufacturing"],
"signal_changed": true,
"previous_signal": "HOLD",
"notification_sent": true
}

โฐ Automation

Hourly Schedule (Active):

  • Frequency: Every hour (:00)
  • Timezone: America/Chicago (CST)
  • Tickers: AAPL, TSLA, NVDA
  • Status: โœ… ENABLED

Schedule URL: https://console.apify.com/schedules/7A6c15ixwldghb0bh


๐ŸŽฏ Use Cases

For Swing Traders:

  • โœ… Buy dips with positive sentiment
  • โœ… Sell spikes with negative sentiment
  • โœ… Get WhatsApp alerts for signal changes
  • โœ… Know when Trump affects your stocks

For Risk Management:

  • โœ… Trump tariff early warnings
  • โœ… Policy change detection
  • โœ… Sentiment shift alerts
  • โœ… Political risk quantification

For Portfolio Monitoring:

  • โœ… Track multiple tickers (3+)
  • โœ… Hourly automated analysis
  • โœ… Mobile notifications
  • โœ… Zero manual effort

๐Ÿ› ๏ธ Tech Stack

  • Apify Platform: Actor framework, scheduling, storage
  • Python 3.11: Core logic
  • OpenAI GPT-4: Sentiment analysis and signal generation
  • BeautifulSoup + httpx: Web scraping
  • Twilio: WhatsApp notifications

๐Ÿ“š Documentation

  • QUICKSTART.md - Get started in 5 minutes
  • WHATSAPP_SETUP.md - Configure mobile notifications
  • TRUTH_SOCIAL_INTEGRATION.md - Trump sentiment analysis
  • NOTIFICATIONS_COMPLETE.md - Full notification guide
  • COMPLETE_FEATURES.md - All features explained
  • DEPLOYMENT.md - Deployment instructions
  • SCHEDULE_SETUP.md - Scheduling guide

๐Ÿ† Hackathon Highlights

Innovation:

  • ๐Ÿฅ‡ First trading agent with Trump sentiment analysis
  • ๐Ÿฅ‡ First to combine News + Reddit + Truth Social
  • ๐Ÿฅ‡ WhatsApp instant notifications for traders

Technical Excellence:

  • โœ… Clean, modular architecture
  • โœ… Apify-native implementation
  • โœ… Fault-tolerant with fallbacks
  • โœ… Production-ready code

Business Value:

  • โœ… Solves real problem (market timing)
  • โœ… Saves trader time (automated)
  • โœ… Provides trading edge (early signals)
  • โœ… Quantifies political risk (Trump factor)

๐Ÿ“Š Reddit Communities

Analyzes sentiment from 4 major investing subreddits (25M+ combined members):

  1. r/wallstreetbets (15M+) - Meme stocks, options, YOLO plays
  2. r/stocks (5M+) - General stock discussion, DD
  3. r/investing (2M+) - Long-term investing, fundamentals
  4. r/StockMarket (2M+) - Daily market discussion, TA

๐Ÿ“… Scheduling

Current schedule (Hourly):

  • Cron: 0 * * * *
  • Timezone: America/Chicago (CST)
  • Status: โœ… ENABLED

Alternative schedules:

# Market hours only (9am-4pm Mon-Fri)
0 9-16 * * 1-5
# Twice daily (6am & 1pm)
0 6,13 * * *
# Every 2 hours
0 */2 * * *

Edit schedule: https://console.apify.com/schedules/7A6c15ixwldghb0bh


๐Ÿ’ฐ Cost

Per Run (3 tickers):

  • Apify compute: ~$0.02 (4-5 min on 4GB memory)
  • OpenAI API: ~$0.01 (GPT-4 calls)
  • WhatsApp: FREE (Twilio $15 credit)
  • Total: ~$0.03 per run

Monthly:

  • 24/7 Hourly: ~$22/month
  • Market hours only: ~$5/month
  • Twice daily: ~$2/month

๐Ÿ”’ Security

  • โœ… API keys stored as encrypted secrets
  • โœ… WhatsApp credentials protected
  • โœ… No sensitive data logged
  • โœ… Follows Apify security best practices

๐Ÿ“ Example Use Case

Morning routine:

06:00 - Actor runs, analyzes overnight news
06:04 - Signal change detected: NVDA HOLD โ†’ BUY
06:05 - ๐Ÿ“ฑ WhatsApp notification received
07:00 - Review reasoning on Apify console
09:30 - Market opens, execute BUY order
Entry: $135, Target: $155, Stop: $128
16:00 - Actor runs again
16:04 - Signal change: NVDA BUY โ†’ SELL
16:05 - ๐Ÿ“ฑ WhatsApp: "Take profits!"
16:10 - Sell at $154 (+14% gain!)

๐Ÿ† Built For

Apify 1M Challenge Hackathon

Key Differentiators:

  1. Only agent tracking Trump for trading
  2. Multi-source intelligence (4 sources)
  3. WhatsApp mobile notifications
  4. AI-powered with reasoning
  5. Fully automated on Apify


๐Ÿค Credits

Built by: Sachin Keswani
Email: sachin.news@gmail.com
Hackathon: Apify 1M Challenge
Date: December 2025


๐Ÿ“„ License

MIT License - See LICENSE file


Made with โค๏ธ for swing traders everywhere. Get WhatsApp alerts and never miss a trade! ๐Ÿš€๐Ÿ“ฑ