Market-Neutral Pairs Trading with Machine Learning (Capstone Thesis)
Tests whether XGBoost, LightGBM and LSTM signals can beat a classic cointegration pairs-trading strategy, on 105 US large caps over 2010-2025.
PythonXGBoostLightGBMLSTMStatistical Arbitrage
Capstone thesis for the MSc in Financial Engineering at WorldQuant University (supervised by Saad Zaman): can regime-aware machine learning improve a market-neutral pairs-trading strategy?
Built a clean daily-price dataset for 105 US large caps across 12 sectors (2010-2025) with a 95% coverage filter; ran Engle-Granger and Johansen cointegration tests on rolling windows and shortlisted 4 pairs (MA-V, ICE-V, JNJ-LLY, AXP-ICE).
Built daily features using same-day information only (with a variance-inflation check) and trained XGBoost, LightGBM and LSTM signal models, benchmarked against a static z-score cointegration rule.
Walk-forward out-of-sample backtest with transaction costs and a one-day execution delay, plus sensitivity analysis on costs (including 5 bps) and benchmark thresholds.
Findings: tree models classify well (macro-F1 0.76 and 0.75 vs 0.32 for the LSTM) but lose money when traded; mean out-of-sample Sharpe was -0.02 (benchmark), -0.31 (XGBoost), -0.38 (LightGBM), -0.41 (LSTM). High recall with low precision means over-trading, and costs erase the edge. Hypothesis rejected for this universe.
Takeaway: classification accuracy does not translate into trading profit. Limits are stated openly: only 4 pairs, a single validation split, current index constituents only.
Building LSTM neural networks to predict and trade a five-asset ETF universe (equities, bonds, gold, oil), then backtesting the resulting strategy against a simple equal-weight buy-and-hold benchmark.
PythonLSTMTensorFlowBacktesting
Individual LSTM models; built and trained a separate LSTM model for each of five ETFs (SPY for equities, TLT and SHY for long- and short-duration bonds, GLD for gold, DBO for oil), predicting next-period returns from historical price sequences.
Strategy construction & backtesting; converted model predictions into trading signals and backtested the resulting LSTM-based strategy against an equal-weight buy-and-hold benchmark, evaluating performance through cumulative returns, drawdowns, and return distributions.
Multi-output LSTM model; extended the approach to a single multi-output LSTM predicting all five ETFs jointly, testing whether modeling cross-asset relationships in one network improves on training independent models per asset.
Data Leakage & Walk-Forward Backtesting of Deep Learning Trading Models
Shows how data leakage inflates the apparent performance of MLP, LSTM and CNN-GAF models on SPY, then re-tests them with leak-free walk-forward backtesting.
PythonPyTorchNumPyBacktesting
Built a 5-day-ahead direction classifier on 2,000 days of SPY returns (10 lagged returns as features, chronological 70/30 split).
Leakage demonstration: labels built from a global return quantile and features normalized on the full sample; coded a check counting training samples whose labels overlap the test period.
Implemented an MLP, an LSTM (NumPy, gates and BPTT) and a CNN on Gramian Angular Field images of return windows.
Strategy backtest with long/short signals, 5-day non-overlapping trades and 5 bps costs; metrics: total/annualized return, volatility, Sharpe, max drawdown, hit rate versus buy-and-hold. On the leaky setup the MLP and CNN lost money while buy-and-hold had a Sharpe of 1.31.
Walk-forward validation (500/500 and 500/100 windows) with scaling and labels computed inside each fold; retrained MLP and CNN-GAF in PyTorch per fold. Leak-free accuracy of about 59-60% mostly reflected majority-class prediction (class-1 recall of 1-3%).
Takeaway: headline accuracy hides weak predictive power; only leak-free walk-forward tests with trading metrics give an honest picture.
Pricing options under the Heston and Merton models via Monte Carlo simulation, extending to American early-exercise and barrier options; where theory meets the messiness of real option pricing.
PythonMonte CarloHeston ModelOptions Pricing
Heston model (stochastic volatility); simulated correlated stock price and variance processes via Monte Carlo (10,000 paths) to price at-the-money European calls and puts, testing sensitivity to the correlation parameter ρ between asset returns and volatility.
Merton jump-diffusion model; modeled sudden price jumps (Poisson-distributed) layered on top of standard diffusion, pricing options under varying jump intensities and comparing the resulting price curves against the Heston model's smoother, volatility-driven behavior.
Greeks estimation; computed Delta and Gamma numerically under both models to quantify option price sensitivity to the underlying asset.
American options & early exercise; priced an American call under the Heston model using Monte Carlo with Least Squares Regression (the Longstaff-Schwartz approach), confirming the early-exercise premium against the European price.
Barrier options; priced Up-and-In Call and Down-and-In Put exotic options under jump-diffusion, showing how barrier conditions can significantly discount an option relative to its vanilla European equivalent.
Tests 8 portfolio-construction strategies on 10 US equities, combining covariance denoising, Hierarchical Risk Parity and Combinatorial Purged Cross-Validation (CPCV) to reduce overfitting.
PythonHierarchical Risk ParityCPCVRisk Management
Implemented from scratch covariance denoising, Hierarchical Risk Parity (hierarchical clustering of assets) and Combinatorial Purged Cross-Validation (many train/test combinations with purging and embargo to prevent leakage), on 10 US equities (Jan 2024 - Jun 2025).
Built 8 strategies combining these methods, with a 15%-capped Maximum Sharpe portfolio as baseline, and compared annual return, volatility, Sharpe, max drawdown, CVaR and weight stability.
Key findings: MSRP with CPCV ranked first (Sharpe 0.61 vs 0.25 for the baseline); HRP alone had the lowest drawdown (-14% vs -22%); denoising added little on its own; combining all three methods did not help.
Out-of-sample check on July 2025, a month not used to build either portfolio: the baseline did slightly better (Sharpe 8.1 vs 7.0), reported as it came out.
Discussed the prediction vs. interpretation trade-off between simple explainable portfolios and more complex, better-validated ones.
I'm a financial engineer in the making, currently completing my MSc in Financial Engineering at WorldQuant University, with an MBA in Finance from the African School of Economics. My work sits at the intersection of markets and code; I like turning a hunch about how prices behave into something testable, then finding out whether it actually holds up.
I'm currently looking for opportunities in Sales & Trading, with a particular interest in derivatives and systematic strategies. This portfolio is where I share the projects that got me here.