Case Studies Building a Systematic Options Backtesting Framework
quant Investment Firm · 2024–2026

Building a Systematic Options Backtesting Framework

Designed and built a production-grade backtesting framework for systematic index options strategies at Mastertrust, enabling Sharpe 4 performance on live portfolios exceeding ₹100 crore AUM.

Problem

No systematic framework for testing options strategies — results were anecdotal, overfitting was invisible, and strategy failures were only discovered in live trading.

Outcome

Sharpe ratio of 4 in live index options strategies managing ₹100+ crore AUM, with full walk-forward validation and execution cost modeling.

Overview

At Mastertrust, I led the development of the firm’s quantitative research infrastructure from scratch. The core piece was a systematic backtesting framework that could honestly evaluate options strategies — incorporating execution costs, slippage, capital constraints, and regime sensitivity — not just raw P&L on historical fills. The result: a Sharpe ratio of 4 on live index options strategies managing portfolios exceeding ₹100 crore.

The Problem

When I joined, strategy evaluation was informal. A strategy “worked” if the last few months looked good. There was no walk-forward validation, no overfitting score, no slippage model, no capital efficiency metric. The feedback loop between research and live performance was broken — strategies were approved on the basis of in-sample patterns that had no out-of-sample predictive power.

Why It Mattered

In options trading, the cost of an overfitted strategy is immediate and measurable. A strategy that looks great on paper but loses money live doesn’t just cost P&L — it costs confidence in the research process, erodes capital, and creates pressure to keep adjusting until you’ve completely destroyed the original edge. The framework needed to make the overfitting problem visible before capital was at risk.

Data & Inputs

Approach

The framework was built around three core principles:

Walk-forward only. Every strategy was evaluated using expanding-window or rolling-window walk-forward splits, never in-sample on the full history. This made the overfitting problem structural rather than a discipline issue.

Parameter stability scoring. Strategies were scored not just on peak Sharpe but on how sensitive that Sharpe was to small parameter perturbations. A strategy that requires precise parameter values is fragile; a strategy that works across a range of parameters has a real edge.

Execution-realistic simulation. Fills were simulated with bid-ask spread costs, market impact, latency delays, and position sizing constraints. The difference between theoretical P&L and realistic P&L was tracked explicitly.

I deliberately rejected black-box optimization — every signal and parameter had a qualitative reason for existing before it was tested quantitatively.

Engineering & Implementation

The core architecture:

The ML components (LSTMs, transformer-style models for IV forecasting) were integrated as signals, not as the strategy itself — the framework could evaluate any signal source.

Results & Impact

Limitations & What I’d Do Differently

The framework handles single-leg and spread strategies well but becomes computationally expensive for multi-leg exotic structures. If building from scratch again, I’d design the fill simulation layer to be parallel from the start — sequential simulation of complex Greeks scenarios is a bottleneck at scale.

The regime detection model is rule-based and works well in practice, but a learned regime classifier with probabilistic outputs would be more robust to novel market conditions.

Stack

Python, NumPy, Pandas, PyTorch (signal models), QuantLib (Greeks and pricing), PostgreSQL, Redis, Grafana, custom backtesting engine

Stack

Python NumPy Pandas PyTorch QuantLib PostgreSQL Redis Grafana
options backtesting quant systematic-trading volatility

Lets collaborate!

Whether you need a quantitative researcher, an machine learning systems builder, or a technical advisor — I'm available for select consulting engagements.

Get in Touch →