Back to projects
Python FastAPI Docker PostgreSQL

Velox

A production-grade autonomous algorithmic trading system built on the Alpaca API. Designed for consistent returns over big wins, targeting 0.3-0.8% per trade with a 65-75% win rate across 6 diversified strategies.

View on GitHub
95.7k Lines of code
6 Trading strategies
900+ Tests
175 Python modules

Six diversified trading strategies

25%

StatMeanReversion

Ornstein-Uhlenbeck process z-scores on 2-minute bars for statistical mean reversion trades.

27%

KalmanPairsTrader

Kalman filter on cointegrated pairs for spread trading with dynamic hedge ratios.

18%

PEAD

Post-earnings announcement drift with FinBERT sentiment scoring for directional trades.

13%

VWAP v2 Hybrid

VWAP combined with OU dual confirmation for high-probability entries on liquid names.

12%

ORB v2

Opening range breakout with quality filters for capturing early momentum moves.

5%

IntradayMicroMomentum

SPY volume spike detection for short-term momentum scalps on high activity.

Multi-layered risk controls

18-Stage Signal Pipeline

ML confidence gating with sector enforcement capped at 30% maximum allocation per sector.

Exit Orchestrator

Unified exit system with a 10-priority cascade handling stops, targets, and time-based exits.

Circuit Breaker

4-tier system activating from -1% to -4% drawdown to protect capital during adverse conditions.

VaR Monitoring

Parametric, historical, and Monte Carlo Value-at-Risk calculations for continuous risk assessment.

Beta Neutralizer

Automatically hedges portfolio exposure with SPY when absolute beta exceeds 0.3 threshold.

Correlation Limiter

Eigenvalue-based effective bet calculation prevents over-concentration in correlated positions.

ML-powered decision making

ML Ensemble

4-model averaging system achieving 0.947 AUC with 50 core features for high-confidence trade signals.

FinBERT Sentiment

Local NLP model scoring earnings sentiment without paid API dependencies for the PEAD strategy.

Adaptive Scanning

Dynamic scan intervals that adjust frequency based on real-time market activity levels.

Built for production

Stack

Python 3.12+ FastAPI SQLAlchemy Pandas NumPy scikit-learn

Infrastructure

Docker PostgreSQL Prometheus Grafana Alertmanager

Architecture

  • 6-service Docker stack
  • 7-state OMS machine
  • TWAP execution for large orders
  • Position recovery on restart
  • Kill switch for emergency halt

Observability

  • Structured logging with correlation IDs
  • Prometheus metrics export
  • Web dashboard at port 8080
  • 8-type health alert system
  • Daily Telegram reports

See the full source

Velox is open-source and available on GitHub.