Skip to content

Harsh-Daga/Catalyst-Detector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

🚀 Catalyst Detector

Autonomous AI-Powered Stock Catalyst Detection System

Detect high-impact investment catalysts in real-time from SEC filings, earnings calls, and press releases using advanced LLM analysis and comprehensive market data enrichment.

Python 3.8+ License: MIT PRs Welcome


📋 Table of Contents


✨ Features

🎯 Core Capabilities

  • 🤖 Multi-LLM Analysis: Groq, Google Gemini, Claude Code, and Ollama support with intelligent fallback
  • 📊 10+ Data Sources: Comprehensive enrichment from free APIs and web sources
  • 🔍 Smart Filtering: Positive-only catalyst detection with quality and materiality filters
  • 📈 Technical Analysis: RSI, MACD, Bollinger Bands, support/resistance, breakout detection
  • 💬 Sentiment Analysis: Multi-source news, Reddit, StockTwits retail sentiment
  • 🏦 Institutional Tracking: 13F filings, top holders, ownership changes
  • 🔄 Sector Rotation: Real-time sector momentum and hot/cold sector identification
  • 📉 Outcome Tracking: Automatic performance tracking post-catalyst for ML learning
  • ⚡ Real-time Alerts: Telegram notifications with comprehensive analysis
  • 🎨 Rich Formatting: Beautiful, actionable alerts with emoji indicators

📊 Catalyst Types Detected

Revenue & Earnings: Beats, guidance raises, record results
Products & Innovation: FDA approvals, breakthrough designations, launches
Strategic Moves: M&A, partnerships, contracts, expansions
Capital Actions: Buybacks, dividend increases, debt refinancing
Regulatory: Approvals, patent grants, designations

Filtered Out: Financial distress, losses, lawsuits, warnings, negative catalysts


🏗️ Architecture

┌─────────────────────────────────────────────────────────────┐
│                    AUTONOMOUS DAEMON                        │
│  ┌──────────┐  ┌──────────┐  ┌──────────┐  ┌──────────┐     │
│  │   SEC    │  │  Earnings│  │   Press  │  │ Form 4   │     │
│  │ Filings  │  │  Calls   │  │ Releases │  │ Insider  │     │
│  └────┬─────┘  └────┬─────┘  └────┬─────┘  └────┬─────┘     │
│       └─────────────┴─────────────┴─────────────┘           │
│                          │                                  │
│                  ┌───────▼────────┐                         │
│                  │  NLP Pipeline  │                         │
│                  │  FinBERT + LLM │                         │
│                  └───────┬────────┘                         │
│                          │                                  │
│         ┌────────────────┼────────────────┐                 │
│         │                │                │                 │
│    ┌────▼────┐    ┌─────▼─────┐   ┌─────▼─────┐             │
│    │ Quality │    │ Sentiment │   │  Scoring  │             │
│    │ Filter  │    │  Filter   │   │  Engine   │             │
│    └────┬────┘    └─────┬─────┘   └─────┬─────┘             │
│         └────────────────┼────────────────┘                 │
│                          │                                  │
│                  ┌───────▼────────┐                         │
│                  │  Data Enrichment│                        │
│                  │ 10+ Free Sources│                        │
│                  └───────┬────────┘                         │
│                          │                                  │
│                  ┌───────▼────────┐                         │
│                  │ Telegram Alert │                         │
│                  │  + Tracking    │                         │
│                  └────────────────┘                         │
└─────────────────────────────────────────────────────────────┘

📦 Installation

Prerequisites

  • Python 3.9+
  • TA-Lib C library
  • Docker (optional, for containerized deployment)

Quick Start (Makefile)

# Clone repository
git clone https://github.com/yourusername/catalyst-detector.git
cd catalyst-detector

# One-command setup (creates venv, installs deps, sets up DB)
make init

# Edit configuration with your API keys
nano .env

# Start monitoring
make daemon

# View logs
make logs

Manual Installation

# Create virtual environment
python3 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install TA-Lib
brew install ta-lib  # macOS
# OR: sudo apt-get install libta-lib-dev  # Ubuntu
# OR: See TA-Lib Windows installation guide

# Install dependencies
pip install -r requirements.txt

# Setup database
python migrations/add_catalyst_outcomes.py

# Configure environment
cp .env.example .env
# Edit .env with your API keys

Docker Installation

# Build and run with Docker Compose
docker-compose up -d

# View logs
docker-compose logs -f

# Stop
docker-compose down

⚙️ Configuration

# Copy example configuration
cp .env.example .env

# Edit with your API keys
nano .env

Required Settings

# Telegram (for alerts)
TELEGRAM_BOT_TOKEN=your_bot_token
TELEGRAM_CHAT_ID=your_chat_id

# SEC EDGAR
EDGAR_USER_AGENT=your_email@example.com

# LLM (choose at least one)
GROQ_API_KEY=your_groq_key          # FREE, fast
GEMINI_API_KEY=your_gemini_key      # FREE, multimodal
OLLAMA_BASE_URL=http://localhost:11434  # LOCAL, private

Optional Data Enrichment

# All FREE tier APIs
ALPHA_VANTAGE_KEY=your_key    # 25 calls/day
FMP_API_KEY=your_key          # 250 calls/day
MARKETAUX_API_KEY=your_key    # 100 calls/day

🚀 Usage

Using Makefile Commands

# Development workflow
make run          # Run single scan
make daemon       # Start background daemon
make stop         # Stop daemon
make logs         # Tail daemon logs

# Code quality
make format       # Format with black & isort
make lint         # Run linters (flake8, pylint, mypy)
make test         # Run tests with coverage
make security     # Security audit with bandit

# Utilities
make clean        # Clean cache and build artifacts
make update       # Update all dependencies

Manual Usage

# Start daemon
source venv/bin/activate
python src/daemon.py

# Run single scan
python src/main.py

# Test Telegram connection
python -c "from utils.notifications import telegram_notifier; telegram_notifier.send_test_message()"

# Run migrations
python migrations/add_catalyst_outcomes.py

Docker Usage

# Start service
docker-compose up -d

# View logs
docker-compose logs -f catalyst-detector

# Restart after config changes
docker-compose restart

# Stop service
docker-compose down

# Rebuild after code changes
docker-compose up -d --build

📡 Data Sources

Source Type Cost Limit
SEC EDGAR Filings FREE 10/sec
Yahoo Finance Prices FREE Unlimited
Finviz Fundamentals FREE Unlimited
StockTwits Sentiment FREE Unlimited
Reddit Social FREE Unlimited
Alpha Vantage Metrics FREE 25/day
FMP Analysts FREE 250/day
Marketaux News FREE 100/day

🎯 Advanced Features

Intelligent Scoring

Score = (
    Materiality × 35% +
    Novelty × 15% +
    Timing × 10% +
    Confidence × 10% +
    Sector Momentum × 10% +
    Quantitative Impact × 15% +
    Peer Comparison × 5%
)

Threshold: 60-75/100 (adaptive)

Quality Filters

  • ❌ Lawsuit spam
  • ❌ Low materiality (< $10M)
  • ❌ Micro-caps (< $50M)
  • ❌ Negative catalysts
  • ✅ Only positive opportunities

Outcome Tracking

Every catalyst tracked for 90 days:

  • Price performance (1d/3d/7d/14d/30d/90d)
  • Max upside/drawdown
  • Volume analysis
  • Sector comparison
  • ML classification

📸 Example Alert

🔔 TICKER - FDA Approval: Breakthrough Designation

📊 Company Overview
*TICKER* - Company Name
Price: $45.23 | Market Cap: $2.3B
Sector: Healthcare

🎯 Catalyst Details
Type: FDA Approval
Impact Score: 87.5/100
Confidence: 92%
⏰ Time Sensitive

📊 Technical Analysis
• RSI: 45.2 ⚪ (Neutral)
• MACD: 🟢 Bullish Crossover
• Support: $42.50 | Resistance: $48.80

📋 Analyst Coverage
• Price Target: $65.00 🚀 (+43.7% upside)
• Analyst Sentiment: 🟢 Bullish
• Last 30d: 3 upgrades, 0 downgrades

💬 StockTwits Sentiment
• 🚀 Very Bullish (247 messages)
• Bull: 78% | Bear: 22%

🏦 Institutional Ownership
• 🟢 68.4% (89 institutions)
• Top: BlackRock (12.3%), Vanguard (9.8%)

🔄 Sector Rotation
• 🔥 Healthcare: Hot Sector (Rank: 3/11)
• 30d Performance: +8.7%

💡 Investment Analysis
...detailed analysis...

🔗 Resources
[SEC] [Chart] [Research]

🤝 Contributing

Contributions welcome! See CONTRIBUTING.md for detailed guidelines.

Development Setup

# Install development dependencies
make install-dev

# Setup pre-commit hooks (auto-format on commit)
pre-commit install

# Create feature branch
git checkout -b feature/amazing-feature

# Make changes, then test
make format        # Format code
make lint          # Check code quality
make test          # Run tests (>80% coverage required)
make security      # Security audit

# Commit and push
git add .
git commit -m "feat: add amazing feature"
git push origin feature/amazing-feature

Running Tests

# Run all tests with coverage
pytest tests/ -v --cov=src --cov-report=html

# Run specific test file
pytest tests/test_catalyst_detection.py -v

# Run with coverage report
make test
# Open htmlcov/index.html to view coverage

Code Style

  • Formatter: Black (line length: 100)
  • Import sorting: isort
  • Linting: flake8, pylint
  • Type checking: mypy
  • Docstrings: Google style
  • Commits: Conventional Commits format

All enforced via pre-commit hooks and CI/CD.


📜 License

MIT License - see LICENSE


📚 Documentation


⚠️ Disclaimer

FOR EDUCATIONAL PURPOSES ONLY. NOT FINANCIAL ADVICE.

  • Conduct your own due diligence
  • Past performance ≠ future results
  • Consult a licensed financial advisor
  • Authors not responsible for financial losses

Built with ❤️ by developers, for investors

About

No description, website, or topics provided.

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages