Skip to content
All library documents

Backtest Statistics: Metrics, Resampling, and Equity Visualization

Code Stratmill research code

Summary

This document describes a backtest reporting framework that computes metrics over a full record and, optionally, across daily, hourly, or monthly partitions. Metric classes can be instantiated with relevant supplied parameters, then receive the record and a time context. The default metric set covers returns, risk-adjusted performance, drawdown, trade activity, trading value, and position value.

Records can be resampled to reduce computation and plotting cost, though the sampling interval may affect interval-dependent metrics. Linear and inverse asset records derive fee-free equity and trading value using different position and price relationships. When exact trading data is unavailable, trading values are estimated from changes in recorded positions, and information may have been lost between recording intervals. The plotting tools show equity, fees, price, and positions, with optional return scaling. The excerpt provides implementation behavior and caveats, but no empirical strategy results or metric definitions.

Key ideas

  • Metrics are computed for the full record and may also be computed over time partitions.
  • The default report includes return, drawdown, trade activity, and position-related measures.
  • Resampling can reduce processing and plotting time but may change interval-sensitive statistics.
  • Linear and inverse records use different formulas to derive equity and trading value.
  • Trading value inferred from sampled positions may be approximate when recording intervals omit activity.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.