Institutional-grade AI market intelligence and quantitative trading platform scaffold
Project description
ฮฑ AlphaForge
AI-Powered Market Intelligence & Quantitative Trading Platform
Institutional-grade scaffold for cross-asset prediction, risk-aware signal generation, continual learning, and human-readable decision support.
๐ฏ What is AlphaForge?
AlphaForge is an institutional-grade scaffold for an AI-powered market intelligence and quantitative trading platform. It is designed as a research-to-production operating system for:
- Cross-asset prediction โ Equities, crypto, futures, and derivatives
- Risk-aware signal generation โ Volatility-adjusted sizing, drawdown protection
- Continual learning โ Adaptive regime detection, model retraining pipelines
- Human-readable decision support โ Explainable signals, not black boxes
Built for traders who want to understand why a signal fires, not just that it fires.
๐ผ๏ธ Screenshots
๐ Full Dashboard View
Real-time market data, watchlist, macro indicators, and stock analysis in one unified view
๐ Detailed Stock Analysis
Deep dive into individual stocks with risk assessment, insider trading, and earnings data
๐จ UI Highlights
| Feature | Preview |
|---|---|
| API Quota Monitor | Hover over API section |
| Smart Watchlist | Add/remove with optimistic UI |
| Stock Screener | Multi-factor filtering |
| Alert System | Real-time notifications |
๐ Installation
Prerequisites
| Requirement | Version |
|---|---|
| Python | 3.11+ |
Quick Install (PyPI)
pip install alphaforged
That's it. One command installs:
- Core package (pydantic models, risk engine, backtesting, research tournament)
- Operator console web app (FastAPI + static HTML/JS/CSS)
- CLI entry point
Launch
# Start the operator console
alphaforge serve
# Custom port
alphaforge serve --port 9000
# Run demo pipeline
alphaforge demo
Open http://localhost:8765 in your browser.
First-Time Setup
Create a .env file in your working directory:
ALPHA_VANTAGE_API_KEY=your_key_here
FRED_API_KEY=your_key_here
FINNHUB_API_KEY=optional
Get free keys:
- Alpha Vantage โ 25 req/day
- FRED โ Unlimited
- Finnhub โ 60 req/min (optional)
Install with All Dependencies
# Full install (ML, data, API, UI, ops)
pip install "alphaforge[all]"
# Or specific groups
pip install "alphaforge[ml]" # PyTorch, scikit-learn, XGBoost
pip install "alphaforge[data]" # Pandas, Polars, DuckDB
pip install "alphaforge[api]" # FastAPI, Uvicorn
Development Install (from source)
# Clone the repo
git clone https://github.com/Soodkrish03/alphaforge.git
cd alphaforge
# uv reads .python-version + uv.lock โ exact same Python + deps
uv sync --all-extras
uv automatically installs Python 3.13.4 (pinned in .python-version) and all dependencies from uv.lock. No version mismatches, no "works on my machine."
โ๏ธ Configuration
Environment Variables (.env)
| Variable | Required | Description |
|---|---|---|
ALPHA_VANTAGE_API_KEY |
โ | Stock data, fundamentals, news sentiment |
FRED_API_KEY |
โ | Macroeconomic indicators |
FINNHUB_API_KEY |
โ | Near-realtime US stock quotes |
Platform Config (configs/platform.toml)
[risk]
max_gross_exposure = 2.5
max_drawdown_pct = 12.0
volatility_target_pct = 14.0
[research]
walk_forward_windows = 12
stress_paths = 5000
tournament_size = 128
๐๏ธ Architecture
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ OPERATOR CONSOLE GUI โ
โ Real-time Dashboard โ Watchlist โ Screener โ Alerts โ Portfolio โ Macros โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ API LAYER โ
โ FastAPI REST โ WebSocket Streams โ gRPC (planned) โ Kafka Events โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ ORCHESTRATION ENGINE โ
โ Async Control Plane โ Regime Detection โ Model Retraining โ Alert Routing โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ RESEARCH TOURNAMENT โ
โ Alpha Factor Ranking โ Walk-Forward Validation โ Model Comparison โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ RISK ENGINE โ
โ Volatility Sizing โ Drawdown Brakes โ Kelly Scaling โ Position Limits โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ ML PIPELINE โ
โ LSTM โ Transformer โ XGBoost โ Ensemble โ Regime Classifier โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ FEATURE STORE โ
โ Feast Integration โ Time-Series Features โ Cross-Asset Signals โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ DATA LAYER โ
โ yfinance โ Alpha Vantage โ FRED โ Finnhub โ Google News RSS โ Binance โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โจ Features
๐ Operator Console (Live)
| Feature | Description |
|---|---|
| Real-Time Dashboard | Live market data, charts, and portfolio overview |
| Smart Watchlist | Add/remove symbols with optimistic UI updates |
| Stock Screener | Multi-factor screening with sector/industry filters |
| Alert System | Volatility, sentiment, regime, and liquidity alerts |
| API Quota Monitor | Live tracking of Finnhub (60 req/min) and Alpha Vantage (25 req/day) |
| Market Movers | Top gainers, losers, most active stocks |
| Macro Panel | Fed funds rate, unemployment, yield curve, consumer sentiment |
| Insider Trading | Real-time insider transactions from SEC filings |
| Earnings Calendar | Upcoming earnings dates and estimates |
| Crypto Dashboard | Fear & Greed Index, funding rates, on-chain metrics |
๐ง Core Engine
| Module | Purpose |
|---|---|
alphaforge.domain |
Pure data structures (TradePlan, RiskSnapshot, ModelPrediction) |
alphaforge.models |
ML abstractions (BaseModel ABC, RegimeClassifier, EnsembleModel) |
alphaforge.features |
Feast feature store wrapper with time-series support |
alphaforge.execution |
RiskEngine, AlertEvent generation, position sizing |
alphaforge.backtesting |
Deterministic simulation from TradePlan signals |
alphaforge.research |
Experiment runner โ IntelligenceReport with factor ranking |
alphaforge.orchestration |
Async ControlPlane scheduling risk/model updates |
alphaforge.runtime |
Demo entry point, UniverseMonitorService, FreeTierReportService |
๐ก๏ธ Risk Management
# Automatic risk checks before every trade
RiskEngine.evaluate(
trade_plan=plan,
portfolio=portfolio,
market_regime=current_regime,
)
# โ Returns approved/rejected with explanation
- Volatility-aware sizing โ Position size inversely proportional to IV
- Drawdown protection โ Automatic halting at configurable thresholds
- Kelly criterion scaling โ Optimal bet sizing based on edge/volatility
- Regime-adaptive limits โ Tighter constraints in bear markets
๐ Project Structure
C:\VScode\ALGO
โ
โโโ ๐ฑ apps\operator_console\ # Live web dashboard
โ โโโ index.html # Main UI (single-page app)
โ โโโ app.js # All UI logic, charts, API calls
โ โโโ styles.css # Professional dark theme
โ โโโ server.py # FastAPI server with REST endpoints
โ
โโโ ๐ผ๏ธ assets\ # Screenshots, images, demo files
โ โโโ s look.png # Dashboard screenshot
โ โโโ f look.png # Stock analysis screenshot
โ
โโโ ๐ง src\alphaforge\ # Core platform package
โ โโโ domain\models.py # Typed data structures
โ โโโ models\ # ML model abstractions
โ โโโ features\ # Feature store wrapper
โ โโโ execution\risk_engine.py # Risk evaluation & sizing
โ โโโ execution\alerts.py # Alert generation
โ โโโ backtesting\engine.py # Deterministic simulation
โ โโโ research\ # Experiment runner
โ โโโ orchestration\control_plane.py # Async orchestrator
โ โโโ data\free_market_data.py # Free API connectors
โ โโโ runtime\ # Services & demo entry
โ
โโโ ๐ configs\platform.toml # Platform defaults
โโโ ๐ data\universes\ # Symbol universes (CSV)
โโโ ๐งช tests\ # Deterministic unit tests
โโโ ๐ docs\ # Architecture & wireframes
๐ Data Sources
Free Tier (No API Key Required)
| Provider | Data | Rate Limit |
|---|---|---|
| yfinance | Prices, fundamentals, insider transactions, earnings | Unlimited* |
| Google News RSS | News sentiment for stocks | Unlimited |
| alternative.me | Crypto Fear & Greed Index | Unlimited |
| Binance | Crypto perpetual funding rates | Unlimited |
| blockchain.com | BTC on-chain metrics (hashrate, mempool) | Unlimited |
*yfinance uses unofficial Yahoo Finance endpoints โ may be rate-limited during high traffic.
Free Tier (API Key Required)
| Provider | Data | Rate Limit |
|---|---|---|
| Alpha Vantage | Daily prices, fundamentals, news sentiment, market movers | 25 requests/day |
| FRED | Macro indicators (Fed funds, unemployment, yields, consumer sentiment) | Unlimited |
| Finnhub | Near-realtime US stock quotes | 60 requests/min |
Indian Market Support
AlphaForge is optimized for Indian equities:
- Automatic
.NS/.BOsuffix handling for NSE / BSE symbols - INR currency detection and display
- Reliance, TCS, Infosys, HDFC โ all work out of the box
- Macro panel includes USD/INR exchange rate
๐งช Testing
alphaforge demo
๐บ๏ธ Roadmap
Phase 1: Core Platform โ
- Typed domain model (Pydantic v2)
- Free-tier data connectors (yfinance, Alpha Vantage, FRED, Finnhub)
- Risk engine with volatility sizing and drawdown protection
- Operator console with live dashboard
- Smart watchlist with optimistic UI updates
- Market screener with multi-factor filtering
Phase 2: ML Pipeline ๐ง
- LSTM/Transformer price prediction models
- Sentiment analysis with FinBERT
- Regime detection with Hidden Markov Models
- Ensemble model with dynamic weighting
- Walk-forward validation framework
Phase 3: Production Systems ๐
- FastAPI REST + WebSocket server
- Kafka event streaming
- PostgreSQL feature store
- Redis caching layer
- Docker/Kubernetes deployment
Phase 4: Advanced Features ๐
- Multi-broker execution (Zerodha, IBKR, Alpaca)
- Options pricing (Black-Scholes, binomial)
- Crypto perpetual futures trading
- Portfolio optimization (Markowitz, Black-Litterman)
- Regulatory compliance (SEBI, SEC)
๐ Deployment: Publish to PyPI
1. Update Version
Edit pyproject.toml:
version = "0.2.0"
2. Build & Upload
pip install build twine
python -m build
twine upload dist/*
3. Tag Release
git tag -a v0.2.0 -m "Release v0.2.0"
git push origin v0.2.0
๐ Documentation
| Document | Description |
|---|---|
docs/architecture.md |
Deep architecture dossier |
docs/gui_wireframes.md |
UI wireframes and design specs |
CLAUDE.md |
Claude Code integration guide |
๐ค Contributing
AlphaForge is currently in private development. For inquiries:
- Open an issue for bugs or feature requests
- Submit PRs for improvements (will be reviewed)
๐ License
Proprietary โ All rights reserved.
๐ Acknowledgments
Built with:
- Pydantic v2 โ Data validation and settings management
- yfinance โ Free market data (Yahoo Finance)
- Alpha Vantage โ Free stock data API
- FRED โ Federal Reserve Economic Data
- Finnhub โ Real-time stock quotes
๐ Troubleshooting
| Issue | Solution |
|---|---|
FileNotFoundError: .env |
Create .env file from .env.example with your API keys |
ConnectionError when fetching data |
Check internet connection; yfinance requires stable connection |
RateLimitError from Alpha Vantage |
You've exceeded 25 requests/day; wait 24h or upgrade plan |
| Server won't start on port 8765 | Another process is using the port; try --port 9000 |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file alphaforged-0.3.7.tar.gz.
File metadata
- Download URL: alphaforged-0.3.7.tar.gz
- Upload date:
- Size: 352.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
227e69343352a5b1b6f0338c844fd9a05c82c8c128b8fc6c59f6db643f210126
|
|
| MD5 |
a1c9e9e77a1eb67a8b399d5d19b29d13
|
|
| BLAKE2b-256 |
7424472c48a9f3877ecf0435406c9ca3ad531c99cf517113b8ba25c6aa94392b
|
File details
Details for the file alphaforged-0.3.7-py3-none-any.whl.
File metadata
- Download URL: alphaforged-0.3.7-py3-none-any.whl
- Upload date:
- Size: 380.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9e95fe08b439d6dd302fd878a1e36a65e0768b13e7def09be3a1b501b568ef47
|
|
| MD5 |
3f32243672e8ca53aa24c1e0f2210167
|
|
| BLAKE2b-256 |
4a2fd62bc514c85c3190ab6cd47b52edb8eed9bb57f75fa5e71ecf1c7264c793
|