The following key metrics are calculated using QuantStats, a popular open source package which provides portfolio analytics for quantitative investment strategies. This glossary explains how each metric is calculated and what it means.
returns.add(1).prod() - 1 The total compounded return for a strategy over the entire backtest period. It shows how much the initial investment would have grown or contracted.
A 60% cumulative return means an initial $100 investment would grow to $160 over the entire period.
(1 + cumulative_return)^(1/years) - 1 The mean annual growth rate of an investment over a specified time period longer than one year. CAGR provides a “smoothed” annualized return.
A CAGR of 15% means the investment grew at an average rate of 15% annually, with compounding effects considered.
(1 + daily_returns).prod()^(1/n) - 1 The geometric mean of daily returns, representing the expected return for any single day based on historical performance.
This shows what you can statistically expect on any given trading day, based on the historical data.
(1 + monthly_returns).prod()^(1/n) - 1 The geometric mean of monthly returns, representing the expected return for any single month based on historical performance.
This shows what you can statistically expect on any given month, based on the historical data.
(1 + yearly_returns).prod()^(1/n) - 1 The geometric mean of yearly returns, representing the expected return for any single year based on historical performance.
This shows what you can statistically expect on any given year, based on the historical data.
The probability that the observed Sharpe ratio is statistically significant and not due to chance. Adjusts the Sharpe ratio for estimation errors due to limited data.
Based on statistical confidence intervals for the estimated Sharpe ratio, considering sample size and distribution characteristics. A higher probability value (closer to 1.0) indicates greater confidence that the strategy’s Sharpe ratio is statistically valid.
average_return / (standard_deviation * autocorrelation_penalty) A modification of the standard Sharpe ratio that penalizes returns with negative autocorrelations (reversals) in the return series.
The autocorrelation penalty adjusts for return persistence or mean reversion, providing a more accurate risk-adjusted return measure for strategies with potential serial correlations.
average_return / downside_deviation Similar to the Sharpe ratio but only penalizes downside risk (negative returns) rather than total volatility. Focuses on harmful volatility only.
Downside deviation only considers returns below a minimum acceptable return (often zero).
average_return / (downside_deviation * autocorrelation_penalty) A modified Sortino ratio that incorporates the autocorrelation penalty to adjust for serial correlation in returns.
Like Smart Sharpe, this metric provides a more accurate assessment for strategies with potential serial correlations, but focuses only on downside risk.
(strategy_return - benchmark_return) / tracking_error Measures a strategy’s risk-adjusted returns relative to a benchmark, showing excess return per unit of tracking error.
Tracking error measures the standard deviation of the difference between strategy and benchmark returns.
CAGR / |Maximum_Drawdown| Measures the return relative to maximum drawdown risk, showing return per unit of max drawdown.
A higher Calmar ratio indicates better risk-adjusted performance with respect to large drawdowns. Particularly useful for evaluating strategies’ worst-case scenarios.
(strategy_return - risk_free_rate) / beta Measures excess return per unit of market risk (beta), showing how much return a strategy generates for each unit of systematic risk taken.
A higher Treynor ratio indicates better risk-adjusted performance in terms of systematic market risk.
(current_value / running_max_value) - 1 The maximum observed loss from a peak to a trough of a strategy, before a new peak is attained. Measured as a percentage.
A maximum drawdown of -25% means the strategy declined 25% from its peak before recovering.
The longest time period, measured in days, that it takes for a strategy to recover from a drawdown.
The maximum duration (in days) between any peak and the following new peak (recovery time). Indicates the potential recovery time an investor might have to wait following a significant loss.
daily_standard_deviation * sqrt(252) The annualized standard deviation of returns, measuring the dispersion of returns and indicating the strategy’s risk level.
Higher volatility indicates greater variability in returns and typically higher risk.
correlation² The coefficient of determination between the strategy and a benchmark, showing how much of the strategy’s movement can be explained by the benchmark’s movement.
An R² of 0.75 means 75% of the strategy’s performance can be explained by the benchmark, while 25% is due to other factors.
covariance(strategy, benchmark) / variance(benchmark) Measures the volatility of a strategy relative to the market (or another benchmark). Indicates systematic risk.
A beta of 1.2 means the strategy is 20% more volatile than the benchmark. A beta of 0.8 means it’s 20% less volatile.
strategy_return - [risk_free_rate + beta * (benchmark_return - risk_free_rate)] The excess return of a strategy over what would be predicted by its beta (market risk). Shows performance independent of market movements.
A positive alpha indicates the strategy outperformed its benchmark on a risk-adjusted basis.
covariance(strategy, benchmark) / (std_dev_strategy * std_dev_benchmark) Measures the degree to which a strategy’s returns move in relation to a benchmark. Values range from -1 (perfect negative correlation) to +1 (perfect positive correlation).
A correlation of 0.8 indicates a strong positive relationship with the benchmark, while -0.3 indicates a moderate negative relationship.
Measures the asymmetry of the return distribution. Positive skew indicates more positive outliers, while negative skew indicates more negative outliers.
Based on the third moment of the return distribution. A strategy with positive skew has a greater likelihood of extreme positive returns, which is generally desirable for investors.
Measures the “tailedness” of the return distribution. Higher kurtosis indicates more extreme outliers (fat tails) compared to a normal distribution.
Based on the fourth moment of the return distribution. High kurtosis suggests a higher probability of extreme returns (both positive and negative), indicating higher risk of unexpected large moves.
mean_return - (std_dev * z_score) The maximum expected loss over a given time period (one day) at a specified confidence level (typically 95% or 99%).
A 95% daily VaR of -2% means there’s a 95% probability that the daily loss will not exceed 2% of the investment.
The average of all drawdowns experienced by the strategy over the analysis period.
Average of all periods where the strategy’s value decreased from a previous peak. Gives a general sense of the typical drawdown an investor can expect.
The average length of time (in days) that drawdowns lasted before recovery.
Average duration of all drawdown periods, from peak to trough to recovery at a new peak. Indicates how quickly the strategy typically recovers from losses.
sum(positive_returns) / |sum(negative_returns)| The ratio of the sum of positive returns to the absolute sum of negative returns. Measures upside performance relative to downside risk.
A ratio greater than 1.0 indicates more gains than pains, with higher values being more favorable.
sum(positive_monthly_returns) / |sum(negative_monthly_returns)| The Gain/Pain ratio calculated using monthly returns instead of daily returns.
Provides a medium-term perspective on the gain-to-pain relationship.
average(positive_returns) / |average(negative_returns)| The ratio of the average positive return to the average negative return, indicating the relationship between winning and losing trade magnitudes.
A payoff ratio of 2.0 means winning trades are typically twice as large as losing trades.
|sum(positive_returns)| / |sum(negative_returns)| The ratio of the gross profit to the gross loss, measuring trading efficiency.
A profit factor above 1.0 indicates profitability, with higher values indicating greater profit per unit of loss.
profit_factor * tail_ratio Combines the profit factor with the tail ratio to provide a comprehensive assessment of risk-adjusted return.
Accounts for both the profitability of the strategy and the balance between upside and downside tail risk.
|returns.quantile(0.95)| / |returns.quantile(0.05)| The ratio of the upper tail to the lower tail returns, measuring the relative size of extreme returns.
A tail ratio greater than 1.0 indicates larger positive outliers compared to negative outliers.
returns.quantile(0.99) / average(positive_returns) The ratio of extremely positive returns (above the 99th percentile) to average positive returns.
Shows how much the strategy’s performance depends on rare, extreme winning days.
returns.quantile(0.01) / average(negative_returns) The ratio of extremely negative returns (below the 1st percentile) to average negative returns.
Shows how much the strategy’s performance is affected by rare, extreme losing days.
((win_loss_ratio * win_prob) - lose_prob) / win_loss_ratio A formula that determines the optimal size of a series of bets or investments to maximize long-term growth.
Where win_loss_ratio is the payoff ratio and win_prob/lose_prob are the probabilities of winning/losing.
((1 - win_rate) / (1 + win_rate))^number_of_trades The probability that the strategy will lose all of its capital (or reach a specified loss threshold).
A lower risk of ruin value indicates a more sustainable strategy over the long term.
total_return / |max_drawdown| The ratio of total returns to maximum drawdown, showing the strategy’s ability to recover from losses.
A higher recovery factor indicates better resilience against significant drawdowns.
sqrt(mean(squared_drawdowns)) A measure of downside risk that considers both the depth and duration of drawdowns.
Unlike standard volatility, the Ulcer Index only penalizes downside movements, with more weight given to larger and longer-lasting drawdowns.
(total_return - risk_free_rate) / (ulcer_index * pitfall) A risk-adjusted performance metric that takes into account the ulcer index and drawdown risks.
Where pitfall is a measure of the conditional value at risk relative to standard deviation.
Please wait while we get Zehnvisor on the line for you...