Skip to main content

Institutional-grade AI market intelligence and quantitative trading platform scaffold

Project description

ฮฑ AlphaForge

AI-Powered Market Intelligence & Quantitative Trading Platform

Python 3.11+ Pydantic v2 License Status

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

Dashboard Screenshot

Real-time market data, watchlist, macro indicators, and stock analysis in one unified view


๐Ÿ” Detailed Stock Analysis

Stock Analysis Screenshot

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:

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 / .BO suffix 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

AlphaForge โ€” Where quantitative research meets production trading.i think

GitHub Python Pydantic

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

alphaforged-0.3.8.tar.gz (672.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

alphaforged-0.3.8-py3-none-any.whl (703.9 kB view details)

Uploaded Python 3

File details

Details for the file alphaforged-0.3.8.tar.gz.

File metadata

  • Download URL: alphaforged-0.3.8.tar.gz
  • Upload date:
  • Size: 672.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.4

File hashes

Hashes for alphaforged-0.3.8.tar.gz
Algorithm Hash digest
SHA256 b9b5815bdf36ec4d3e0d5542c287fa7db1da5527fb0ea8c4bf773fbc59ba6b0a
MD5 52a8a34a5642f78eec560213d1524c06
BLAKE2b-256 10c7a7f05515c9849b5a7fcfec90d67484eb20dcc38e5a4fc65a52d7c63664d5

See more details on using hashes here.

File details

Details for the file alphaforged-0.3.8-py3-none-any.whl.

File metadata

  • Download URL: alphaforged-0.3.8-py3-none-any.whl
  • Upload date:
  • Size: 703.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.4

File hashes

Hashes for alphaforged-0.3.8-py3-none-any.whl
Algorithm Hash digest
SHA256 a0956405fb8127b81a49618bb414ded7b56bc41925b3e1243c9ae6fb3d8c3432
MD5 c77bdad05119ac55bb5c09a48495e19a
BLAKE2b-256 f353cc116dca33b51f6876aea387a3fc5075764bd9443d4628fd98c376edfa3e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page