ML-enhanced quantitative strategy research — from raw market data to walk-forward validated trading signals.
Disclaimer: This project is for educational and portfolio demonstration purposes only. Nothing presented here constitutes investment advice, financial advice, or a recommendation to buy or sell any securities. Past backtest performance does not guarantee future results.
Phase 1 introduced LightGBM-based signal generation with per-ticker walk-forward validation. Each symbol gets its own model trained exclusively on its own past data — no cross-symbol leakage. The model predicts price direction over a forward horizon, and the backtester trades those signals through the same execution engine used for the Phase 0 baselines.
The key finding: the 5-day directional model is profitable on 19 of 26 tickers tested (73%), spanning mega-cap tech, financials, healthcare, energy, and consumer sectors. Mean Sharpe of 0.260 across 26 tickers vs 0.009 for the best Phase 0 baseline — a 29× improvement. The edge is small but consistent, exactly what you'd expect from a well-regularized model on efficient markets. Top performers include MSFT (Sharpe 1.06), HD (92% win rate), and UNH (Sharpe 0.86 on the 20-day model).
| Ticker | Sharpe | Return/Fold | Win Rate | Max DD | Trades |
|---|---|---|---|---|---|
| MSFT | 1.060 | 1.06% | 66.0% | 0.49% | 243 |
| AAPL | 0.541 | 0.74% | 55.8% | 0.84% | 201 |
| HD | 0.539 | 0.57% | 92.2% | 0.82% | 86 |
| META | 0.512 | 1.05% | 58.6% | 0.71% | 163 |
| AMZN | 0.478 | 0.14% | 46.7% | 0.81% | 102 |
| JPM | 0.430 | 0.31% | 64.2% | 0.65% | 195 |
| GOOG | 0.394 | 0.38% | 59.8% | 1.17% | 166 |
| V | 0.393 | 0.34% | 62.8% | 0.99% | 315 |
| UNH | 0.381 | 0.34% | 55.3% | 1.03% | 335 |
| NVDA | 0.346 | 0.93% | 47.5% | 1.81% | 122 |
| CRM | 0.303 | 0.21% | 67.5% | 1.36% | 323 |
| NKE | 0.303 | 0.24% | 61.0% | 1.03% | 253 |
| SPY | 0.206 | 0.11% | 69.1% | 1.02% | 218 |
| PYPL | 0.196 | 0.35% | 60.9% | 1.29% | 103 |
| DIS | 0.193 | 0.30% | 63.8% | 0.59% | 143 |
| CVX | 0.154 | -0.08% | 33.1% | 0.57% | 93 |
| GS | 0.147 | -0.43% | 53.0% | 1.07% | 144 |
| BAC | 0.142 | -0.41% | 42.0% | 1.16% | 216 |
| TSLA | 0.116 | 0.29% | 57.4% | 2.77% | 213 |
| JNJ | 0.096 | -0.30% | 66.3% | 0.88% | 239 |
| CAT | 0.080 | 0.19% | 46.2% | 0.84% | 129 |
| WMT | 0.050 | -0.13% | 43.1% | 0.49% | 195 |
| NFLX | -0.038 | 0.35% | 41.6% | 1.33% | 261 |
| SBUX | -0.045 | 0.20% | 51.4% | 0.95% | 294 |
| BA | -0.106 | -0.46% | 43.4% | 1.49% | 193 |
| PFE | -0.121 | -0.07% | 48.4% | 0.39% | 139 |
| Ticker | Sharpe | Return/Fold | Win Rate | Max DD | Trades |
|---|---|---|---|---|---|
| UNH | 0.864 | 0.88% | 90.3% | 1.20% | 83 |
| AAPL | 0.664 | 1.03% | 66.0% | 1.90% | 151 |
| SPY | 0.523 | 0.40% | 83.6% | 1.09% | 70 |
| TSLA | 0.497 | 0.97% | 58.5% | 1.50% | 80 |
| JPM | 0.480 | 0.54% | 80.1% | 1.10% | 123 |
| AMZN | 0.471 | 0.38% | 67.6% | 0.80% | 55 |
| NFLX | 0.451 | 1.29% | 74.0% | 1.30% | 66 |
| CRM | 0.366 | 0.51% | 56.0% | 1.20% | 93 |
| DIS | 0.343 | 0.35% | 89.2% | 0.50% | 17 |
| V | 0.329 | 0.19% | 64.3% | 1.00% | 101 |
| GOOG | 0.292 | -0.07% | 50.5% | 1.10% | 68 |
| WMT | 0.291 | 0.12% | 56.1% | 0.50% | 45 |
| CAT | 0.235 | 0.37% | 50.4% | 0.80% | 73 |
| CVX | 0.195 | 0.24% | 60.4% | 0.70% | 81 |
| GS | 0.169 | -0.24% | 39.8% | 0.90% | 55 |
| PYPL | 0.121 | 0.41% | 52.5% | 0.60% | 12 |
| Ticker | Sharpe | Return/Fold | Win Rate | Max DD | Trades |
|---|---|---|---|---|---|
| TSLA | 0.427 | 0.92% | 58.5% | 1.80% | 140 |
| AMZN | 0.386 | 0.44% | 69.9% | 0.70% | 60 |
| META | 0.359 | 0.14% | 56.7% | 0.90% | 117 |
| SPY | 0.143 | -0.03% | 29.0% | 0.50% | 22 |
| GS | 0.130 | -0.57% | 23.0% | 0.60% | 25 |
| V | 0.121 | 0.34% | 55.0% | 0.80% | 118 |
These are unoptimized rule-based strategies with default parameters. They establish the performance floor that the ML models must beat. Most have Sharpe ratios below 0.5 — the ML pipeline above demonstrates a clear improvement.
| Strategy | Type | Symbols | Return | Sharpe | Max DD | Win Rate | Trades | Period |
|---|---|---|---|---|---|---|---|---|
| sector-dual-momentum | allocation | XLK, XLF, XLE +9 | 27.39% | 0.263 | 18.93% | 54.9% | 164 | 2015-01-02 — 2025-12-31 |
| mean-rev-rsi | signal | AAPL | 4.81% | 0.152 | 3.91% | 65.5% | 29 | 2020-01-02 — 2025-12-31 |
| mean-rev-zscore | signal | AAPL | 1.48% | 0.072 | 4.63% | 52.5% | 59 | 2020-01-02 — 2025-12-31 |
| mean-rev-bollinger | signal | AAPL | 1.38% | 0.069 | 4.84% | 51.7% | 58 | 2020-01-02 — 2025-12-31 |
| momentum-breakout | signal | AAPL | 0.77% | 0.063 | 3.48% | 53.2% | 141 | 2020-01-02 — 2025-12-31 |
| factor-support-resistance | signal | AAPL | 0.17% | 0.025 | 7.82% | 100.0% | 1 | 2020-01-02 — 2026-04-02 |
| pairs-trading | signal | KO, PEP | -0.96% | 0.019 | 4.53% | 53.1% | 64 | 2018-01-02 — 2025-12-31 |
| momentum-macd | signal | AAPL | -1.95% | 0.007 | 6.06% | 41.1% | 107 | 2020-01-02 — 2025-12-31 |
| sector-momentum | allocation | XLK, XLF, XLE +8 | -22.71% | -0.000 | 63.04% | 40.6% | 614 | 2015-01-01 — 2026-04-01 |
| momentum-dual-ma | signal | AAPL | -4.00% | -0.076 | 9.06% | 28.6% | 49 | 2020-01-02 — 2025-12-31 |
The ML pipeline is fully automated via CLI and designed for reproducibility:
Feature store: Computed features are versioned and cached as Parquet files with content-addressable hashing. Feature configs are declarative YAML — new features can be added without code changes.
All backtests use a custom event-driven engine that processes bars sequentially to prevent lookahead bias. Orders fill at the next bar's open price with slippage applied.
| Phase | Focus | Status | Outcome |
|---|---|---|---|
| Phase 0 | Data ingestion, 13 baseline strategies, backtesting engine, CLI, research notebooks | Complete | Working end-to-end pipeline. 308 tests, 10 strategy types. |
| Phase 1 | ML pipeline — 58 features, LightGBM + Optuna, walk-forward CV, MLflow, 5 ML strategies | Complete | ML beats all baselines. Best config: Sharpe 0.485, 6/6 tickers profitable. |
| Phase 2 | Paper trading via Alpaca, order management, cloud deployment (Railway), performance dashboard (Vercel) | Next | Forward-testing validated strategies with real market data. |
| Phase 3 | Interactive dashboard, real-time monitoring, live P&L tracking | Planned | Strategy configuration UI, alerts, and operational monitoring. |
| Phase 4 | Live trading, advanced risk management, additional ML models, alerting | Planned | Real capital deployment with production-grade risk controls. |