Backtest performance metrics

Backtesting metrics explained without magic numbers

Read return, risk, trade, and activity metrics together. Each describes one part of a historical simulation; none proves that a strategy will work live.

BotSpot capabilities

Research by conversation

Ask the agent to investigate markets, companies, filings, strategies, and your connected account context.

Place approved direct trades

When direct trading is enabled, request a one-time trade in plain English, inspect the order, and approve it before submission.

Build complete algorithms

Create, revise, backtest, connect, and operate Lumibot strategies without assembling the full application stack yourself.

Use the AI client you prefer

Work in BotSpot or connect through ChatGPT, Claude, Cursor, Codex, and other compatible MCP clients.

Start by documenting calculation conventions

A metric is interpretable only when its inputs and conventions are known. Record test dates, return frequency, simple or logarithmic returns, annualization factor, risk-free rate, minimum acceptable return, benchmark, and treatment of fees, slippage, dividends, cash, and open positions.

Compare strategies using the same data window and calculation method. Two platforms can show different values for the same equity curve because their sampling, annualization, trade grouping, or cost assumptions differ.

  • State whether results use gross or net returns.
  • State whether calculations use daily, weekly, monthly, or trade-level observations.
  • State how break-even trades and open positions are treated.
  • Keep percentage, currency, and per-trade metrics clearly separated.

CAGR: compounded growth across the full test

Compound annual growth rate expresses the constant annual return that would connect starting portfolio value with ending portfolio value. For a test lasting T years, CAGR = (ending value / starting value)^(1 / T) - 1.

CAGR accounts for compounding but ignores the path between endpoints. Two strategies can have the same CAGR while experiencing very different volatility, drawdowns, capital exposure, and recovery times.

CAGR becomes misleading when a test contains external deposits or withdrawals. It is undefined or unsuitable when portfolio values needed by the formula are not positive.

Volatility: variability of periodic returns

Historical volatility is usually calculated as the standard deviation of periodic returns. A common annualized estimate is volatility = standard deviation of periodic returns × square root of periods per year.

That square-root annualization is a model convention, not a law. Serial correlation, irregular sampling, stale prices, and changing volatility can make it unreliable.

Volatility treats upside and downside variation alike. It does not directly measure maximum loss, tail risk, liquidity, or time spent below a previous peak.

Sharpe ratio: excess return per unit of total variability

For periodic observations, Sharpe ratio = mean portfolio return minus matching risk-free return, divided by standard deviation of excess returns. A common annualization multiplies the periodic ratio by the square root of periods per year.

Higher values indicate more historical excess return relative to measured variability under the chosen inputs. No universal cutoff makes a strategy good, safe, or deployable.

Sharpe estimates can change materially with test dates, sampling frequency, risk-free rate, outliers, and serial correlation. Publish those inputs rather than presenting the ratio alone.

Sortino ratio: return relative to downside deviation

Sortino ratio replaces total standard deviation with downside deviation below a selected minimum acceptable return. One common form is Sortino = (mean return - minimum acceptable return) / downside deviation.

A common downside-deviation calculation is the square root of the average squared shortfall: sqrt(mean(minimum of 0 and return minus target, squared)). Exact denominator and annualization conventions vary.

Sortino does not penalize returns above the target, making it useful beside Sharpe when return distributions are asymmetric. It still depends on sample quality, selected target, and reliable pricing.

Maximum drawdown: worst observed peak-to-trough decline

At each point, drawdown compares current portfolio value with its previous high. Maximum drawdown = maximum over time of 1 - current value / highest earlier value.

Maximum drawdown describes the deepest historical decline in the selected test. It does not show how often drawdowns occurred, how long recovery took, or whether a worse decline can occur later.

Inspect drawdown duration and time under water beside maximum depth. A brief decline and a multi-year recovery can share the same maximum-drawdown percentage.

Win rate: frequency, not magnitude

Win rate = number of profitable closed trades / total closed trades. State whether break-even trades remain in the denominator and whether fees are deducted before classifying each trade.

A high win rate can coexist with an overall loss when losing trades are much larger than winning trades. A low win rate can coexist with positive historical results when occasional gains outweigh frequent smaller losses.

Profit factor: gross gains relative to gross losses

Profit factor = sum of profits from winning closed trades / absolute sum of losses from losing closed trades. Use realized, net-of-modeled-cost trade results and disclose whether open positions are excluded.

A value above 1 means gross winning-trade profit exceeded gross losing-trade loss within that sample and calculation. It does not reveal drawdown, timing, capital required, result stability, or dependence on one outlier.

Profit factor is undefined or convention-dependent when no losing trades occur. Small trade counts can produce unstable values.

Expectancy: average result per completed trade

Trade expectancy can be written as probability of a win × average win minus probability of a loss × average absolute loss. When all closed trades are classified consistently, it also equals total net profit or loss / number of closed trades.

Label whether expectancy is expressed in currency, percentage return, or units of initial risk. A positive historical expectancy describes the tested sample, not a guaranteed future payoff.

Inspect distribution and sample size. One extreme trade can raise average expectancy while the typical trade remains weak.

Turnover: how much portfolio value changes hands

Turnover definitions vary. One established annual convention is turnover = lesser of security purchases or sales / average portfolio value. Other systems estimate the percentage of portfolio value replaced or sum position-weight changes.

Publish the exact convention. Turnover is not interchangeable with trade count because one large rebalance and many small trades can produce different activity profiles.

Higher turnover creates more exposure to commissions, spread, slippage, market impact, taxes, and operational failures. Those costs must be modeled separately rather than inferred from turnover alone.

Read metrics as a system

  • CAGR describes compounded endpoint growth.
  • Volatility describes return variability.
  • Sharpe and Sortino relate return to selected risk measures.
  • Maximum drawdown describes worst observed historical decline.
  • Win rate, profit factor, and expectancy describe closed-trade outcomes.
  • Turnover describes activity and potential execution burden.
  • Trade list, equity curve, exposure, costs, and benchmark supply context that summary metrics omit.

Limitations and risk

Every value on this page is an estimate from historical observations and simulation rules. Bad data, look-ahead bias, overfitting, omitted costs, unrealistic fills, and software defects can make precise-looking metrics wrong.

Review multiple periods and market conditions, preserve out-of-sample data, inspect individual trades, and compare paper behavior with backtest assumptions. Historical metrics cannot predict future returns or maximum losses.

Frequently asked questions

What is a good Sharpe ratio for a backtest?

No universal threshold proves quality. Interpretation depends on return frequency, risk-free rate, test length, costs, asset class, leverage, liquidity, and serial correlation. Compare consistently calculated values and inspect underlying returns.

Should I use Sharpe or Sortino ratio?

Use both when available. Sharpe measures return relative to total variability; Sortino focuses on shortfalls below a chosen target. Neither replaces drawdown, trade distribution, or execution analysis.

Can a strategy have a high win rate and still lose money?

Yes. Win rate counts profitable trades but ignores their size. A few large losses can outweigh many small gains.

Why do backtesting platforms report different metrics?

Platforms may use different return frequencies, annualization factors, risk-free rates, trade grouping, fee models, open-position treatment, and turnover definitions. Compare formulas and inputs before comparing values.

Does positive expectancy predict future profit?

No. Positive expectancy summarizes average results in the tested sample. Future data, fills, costs, liquidity, and market conditions can differ.

Sources

Sources verified 2026-08-14.