[ Creator & Quantitative Developer ] · 2026 · Shipped

Survivorship-Free Backtester

Honest, survivorship-bias-corrected backtesting and paper trading engine for Indian equities.

2,800+stocks indexed
26 yearsNSE history
1.0 vs 1.5honest vs biased Sharpe
~18% vs 38%halved max drawdown

Engineering Architecture & Teardown

Survivorship-Free Backtester: Honest Quantitative Trading Engine
1080p 30fps · Hyperframes

Most retail backtests quietly lie: they test the past using today's winning stocks (survivorship bias), assume fractional shares that do not exist, and ignore tax friction. This engine was built to deliver the honest version using free data sources.

System Architecture

flowchart LR
    subgraph RawData["Free Ingestion Layer"]
        Bhavcopy["NSE Bhavcopy (1 req/day)"]
        Wayback["Internet Archive (Nifty 100/200/500 PIT)"]
        YFin["Yahoo Finance (Deep History)"]
    end

    subgraph Storage["High-Performance Store"]
        DuckDB[("DuckDB In-Memory / Vectorized Store")]
    end

    subgraph Engine["Strategy & Simulator"]
        Survivorship["Survivorship Bias Correction (PIT)"]
        Tournament["Strategy Tournament (15+ models)"]
        Regime["Ensemble + 200d Regime Cash Filter"]
        TaxSim["After-Tax FIFO Simulator (STCG / LTCG)"]
    end

    subgraph Output["Execution"]
        PaperLedger["Live Paper Account / Ledger"]
        Signals["Signal Engine (Honest Stats)"]
    end

    RawData --> DuckDB
    DuckDB --> Survivorship
    Survivorship --> Tournament
    Tournament --> Regime
    Regime --> TaxSim
    TaxSim --> PaperLedger
    TaxSim --> Signals

Core Empirical Findings

  • Survivorship Bias Impact: Testing against surviving stocks artificially inflates momentum strategies by +0.4 to +0.9 Sharpe ratio.
  • Factor Exposure: Intraday dip-buying strategies failed completely once real market microstructure and taxes were incorporated.
  • The True Winner: An ensemble strategy switching to cash when the index falls below the 200-day moving average offered the best risk-adjusted profile.

Architectural Decisions

Build & Incident Log

  1. Created DuckDB bulk bhavcopy ingest pipeline and yfinance historical seed scripts.
  2. Recovered historical delisted-loser prices and integrated Wayback point-in-time index membership.
  3. Ran tournament across 15+ quantitative strategies and verified the momentum inflation anomaly (+0.4 to +0.9 Sharpe).
  4. Deployed idempotent, cron-driven live paper accounts with real fund NAV tracking via mfapi.in.