Lab · Module 05 of 06

Backtest Engine.

Simulate. Measure. Validate. Test more strategies. Trust your results.

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6

What it is

A portfolio backtesting engine: it loads market data and portfolio definitions, executes rebalances with realistic trading costs, computes 30+ performance and risk metrics against a benchmark, and delivers an interactive dashboard and a multi-sheet Excel report.

How you run it

Entirely from an Excel workbook with no code, programmatically in Python, or with Docker.

It prevents

Paper returns that real trading would have erased.

Features.

  1. Configurable from an Excel workbook, with no code required to run a backtest, or directly from a Python script. A Docker image is also available, and a command line handles project initialization and execution.

  2. Realistic execution: rebalances are simulated with pluggable commission and slippage models, a configurable execution price (VWAP or adjusted close), commission per share and a cash reserve percentage.

  3. 30+ performance and risk metrics computed automatically, including CAGR, Sharpe, Sortino, maximum drawdown, VaR (historical and Gaussian), CVaR, alpha, beta and information ratio.

  4. Built-in benchmark comparison: track your portfolio against any benchmark, such as SPY, with alpha, beta and relative returns across annual and cumulative periods.

  5. The Backtest Suite for multiple scenarios: run parameter sweeps or compare different portfolios on a single shared data pipeline, with side-by-side comparative reporting.

  6. Interactive dashboards: portfolio value, cumulative returns against the benchmark, composition, weight evolution, drawdowns and annual returns.

  7. Professional Excel reports with 8+ sheets: summary, daily performance, drawdown analysis, commission tracking, holdings, benchmark comparison, annual returns and the portfolio definition.

  8. A high-performance PyArrow engine with a component-oriented architecture, in which portfolio state, trade execution and reporting are separate, extensible modules.

  9. Robust data handling: automatic date format detection, flexible column name mapping and data integrity validation.

What it reads.

Market data

CSV or Parquet, one file per ticker, with OHLCV data.

Portfolios

CSV or Excel: ticker weights with their rebalancing dates.

Configuration

An Excel workbook, or configuration in Python.

Everything you need to get started.

The Backtest Engine comes with the Investment Lab licence.