Aayush Bankar
S–03

Algorithmic Backtesting

Quantitative Finance

Minor Project Wrap

QuantLab

Event-Driven Simulation with Indian Market Friction

GTU Diploma Semester 5 minor project (DI05000341). An event-driven backtesting engine modeling statutory Indian taxes (STT, stamp duty, GST) and Almgren-Chriss nonlinear slippage, using Combinatorial Purged Cross-Validation (CPCV) with embargo and Deflated Sharpe Ratio to assess overfitting.

Architectural Plate // QuantLabHardware Telemetry & Dataflow
QuantLab Visual Architectural Plate
01

Hardware-Verified Benchmarks

0.73 DSR

Deflated Sharpe

Multi-testing penalty applied across 10 trial strategies

31% Decay

OOS Sharpe Decay

In-sample Sharpe 2.84 degrades to 1.96 under CPCV embargo

28.9% → 37.8%

AR(1) Embargo Shift

Probability of Backtest Overfitting exposed by 5% purge

₹384.81 / trade

Statutory Drag

Taxes consume ~3.85% of profit on ₹1L round-trip

T+1 Invariant

Execution Model

Signal evaluated at Day t Close; filled at Day t+1 Open

NIFTY 50 + Midcaps

Universe Scope

Daily bars from 2019–2024 with split and dividend adjustments

02

Technical Specification Sheet

Simulation ArchitectureDiscrete event-driven loop with stateful Order, Position, Portfolio objects
Validation FrameworkCombinatorial Purged Cross-Validation (N=10, k=2, 45 paths, 10-bar embargo)
Overfitting MetricsDeflated Sharpe Ratio (DSR), Probability of Backtest Overfitting (PBO)
Slippage ModelAlmgren-Chriss square-root temporary & permanent execution impact
Statutory Fee ScheduleBrokerage (₹20 cap) + STT (0.10%) + Stamp Duty (0.015%) + GST (18%) + Exchange (0.00297%)
Universe AnalyzedNIFTY 50 + 100 liquid midcaps across 7 sectors (5-year continuous history)
Lookahead GuardT+1 invariant strictly separating signal calculation from execution fill
User InterfaceInteractive Streamlit comparison matrix and automated performance tearsheet generator

ARCArchitectural Overview

Engineering Architecture

Grounded in the SEBI 2024 retail trading study—which revealed 93% of active retail traders in India lost money, with transaction friction accounting for 28% of gross losses. QuantLab exposes the statistical illusions in retail trading strategies by enforcing rigorous empirical friction. It replaces naive frictionless backtests with discrete event simulation, modeling Almgren-Chriss square-root market impact and the exact Indian statutory tax schedule (STT, stamp duty, GST, SEBI turnover, brokerage caps). Overfitting is audited using Combinatorial Purged Cross-Validation (N=10, k=2, 45 paths) with 10-bar embargoes and Deflated Sharpe Ratio penalties.

Key Technical Innovations:

  • ›Models statutory Indian taxes that wipe out typical algorithmic paper gains.
  • ›Incorporates Combinatorial Purged Cross-Validation with 10-bar embargoes.
  • ›Deflated Sharpe Ratio penalizes multi-testing data snooping bias across strategy trials.

VFDGround-Truth Verification

Empirical Test Record

Evaluated against 5 years of National Stock Exchange historical EOD data (2019-2024).

PythonPandasNumPyStreamlitStatsmodelsAlmgren-Chriss Model

CHT6 Simulation Exhibits (Full Uncropped Curves)

Simulated Equity Curve

Simulated Equity Curve

SMA crossover strategy on NIFTY50 universe with full Almgren-Chriss impact and statutory costs.

Drawdown Profile

Drawdown Profile

Max drawdown analysis showing 23.4% peak-to-trough decline under market stress periods.

In-Sample vs OOS Sharpe

In-Sample vs OOS Sharpe

In-sample Sharpe ratio of 2.84 falls to 1.96 under out-of-sample combinatorial purged testing.

CAGR vs Sharpe Ratio

CAGR vs Sharpe Ratio

Comparison of 3 strategies under gross vs net performance; momentum survives friction while RSI collapses.

Almgren-Chriss Impact Calibration

Almgren-Chriss Impact Calibration

Square-root market impact curve calibrated on National Stock Exchange tick volumes.

Monthly Returns Distribution

Monthly Returns Distribution

5-year monthly return heatmap revealing regime changes and cost drag distribution shift.