130 lines
4.5 KiB
Markdown
130 lines
4.5 KiB
Markdown
# 📈 MarketScanner
|
|
|
|
> **"Buy when there's blood in the streets, even if the blood is your own."** — Baron Rothschild
|
|
|
|
A fear-to-fortune trading intelligence system that identifies buying opportunities by analyzing how stocks historically respond to panic-inducing news.
|
|
|
|
## 🎯 What This Does
|
|
|
|
1. **Monitors News** - Real-time scanning of financial news, social media, SEC filings
|
|
2. **Tracks Sentiment** - NLP-powered sentiment analysis on every piece of news
|
|
3. **Correlates with Price** - Links news events to actual stock movements
|
|
4. **Finds Patterns** - "Last time $TICKER had this type of news, it dropped X% then recovered Y% in Z months"
|
|
5. **Signals Opportunities** - Shows you when panic creates buying opportunities based on historical behavior
|
|
|
|
## 🏗️ Architecture
|
|
|
|
```
|
|
┌─────────────────────────────────────────────────────────┐
|
|
│ MarketScanner │
|
|
├─────────────────────────────────────────────────────────┤
|
|
│ News Scrapers → Sentiment Analysis → Pattern Matching │
|
|
│ ↓ ↓ ↓ │
|
|
│ TimescaleDB (Time-series data storage) │
|
|
│ ↓ │
|
|
│ FastAPI Backend → React Dashboard │
|
|
└─────────────────────────────────────────────────────────┘
|
|
```
|
|
|
|
## 🛠️ Tech Stack
|
|
|
|
- **Backend**: Python 3.12 + FastAPI
|
|
- **Frontend**: React 18 + TypeScript + TailwindCSS
|
|
- **Database**: PostgreSQL + TimescaleDB
|
|
- **Cache**: Redis
|
|
- **Queue**: Celery + RabbitMQ
|
|
- **NLP**: OpenAI API / Local LLM
|
|
- **Charts**: TradingView Lightweight Charts
|
|
- **Containerization**: Docker + Docker Compose
|
|
|
|
## 🚀 Quick Start
|
|
|
|
```bash
|
|
# Clone the repository
|
|
git clone git@gitea.egonetix.de:root/marketscanner.git
|
|
cd marketscanner
|
|
|
|
# Copy environment template
|
|
cp .env.example .env
|
|
|
|
# Edit .env with your API keys
|
|
nano .env
|
|
|
|
# Start all services
|
|
docker-compose up -d
|
|
|
|
# Access the dashboard
|
|
open http://localhost:3010
|
|
```
|
|
|
|
## 📁 Project Structure
|
|
|
|
```
|
|
marketscanner/
|
|
├── backend/ # FastAPI backend
|
|
│ ├── app/
|
|
│ │ ├── api/ # API routes
|
|
│ │ ├── core/ # Config, security
|
|
│ │ ├── models/ # Database models
|
|
│ │ ├── schemas/ # Pydantic schemas
|
|
│ │ ├── services/ # Business logic
|
|
│ │ │ ├── news/ # News scrapers
|
|
│ │ │ ├── sentiment/ # NLP analysis
|
|
│ │ │ ├── stocks/ # Stock data fetchers
|
|
│ │ │ └── patterns/ # Pattern matching
|
|
│ │ └── workers/ # Celery tasks
|
|
│ ├── tests/
|
|
│ └── requirements.txt
|
|
├── frontend/ # React dashboard
|
|
│ ├── src/
|
|
│ │ ├── components/
|
|
│ │ ├── pages/
|
|
│ │ ├── hooks/
|
|
│ │ └── services/
|
|
│ └── package.json
|
|
├── docker/ # Docker configs
|
|
├── docker-compose.yml
|
|
├── .env.example
|
|
└── README.md
|
|
```
|
|
|
|
## 🔑 Required API Keys
|
|
|
|
| Service | Purpose | Cost |
|
|
|---------|---------|------|
|
|
| Alpha Vantage | Stock data | Free tier available |
|
|
| News API | News aggregation | Free tier available |
|
|
| OpenAI | Sentiment analysis | Pay per use |
|
|
| Polygon.io | Real-time data (optional) | Paid |
|
|
|
|
## 📊 Features
|
|
|
|
### Dashboard
|
|
- Real-time panic score monitoring
|
|
- Sector heat maps
|
|
- Historical pattern overlays
|
|
- Buy signal alerts with confidence scores
|
|
|
|
### Panic Detection
|
|
- Sentiment scoring (-100 to +100)
|
|
- Volume spike detection
|
|
- Price velocity measurement
|
|
- Fear index correlation
|
|
|
|
### Pattern Matching
|
|
- Company-specific recovery patterns
|
|
- Sector-wide panic analysis
|
|
- Event-type categorization (scandal, earnings miss, macro events)
|
|
|
|
## ⚠️ Disclaimer
|
|
|
|
This software is for educational and research purposes only. It is not financial advice. Trading stocks involves risk of loss. Past performance does not guarantee future results. Always do your own research and consult with a qualified financial advisor.
|
|
|
|
## 📜 License
|
|
|
|
MIT License - See [LICENSE](LICENSE) for details.
|
|
|
|
---
|
|
|
|
*"The time to buy is when there's blood in the streets."* 🩸📈
|