Quant Trading Platform
Regime-aware swing trading with multifactor ranking and paper execution.
Multifactor + HMM regime · 15-min paper-trade cycle
The problem
Quant tutorials usually stop at a backtest. This one runs the full loop: watchlist ingestion, multifactor ranking, regime detection, sentiment overlay, paper execution with sizing and stops, and a scheduled cycle that runs on the clock.
Who this is for
Quant / systematic-trading engineers, candidates for a research-engineer role wanting to see infra-quality plumbing under a strategy.
Architecture
- Yahoo Finance ingestion
- Daily history for the watchlist (SPY, QQQ, IWM, TLT, GLD, XLK, SMH, AAPL, MSFT, NVDA, META, ...).
- Multifactor ranking model
- Trend, momentum, relative strength, accumulation / volume combined into a per-name score.
- HMM regime detector
- Market regime classification used as a sizing / on-off overlay on the ranking signal.
- FinBERT sentiment
- News sentiment as an additional input on top of price signals.
- FRED macro inputs
- Macro context (rates, breadth) feeds into the regime detector.
- Paper execution engine
- Entry sizing, stop, take-profit, trailing-stop; orders posted to the IBKR paper account.
- Scheduled cycle
- 15-min cron-style loop that re-ranks, rechecks regime, and fires orders.
- Streamlit dashboard + FastAPI API
- UI for the daily view; API for programmatic access.
Request / data flow
- 01Cron triggers cycle → ingest fresh prices.
- 02Multifactor model re-ranks watchlist.
- 03HMM updates regime → sizing scale chosen.
- 04FinBERT sentiment overlays the ranking.
- 05Engine compares against the live paper book → emits buy / sell / stop adjustments.
- 06Dashboard reflects the new positions and P&L.
Key decisions
Regime detector via HMM, not just a trend filter.
whyTrend filters lag at regime turning points; HMM captures the latent state and de-risks earlier.
Paper, not live.
whyStrategy is for learning and demo; risking real capital changes the project from "build the loop" to "prove the edge".
Streamlit + FastAPI both, not Streamlit alone.
whyStreamlit is great for the dashboard but bad as an API. The split keeps a clean machine-callable interface.
Stack
If I rebuilt it
- ›Persist cycle results into TimescaleDB so you can audit any past decision against the inputs it saw.
- ›Add a Sharpe / max-drawdown comparison vs SPY surfaced in the dashboard.