An end-to-end financial signal detection system that processes public news feeds, applies NLP analysis, generates trading signals with confidence scores, and provides a web interface for monitoring and analysis.
- Automated Data Ingestion: RSS feed processing with content extraction
- NLP Pipeline: Entity recognition, sentiment analysis, event extraction, novelty detection
- Signal Generation: Multi-factor confidence scoring with time decay
- Web Interface: Real-time signal monitoring with detailed evidence
- Slack Alerts: Configurable notifications for high-confidence signals
- Event Study Backtesting: Statistical analysis of signal performance
News Feeds → Ingestion → NLP Processing → Event Extraction → Signal Fusion → Database
↓
REST API ← Frontend (Next.js)
↓
Slack Alerts
- Docker and Docker Compose
- 8GB+ RAM recommended
- Ports 3000, 5432, 6379, 8000 available
-
Clone the repository and navigate to the project directory
-
Copy environment configuration:
cp .env.example .env- Start all services:
docker-compose up --build -d- Initialize database (first time only):
docker compose exec api alembic upgrade head- Trigger initial data ingestion:
docker compose exec api python -m app.flows.ingest --once- Access the web interface:
- Frontend: http://localhost:3000/signals
- API Documentation: http://localhost:8000/docs
Key configuration in .env:
SLACK_WEBHOOK: Slack incoming webhook URL (optional)FINBERT_MODEL: FinBERT model for sentiment analysisEMBED_MODEL: Sentence transformer model for embeddingsNEWS_FEEDS: Comma-separated RSS feed URLs- Confidence weights:
W_SRC,W_NOVEL,W_EVT,W_BUZZ
GET /health- System health checkGET /signals?min_confidence=0.6- List signals with filtersGET /documents/{id}- Document details with entities and eventsGET /tickers/{symbol}/signals- Signals for specific tickerPOST /backtest/event-study- Run event study analysis
# Get recent signals
curl http://localhost:8000/signals?min_confidence=0.7
# Get document details
curl http://localhost:8000/documents/1
# Get ticker signals
curl http://localhost:8000/tickers/AAPL/signals
# Run backtest
curl -X POST http://localhost:8000/backtest/event-study \
-H "Content-Type: application/json" \
-d '{"event_types": ["guidance_up"], "window_days": 5}'Main dashboard with signal list, filters, and evidence drawer
Document viewer with extracted entities, events, and price chart
Ticker-specific signals with price chart and signal markers
The system uses a multi-factor approach:
confidence = calibrator(
base_score * time_decay + adjustments
)
where:
- base_score = weighted sum of source, novelty, event, buzz
- adjustments = consistency and uncertainty factors
- time_decay = exponential decay over time
- Ingestion: Fetches RSS feeds or uses mock data
- Content Extraction: Uses trafilatura for text extraction
- NLP Processing:
- Named Entity Recognition (spaCy)
- Sentiment Analysis (FinBERT)
- Embeddings (Sentence Transformers)
- Event Detection: Rule-based pattern matching
- Novelty Calculation: Cosine similarity with recent documents
- Signal Generation: Confidence scoring and fusion
- Notifications: Slack alerts for high-confidence signals
docker compose exec api pytestdocker compose exec api python -m app.flows.ingest --once --mockdocker compose logs -f api
docker compose logs -f webdocker compose exec db psql -U user -d signalsThe system includes mock articles for testing:
- Apple guidance raise
- Tesla earnings beat
- Microsoft acquisition
- Amazon regulatory probe
- NVIDIA dividend increase
Mock data is automatically used when:
- RSS feeds are unavailable
- Running with
--mockflag - API endpoints fail
- Health endpoint: http://localhost:8000/health
- Structured JSON logs in all services
- Audit trail for all critical operations
- Signal evidence tracking
- Only processes public information sources
- Stores document snapshots for audit
- Flags signals requiring second source confirmation
- Full audit logging of signal generation
docker compose down
docker compose up --builddocker compose restart db
docker compose exec api alembic upgrade head# Check ingestion logs
docker compose logs api | grep "ingest"
# Run manual ingestion with mock data
docker compose exec api python -m app.flows.ingest --once --mock- Backend: Python 3.11, FastAPI, SQLAlchemy, Prefect
- NLP: spaCy, Transformers, Sentence-Transformers
- Database: PostgreSQL 15 with pgvector extension
- Cache: Redis
- Frontend: Next.js 14, TypeScript, TailwindCSS, Recharts
- Notifications: Slack Webhooks
- Companies & Tickers
- Documents with embeddings
- Entities & Events
- Signals with evidence
- Audit logs
MIT