- Published on
Backtest Statistics
Backtest Statistics
This chapter provides a comprehensive overview of the statistics required to evaluate a backtest, regardless of the backtesting paradigm used (historical, cross-validation, or synthetic). These metrics are essential for investors to compare strategies and identify potential flaws, such as hidden risks or low capacity.
General Characteristics
These statistics describe the high-level properties of the strategy:
- Capacity: The highest AUM the strategy can manage before performance degrades.
- Leverage: The amount of borrowing used.
- Frequency of Bets: The number of bets per year. A "bet" is a full cycle from a flat position to an exit, which is a more informative metric than "trades."
- Average Holding Period: The average time a bet is held.
- Annualized Turnover: The ratio of the average dollar amount traded per year to the average AUM.
- Correlation to Underlying: A high correlation suggests the strategy is not adding significant alpha.
Performance
These are unadjusted performance metrics.
- Time-Weighted Rate of Return (TWRR): The GIPS-compliant standard for calculating returns. It adjusts for external cash flows and geometrically links sub-period returns to provide a true performance measure.
- Geometric Linking:
- Annualized Return:
- Hit Ratio: The fraction of bets that resulted in a profit.
- Average Return from Hits/Misses: The average PnL for winning and losing bets, respectively.
Runs and Drawdowns
These metrics evaluate risk, particularly for non-IID (Independent and Identically Distributed) returns.
- Returns Concentration (HHI): Measures if returns are concentrated in a few lucky bets, similar to the Herfindahl-Hirschman Index. A value near 0 is ideal (uniform returns), while a value near 1 means a single bet generated all the PnL.
- Equation (for positive returns):
- Equation (for positive returns):
- Drawdown (DD): The maximum loss from a peak-to-trough in PnL.
- Time under Water (TuW): The time elapsed to recover from a drawdown and reach a new high-watermark.
Efficiency (Risk-Adjusted Performance)
This is the most critical category, as it corrects performance for risk, skewness, and selection bias.
Sharpe Ratio (SR): The standard measure of mean excess return over volatility.
- Equation:
- Equation:
Probabilistic Sharpe Ratio (PSR): A key metric that adjusts the SR for non-Normal returns (skewness , kurtosis ) and short track records (). It estimates the probability that the true SR is above a benchmark .
- Equation:
- Equation:
Deflated Sharpe Ratio (DSR): A PSR that also corrects for selection bias (multiple testing). It calculates the expected maximum SR () one would get by pure chance from trials, and then uses that as the rejection threshold.
- Equation for :
- This leads to Marcos' Third Law of Backtesting: "Every backtest result must be reported in conjunction with all the trials involved in its production... it is impossible to assess the backtest's 'false discovery' probability."
- Equation for :
Classification Scores (for Meta-Labeling)
These metrics are used to evaluate the secondary (overlay) model in a meta-labeling context.
- Accuracy, Precision, and Recall: Standard classification metrics.
- F1-Score: The harmonic mean of precision and recall. It is the preferred metric over "accuracy" for imbalanced datasets, which are common in meta-labeling.
- Equation:
- Equation:
- Negative Log-Loss: A score that penalizes overconfident wrong answers. It is superior to accuracy because it evaluates the model's predicted probabilities, not just the final label.
- Equation:
- Equation:
API reference
RiskLabAI implements these in Python and Julia (signatures auto-generated from the package source):
| Python | Julia |
|---|---|
| |
| |
| |
| |
| |
| |