Backtesting guide

Risk-Adjusted Returns: Choose the Right Strategy Metric

A risk-adjusted return compares a strategy's return with a defined measure of risk. Sharpe uses total return variability, Sortino uses shortfalls below a target, Calmar uses historical drawdown, and the information ratio uses variability relative to a benchmark. Choose the risk question first, then compare strategies using the same dates, return frequency, and calculation conventions.

Read the practical guide

Key Takeaways

  • The denominator determines what the ratio measures. A higher Sortino and a lower Sharpe can both describe the same strategy correctly.
  • Monthly account returns, daily account returns, and individual trade percentages are different inputs. Annualization does not make them interchangeable.
  • Choose the risk-free rate, downside target, or investable benchmark before comparing results. Keep its return period consistent with the strategy.
  • Show the underlying return, drawdown, and sample length beside each ratio. No historical ratio establishes safe leverage or limits future losses.

Metric selection matrix: frequency, risk, tails, and benchmark

Use one primary measure for the decision you need to make, then inspect the risks that its denominator omits. The rows below are alternatives for different questions, not interchangeable scores. Expected shortfall is a loss measure used alongside return ratios.

Metric selection matrix: frequency, risk, tails, and benchmark
Measure and questionReturn observationsRisk denominatorTail or path limitationReference return
Sharpe: how much excess return per unit of variability?Equally spaced daily or monthly excess returnsStandard deviation of excess returnsUpside and downside both contribute; rare losses can be absent from the sampleRisk-free return over each matching period
Sortino: how much return above a target per unit of shortfall?Equally spaced returns with a stated targetDownside deviation below that targetIgnores upside variability; few shortfalls give little evidence about future lossesMinimum acceptable return, which need not equal the risk-free rate
Calmar: how much compounded growth relative to the deepest observed loss?Ordered equity path and elapsed years over the same windowMaximum percentage drawdown from a running peakDepends on sequence and sampling; the historical maximum is not a future loss capThis page uses CAGR without subtracting a benchmark
Information ratio: did active returns compensate for benchmark deviations?Strategy minus benchmark returns on matching datesTracking error: standard deviation of active returnsCan look favorable while both strategy and benchmark lose moneyA relevant benchmark with consistent currency and total-return treatment
Expected shortfall: how severe were losses in the selected tail?Returns at a stated horizon and confidence levelNo ratio denominator; report the tail loss separatelyHistorical estimates need enough tail observations and omit losses never observedNo benchmark required for an absolute loss measure

Fix the measurement basis before calculating

Start with account equity at equally spaced times, including open-position valuation when available. With no deposits or withdrawals, a periodic return is ending equity divided by starting equity minus one. Adjust external cash flows before computing returns. Keep commissions, slippage, financing, currency, and exposure assumptions consistent across the strategies.

  • Frequency: retain idle periods in a calendar return series. A trade lasting three hours and a trade lasting three weeks do not become equal daily observations because both occupy one CSV row.
  • Reference: convert an annual cash rate or target to the return period used by the observations. For an effective annual rate, the monthly equivalent is (1 + annual rate)^(1/12) - 1.
  • Annualization: the usual square-root-of-periods scaling of Sharpe relies on assumptions about return aggregation and serial dependence. It is not a correction for overlapping returns or irregular trade intervals.
  • Benchmark: choose it before inspecting which comparison looks best. Match dates, currency, and dividends; a price-only index and a total-return strategy are not the same basis.
  • Estimator: record whether standard deviation divides by N or N - 1, and whether downside deviation averages over all periods or only shortfall periods. Those conventions change the result.

Worked comparison: the same returns reverse the ranking

Assume two hypothetical strategies have six monthly account returns after all costs, no external cash flows, and starting equity of 100. Set the monthly risk-free rate and downside target to zero. Use sample standard deviation (N - 1), and downside deviation over all six months. Sharpe, Sortino, and information ratios below are monthly, not annualized. The benchmark earns a hypothetical 1% each month; it is an arithmetic illustration, not a market dataset.

Worked comparison: the same returns reverse the ranking
Input or resultStrategy AStrategy B
Monthly returns, in order12%, -1%, -1%, -1%, -1%, 4%3%, 3%, 3%, -2%, 3%, -2%
Arithmetic mean monthly return2.0000%1.3333%
Sample standard deviation5.2915%2.5820%
Downside deviation, zero target0.8165%1.1547%
Monthly Sharpe0.37800.5164
Monthly Sortino2.44951.1547
Monthly information ratio0.18900.1291
Ending equity / six-month return111.8902 / 11.8902%108.0939 / 8.0939%
Maximum drawdown at month ends3.9404%2.0000%
Annualized growth over an assumed 0.5 years25.1942%16.8428%
Calmar using that annualized growth6.39388.4214
  • Reproduce A: mean = (12 - 1 - 1 - 1 - 1 + 4) / 6 = 2%. Sample variance = (100 + 9 + 9 + 9 + 9 + 4) / 5 = 28 percentage-points squared. Sharpe = 2 / sqrt(28) = 0.3780.
  • For Sortino, A downside deviation = sqrt((0 + 1 + 1 + 1 + 1 + 0) / 6) = 0.8165%. Divide 2% by that value to get 2.4495. Including the zero shortfalls preserves their frequency.
  • The benchmark is constant, so tracking error equals each strategy's standard deviation here. A information ratio = (2% - 1%) / 5.2915% = 0.1890; B = (1.3333% - 1%) / 2.5820% = 0.1291.
  • A equity = 100 × 1.12 × 0.99^4 × 1.04 = 111.8902. Four consecutive losses create a 1 - 0.99^4 = 3.9404% drawdown. CAGR = (111.8902 / 100)^2 - 1 = 25.1942%; Calmar = 25.1942 / 3.9404 = 6.3938, using unrounded inputs.
  • B ranks higher on Sharpe and Calmar; A ranks higher on Sortino and this benchmark comparison. A's 12% gain raises total variability without raising downside deviation, while its consecutive losses deepen drawdown. Six observations explain the mechanics but cannot establish a reliable ranking or tail estimate. Annualizing this short window magnifies its apparent performance.

Resolve conflicting metrics without choosing the nicest number

Keep the decision rule independent of the backtest winner. A volatility limit, a maximum acceptable capital loss, and a benchmark mandate are different constraints. The comparison above does not identify a universally better strategy: it shows which risk definition each strategy satisfies more efficiently in that sample.

  • If downside variability is the concern, compare Sortino at the same target and inspect the loss observations. A high value based on one small loss does not establish limited tail risk.
  • If drawdown is the constraint, inspect the equity path, recovery time, and floating losses with Calmar. Shuffling the same monthly returns leaves Sharpe and Sortino unchanged but can change drawdown.
  • If benchmark-relative performance is the mandate, use the information ratio with absolute return and drawdown alongside it. Changing the benchmark changes the question.
  • If rare losses could dominate the outcome, inspect expected shortfall, stress scenarios, and exposure. Historical estimates cannot include an unobserved liquidity gap, and simulated scenarios are assumptions rather than probabilities established by the data.
  • Repeat the same definitions on a held-out period and report all variants tried. Selecting whichever metric flatters a strategy after tuning it compounds selection bias.

Reconcile TradingView and Backtest Deep Report outputs

TradingView's Sharpe and Sortino help pages describe monthly returns. Pineify Backtest Deep Report currently calculates its headline Sharpe and Sortino from individual trade percentage returns and scales by the square root of trades per year. These are different measurement bases, so uploading a trade CSV does not guarantee a match to Strategy Tester or to the monthly example above.

  • Export the TradingView List of Trades CSV and retain the test dates, initial capital, position sizing, cost settings, and reference-rate settings. Check the report's supported profit, equity, drawdown, Sharpe, Sortino, and Calmar outputs against those inputs.
  • The current report uses population standard deviation for trade returns. Its Sortino downside calculation uses negative trade returns, a zero downside threshold, and a denominator based only on the number of negative trades. The example above instead uses all monthly observations.
  • The report subtracts its supplied risk-free-rate value directly from mean trade return. Check the rate's unit and period before interpreting that output; a nonzero annual rate is not automatically a matching per-trade rate.
  • Trade CSV equity reflects realized P&L and cannot reconstruct the full marked-to-market path between exits. The parser orders trades by entry time, so overlapping positions also need a chronological exit-order reconciliation.
  • For information ratio or a custom downside target, calculate from an independently reconciled periodic series and matching benchmark. This guide does not claim those custom statistics are built into Backtest Deep Report.

When a ratio should be left unranked

An undefined or poorly measured denominator needs an explanation, not a performance grade. Preserve the raw inputs so a reader can distinguish missing evidence from a measured result.

  • Zero standard deviation, zero downside deviation, zero tracking error, or zero maximum drawdown makes the corresponding division undefined. Software may display zero or a capped value; that fallback is not a mathematical score.
  • Negative excess returns make naive higher-is-better ranking unreliable: holding the negative numerator fixed while increasing risk can move a ratio closer to zero. Inspect losses directly.
  • Short samples, sparse tail observations, stale prices, and unrealistic fills can make ratios look stable without demonstrating repeatable performance. A universal Sharpe, Sortino, or Calmar pass mark cannot resolve those problems.
  • Profit factor compares gross trade profits with gross trade losses. It is useful trade accounting, but it does not measure calendar volatility, benchmark deviations, or the full equity path.

Related Pineify workflow

Review the inputs behind your backtest ratios

Import a TradingView trade CSV into Backtest Deep Report to inspect its supported return and risk outputs. Use the measurement checks above to explain differences from your chosen monthly account-return calculation.

Backtest Deep Report

Review trade results, reconstructed equity, and supported ratios with their input conventions.

Review backtest metrics
Pine Script AI Coding Agent

Draft a custom Pine statistic with explicit sampling dates, target return, and formula. Check the generated calculation against known inputs before using its output.

Draft a custom statistic

Boundary: Trade-based report statistics do not recover missing floating equity or validate a strategy's future performance. Custom metrics require their own data, formulas, and numerical checks.

This page is educational and does not provide investment advice. Backtests are hypothetical, depend on their data and assumptions, and do not guarantee future results. Trading can result in substantial loss.

Frequently Asked Questions