top of page

Backtest Engine

Simulate. Measure. Optimize. 

Description

Portfolio backtesting engine that simulates historical performance of financial portfolios. Loads market data and portfolio definitions, executes trades with realistic cost modeling (commissions, slippage), computes 30+ performance and risk metrics, and generates detailed reports. Can be run in standalone mode, configurable from Excel, programmatically in Python, or via Docker.

Features

  • Configurable from an Excel file, or directly in a Python script. Docker image also available. CLI interface for project initialization and execution.

  • PyArrow-based simulation engine with component-oriented architecture: PortfolioStateManager, ExecutionBroker, and ReportingEngine work together for accurate, high-performance backtesting.

  • Comprehensive performance and risk metrics: Sharpe Ratio, Sortino Ratio, CAGR, VaR (historical + Gaussian), CVaR, Maximum Drawdown, Alpha, Beta, Information Ratio, and 20+ more, all computed automatically.

  • Benchmark comparison built in. Track portfolio performance against any benchmark index (e.g., SPY) with alpha, beta, and relative return analysis across annual and cumulative periods.

  • Long-short portfolio support. Define portfolios with positive weights (long) and negative weights (short), with automatic validation for both strategies.

  • Pluggable cost models for commissions and slippage via clean interfaces. Configure execution price (VWAP or Adjusted Close), commission per share, and cash reserve percentages.

  • Multi-variation backtesting with BacktestSuite. Run multiple backtest scenarios (parameter sweeps, different portfolios) sharing a single data pipeline, with comparative reporting.

  • Interactive Dash dashboard with portfolio value evolution, cumulative returns vs. benchmark, composition pie charts, weights evolution, drawdown analysis, and annual returns comparison.

  • Professional Excel reports with 8+ sheets: Summary, Daily Performance, Drawdown Analysis, Commission Tracking, Holdings, Benchmark Comparison, Annual Returns, and Portfolio Definition.

  • Robust data handling: automatic date format detection, flexible column name mapping, data integrity validation, and support for CSV, Parquet, and Excel input formats.

Supported Input Formats

  • Market Data: CSV, Parquet (one file per ticker with OHLCV data)

  • Portfolios: CSV, Excel (ticker weights with rebalancing dates)

  • Configuration: Excel workbook or programmatic Python configuration

bottom of page