/work/statistical-arbitrage
AmanShah
Brief
amanashishshah@gmail.com

© 2026 Aman Shah

Recruiter mode

Self-directed

Work/

Statistical Arbitrage Backtester

Statistical Arbitrage Backtester, at a glance

quant research

time series

Project overview

Walk-forward pairs-trading research engine

Discovers cointegrated pairs, models their mean reversion, and trades them out-of-sample under realistic frictions — built to eliminate look-ahead bias, phantom alpha, and data-snooping.

Role

  • Quant researcher
  • systems engineer

Date

2026

Field

Quant

Stack

Python, NumPy, SciPy, Numba

~13M events/s

Sharpe ≈ 12.2 (synthetic)

zero look-ahead bias

Context

A research-grade intraday statistical-arbitrage backtester in Python on NumPy with a single Numba-compiled execution kernel.

Statistical Arbitrage Backtester, image 1
Statistical Arbitrage Backtester, image 2
Statistical Arbitrage Backtester, image 3
Statistical Arbitrage Backtester, image 4
Statistical Arbitrage Backtester, image 5

Statistical Arbitrage Backtester

Statistical Arbitrage Backtester, image 1

The hard part

Most pairs-trading backtests look profitable for illegitimate reasons: look-ahead bias, phantom alpha from ignoring costs, and data-snooping across many pairs. The whole system is built to remove all three.

Statistical Arbitrage Backtester, image 3

What it took

  • Split the system into a research pipeline that only ever sees the training window and an execution sandbox that receives frozen parameters and replays the future tick by tick — the central defense against look-ahead bias.
  • Screened pairs with Engle–Granger OLS + an Augmented Dickey–Fuller test scored against the MacKinnon response surface (not a Student-t table), fit OU dynamics via an exact AR(1) solver, and controlled data-snooping with Benjamini–Hochberg / Bonferroni corrections.
  • Built a Numba event loop with bid/ask fills, commission, slippage, volume impact, borrow fees, and latency, plus stop/borrow-recall/drawdown liquidation, then combined pairs with score-weighted, correlation-pruned, capped portfolio allocation across walk-forward windows.

Outcome

On a synthetic universe with planted pairs, discovery recovers exactly the genuine pairs under Benjamini–Hochberg correction, reports post-friction risk-adjusted performance over rolling walk-forward slices, and replays ~13M tick events per second.