The problem
Retail and small-fund traders want systematic, rules-based execution but lack an engine that runs the same strategy code in backtest and live without behavioral drift.
Purely automated bots are hard to trust with real capital; discretionary LLM 'advice' is unauditable and unbounded.
Signals from a single strategy are noisy — edge needs to be combined and hard-capped before it touches a live account.
The approach
Built an event-driven engine (synchronous pub/sub EventBus) where momentum, mean-reversion, statistical-arbitrage, and a gradient-boosted ML strategy feed a conviction-weighted ensemble, then pass through an independent risk layer before broker execution.
Built a separate human-in-the-loop system: a panel of LLM 'investment agents' modeled on famous investors analyzes a watchlist, pitches strategies, answers user follow-up questions, and only executes pitches the user explicitly approves.
Enforced safety with a code-level risk layer (hard position/exposure caps, Kelly sizing, circuit breaker, kill switch) that is independent of any model and defaults to dry-run / paper trading first.
What I built
- Quant engine: momentum, mean-reversion, cointegration stat-arb, and gradient-boosted ML strategies unified by an ensemble voter, with identical code paths for backtest and live feeds
- Risk management module: fractional Kelly position sizing, gross/net exposure limits, correlation caps, ATR-based stops/targets, and a drawdown circuit breaker
- LLM investor-panel app: FastAPI backend + React frontend on Railway, Postgres audit trail (runs, pitches, Q&A, decisions, orders), scheduled daily pitch generation with email notifications
- Alpaca brokerage integration for both systems — paper and live accounts, account/positions sync, order submission, fill capture, and a portfolio reconciler
- SEC EDGAR / fundamentals data ingestion feeding the LLM agents, plus optional alternative-data feeds (news, congressional trades, prediction markets) in the quant engine
- Extensive test suites — 102 tests across the quant engine (unit plus full end-to-end integration on synthetic data) and a broad backend/web test suite for the LLM app
- Python
- Alpaca (alpaca-py)
- scikit-learn
- gradient boosting
- pandas / numpy
- FastAPI
- React
- PostgreSQL / SQLAlchemy
- LangChain / LangGraph
- Anthropic Claude
- SEC EDGAR
- pytest
Result
Both run end-to-end as working prototypes: the quant engine backtests and paper-trades a multi-strategy ensemble with full test coverage; the LLM panel app runs a complete pitch, Q&A, approve, risk-guard, execute cycle, dry-run and paper-first before any live keys.