Skip to main content

Quantitative Metrics

MesoMetrics is Deltaray's performance-analysis library used by MesoSim. It calculates the quantitative statistics in backtest results, portfolio analysis, and tearsheets from NAV, benchmark prices, and exposure history.

Use this reference to understand what each metric measures and how it is calculated. The percentage-return formulas below assume a strictly positive NAV series. Currency-PnL and drawdown metrics use their stated definitions and denominators.

Inputs and notation

SymbolMeaning
V₀, VTInitial and terminal NAV
VᵢNAV at the end of interval i; Vᵢ₋₁ is NAV at its start
CFunded initial capital
nNumber of usable return or daily-PnL observations
MNumber of NAV observations in the full drawdown path
PAnnualization factor: 252 for index/equity options; 365 for legacy crypto options
D, YElapsed calendar days and years, with Y = D / 365.2425
F, AAnnual effective risk-free rate and minimum acceptable return (MAR)
fᵢ, mᵢRisk-free rate and MAR converted to interval i
bᵢBenchmark return over the same interval as rᵢ
ΦStandard normal cumulative distribution function

Returns are decimals: 0.10 means 10%. Return and probability results are displayed as percentages. Ratios are dimensionless unless another unit is stated.

ri=ViVi11pi=ViVi1
fi=(1+F)ΔYi1mi=(1+A)ΔYi1ai=rifi

The interval year fraction ΔYᵢ uses actual elapsed time divided by 365.2425 days. Risk-free rate and MAR are distinct inputs; their library defaults are both zero.

x¯=i=1nxins(x)=i=1n(xix¯)2n1

Daily estimators omit intervals with missing scheduled observations. Partial opening or closing intervals carry partial-coverage information. Benchmark relationships use exactly matched interval starts and ends. Monthly and yearly summaries use complete calendar periods unless noted below.

Returns and risk

Cumulative Return

Total percentage change between the initial and terminal NAV. Requires two endpoints.

R=VTV01

CAGR

Compound annual growth rate using elapsed calendar time. Requires at least 30 calendar days and positive NAV throughout the path.

CAGR=(VTV0)1Y1

Annualized Volatility

Sample standard deviation of usable daily returns, annualized. Requires at least two returns.

Volatility=s(r)P

Sharpe

Annualized mean excess return divided by its sample standard deviation. Requires at least two observations and nonzero excess-return variation.

Sharpe=Pa¯s(a)

Sortino

Uses risk-free-adjusted return in the numerator and downside deviations below MAR in the denominator. All n usable observations enter the downside average, including zero downside for returns at or above MAR.

Sortino=Pa¯i=1nmin(rimi,0)2n

Omega

Ratio of gains above MAR to shortfalls below MAR. Requires at least one usable return.

Omega=i=1nmax(rimi,0)i=1nmax(miri,0)

Probabilistic Sharpe Ratio

Probability estimate for exceeding a specified nonannualized Sharpe benchmark S₀, which defaults to zero. Sₒᵦₛ = mean(a) / s(a); γ₃ is adjusted sample skewness of excess returns, and γ₄ is their adjusted Pearson kurtosis (excess kurtosis + 3). Requires at least four returns and a positive variance term.

PSR=Φ((SobsS0)n11γ3Sobs+γ414Sobs2)

This PSR calculation uses an IID approximation and is not annualized. It differs from the stationary-bootstrap positive-mean-return test in StatSim. For the methodology, see Bailey and López de Prado’s The Sharpe Ratio Efficient Frontier.

Return distribution and tail risk

For the following moment formulas, μₖ is the central moment with divisor n. The displayed Skew and Excess Kurtosis use raw returns; PSR applies the same moment estimators to excess returns.

μk=i=1n(rir¯)kn

Skew

Bias-corrected Fisher–Pearson sample skewness. Requires at least three returns with nonzero variance.

Skew=n(n1)n2μ3μ232

Excess Kurtosis

Bias-corrected Fisher excess kurtosis. A normal distribution has excess kurtosis zero. Requires at least four returns with nonzero variance.

Kurtosis=(n²1)μ4μ223(n1)²(n2)(n3)

Empirical quantiles Q use Type 7 interpolation. For sorted values x₍₁₎ through x₍ₙ₎ and quantile level q:

h=1+(n1)qj=hw=hj
Qq(x)=(1w)x(j)+wx(j+1)

At the endpoints, Q₀ and Q₁ are the sample minimum and maximum; when h is an integer, use x₍ₕ₎.

Historical Daily VaR 95%

The 95th percentile of signed daily losses, −r. A negative value is possible when the observed outcomes are all gains. Requires one return; fewer than 20 observations are marked as a small sample.

VaR95=Q0.95(r)

Historical Daily Expected Shortfall 95%

Average of the worst 5% of signed-loss mass. Sort losses ℓ = −r from largest to smallest; u = 0.05n, k = floor(u), and w = u − k. The boundary observation receives fractional weight w; when w = 0, omit that term. Requires one return; fewer than 20 are marked as a small sample.

ES95=i=1k(i)+w(k+1)u

Tail Ratio

Absolute upper-tail return divided by absolute lower-tail return. Requires at least 20 returns.

Tail=|Q0.95(r)||Q0.05(r)|

Outlier Win Ratio

99th-percentile return divided by the mean strictly positive return. Requires at least 100 returns and a positive observation.

OutlierWin=Q0.99(r)mean(ri where ri>0)

Outlier Loss Ratio

Absolute 1st-percentile return divided by the absolute mean strictly negative return. Requires at least 100 returns and a negative observation.

OutlierLoss=|Q0.01(r)||mean(ri where ri<0)|

Drawdowns and recovery

Let Hⱼ be the running high-water mark, dⱼ the peak-relative drawdown, and dⱼᶜ the drawdown relative to funded initial capital. Drawdowns are zero or negative.

Hj=maxujVudj=VjHj1
dj=VjHjC

Max Drawdown from Peak

Deepest drawdown as a fraction of the running peak.

MaxDD=minjdj

Max Drawdown on Initial Capital

Deepest peak-to-trough currency decline divided by funded initial capital. Initial capital is this metric’s fixed denominator by definition.

MaxDDonInitial=minjdj

A drawdown episode begins at a peak and ends when NAV recovers that peak. Let eⱼ be episode j’s deepest peak-relative drawdown and τⱼ its elapsed calendar days. An unrecovered episode ends at the report’s terminal timestamp for duration measurement. Let E be the number of episodes.

Average Drawdown

Arithmetic mean of episode trough depths. This averages episodes, rather than every underwater observation; requires at least one episode.

AverageDD=j=1EejE

Longest Drawdown Days

Longest peak-to-recovery duration, including an open episode through the report end. Returns zero when no drawdown episode exists.

LongestDDDays=maxjτj

Average Drawdown Days

Mean calendar duration of the episodes. Requires at least one episode.

AverageDDDays=j=1EτjE

Recovery Factor

Net currency PnL divided by the absolute maximum currency drawdown.

Recovery=VTV0|minj(VjHj)|

Calmar

CAGR divided by the absolute maximum peak-relative drawdown. Inherits the CAGR history requirement.

Calmar=CAGR|MaxDD|

Ulcer Index

Root mean square of peak-relative drawdowns over the full NAV path, including zero-drawdown observations. Uses divisor M.

UI=j=1Mdj2M

Ulcer Performance Index

Annual excess CAGR divided by the Ulcer Index.

UPI=CAGRFUI

Daily PnL and exposure

These metrics use daily NAV changes, including changes in open-position value. Win Days, Payoff Ratio, and Profit Factor here are not closed-trade statistics. Let W contain days with pᵢ > 0 and L contain days with pᵢ < 0; vertical bars around a set denote its count.

Win Days

Fraction of nonzero daily-PnL observations that are positive. Zero-PnL days are excluded from the denominator.

WinDays=|W||W|+|L|

Max Consecutive Winning Days

Longest run of strictly positive daily PnL. A zero or negative value ends a winning streak.

WinningStreak=max(length of consecutive pᵢ > 0 runs)

Max Consecutive Losing Days

Longest run of strictly negative daily PnL. A zero or positive value ends a losing streak.

LosingStreak=max(length of consecutive pᵢ < 0 runs)

Payoff Ratio

Average winning-day PnL divided by the absolute average losing-day PnL.

Payoff=mean(pi,iW)|mean(pi,iL)|

Profit Factor

Gross positive daily PnL divided by absolute gross negative daily PnL. For Payoff Ratio and Profit Factor, gains-only samples are unbounded; losses-only samples give zero; all-zero samples are unavailable.

PF=iWpi|iLpi|

Common Sense Ratio

Currency-PnL Profit Factor multiplied by normalized-return Tail Ratio. This is a mixed-domain heuristic because its components use different input domains. It is available only when both component metrics are available.

CommonSense=PF×Tail

Kelly Sizing Multiple

Nonnegative capital multiple maximizing empirical log growth, subject to 1 + f pᵢ/C > 0 for every observed day. C is the explicit sizing base. For an interior optimum, the derivative below is zero.

Kelly=argmaxf0i=1nln(1+fpiC)n
i=1npiC1+fpiCn=0

A nonpositive mean normalized PnL gives 0x; an all-nonnegative sample with a gain has an unbounded optimum. This is a historical sizing statistic, not a prescription for live leverage.

CPC Index

Product of Profit Factor, the Win Days fraction, and Payoff Ratio.

CPC=PF×WinDays×Payoff

Time in Market

Iⱼ is 1 when invested during exposure segment j and 0 otherwise. Integrates actual invested time, including nights, weekends, and holidays. Requires the initial exposure state and complete state-change history.

TimeInMarket=j=1JIjΔtjtendtstart

Calendar and horizon performance

For a calendar period or selected window B, compound the included simple returns. Each move belongs to the calendar period containing its interval end. Missing periods are not inserted as zero returns.

RB=iB(1+ri)1

Realized Geometric Mean Daily

Usable daily returns compounded into an average period return. K is the number of included periods; requires at least one.

GeometricMean=exp(j=1Kln(1+rj)K)1

Realized Geometric Mean Monthly

Complete calendar-month returns compounded into an average period return. K is the number of included periods; requires at least one.

GeometricMean=exp(j=1Kln(1+Rj)K)1

Realized Geometric Mean Yearly

Complete calendar-year returns compounded into an average period return. K is the number of included periods; requires at least one.

GeometricMean=exp(j=1Kln(1+Rʸj)K)1

MTD

Return from the available beginning of the current calendar month through the report end.

MTD=Rcurrent month

YTD

Return from the available beginning of the current calendar year through the report end.

YTD=Rcurrent year

3M

Return over the trailing three calendar months.

3M=Rtrailing 3 months

6M

Return over the trailing six calendar months.

6M=Rtrailing 6 months

1Y

Return over the trailing calendar year.

1Y=Rtrailing 1 year

MTD and YTD retain partial-period coverage information. Trailing 3M, 6M, and 1Y require complete scheduled coverage. When a calendar boundary is not a trading observation, the window uses the interval spanning that boundary.

3Y (annualized)

Geometrically annualized return over a complete trailing 3-calendar-year window.

3Y annualized=(1+Rtrailing 3 years)131

5Y (annualized)

Geometrically annualized return over a complete trailing 5-calendar-year window.

5Y annualized=(1+Rtrailing 5 years)151

10Y (annualized)

Geometrically annualized return over a complete trailing 10-calendar-year window.

10Y annualized=(1+Rtrailing 10 years)1101

Best Day

Largest return among usable daily returns.

Best Day=maxjrj

Worst Day

Smallest return among usable daily returns.

Worst Day=minjrj

Best Month

Largest return among complete monthly returns.

Best Month=maxjRj

Worst Month

Smallest return among complete monthly returns.

Worst Month=minjRj

Best Year

Largest return among complete yearly returns.

Best Year=maxjRʸj

Worst Year

Smallest return among complete yearly returns.

Worst Year=minjRʸj

Average Up Month

Mean of strictly positive complete monthly returns. Requires at least one such month.

Average Up Month=mean(Rj where Rj>0)

Average Down Month

Mean of strictly negative complete monthly returns. Requires at least one such month.

Average Down Month=mean(Rj where Rj<0)

Win Month

Positive complete months divided by nonzero complete months. Flat periods are excluded.

Win Month=count(Rj>0)count(Rj0)

Win Quarter

Positive complete quarters divided by nonzero complete quarters. Flat periods are excluded.

Win Quarter=count(Rj>0)count(Rj0)

Win Year

Positive complete years divided by nonzero complete years. Flat periods are excluded.

Win Year=count(Rʸj>0)count(Rʸj0)

Gain/Pain (1M)

Sum of all complete monthly returns divided by the absolute sum of negative complete monthly returns. The numerator includes both gains and losses.

GainPain=j=1KRj|j=1Kmin(Rj,0)|

Benchmark comparisons

Use exactly paired strategy and benchmark return intervals. Let yᵢ = rᵢ and xᵢ = bᵢ. MesoMetrics fits ordinary least squares with an intercept to raw returns, not risk-free-adjusted returns. The following sums run over the n matched pairs.

Sxx=i=1n(xix¯)2Sxy=i=1n(xix¯)(yiy¯)
Syy=i=1n(yiy¯)2

Beta

Sensitivity to benchmark returns. Requires at least two matched pairs and a nonconstant benchmark.

β=SxySxx

Alpha

Annualized regression intercept. The auxiliary per-period intercept is c. Alpha is displayed as a raw annual fraction: 0.03 means 3% annual alpha; beta remains a dimensionless coefficient.

c=y¯βx¯α=Pc

Let residuals εᵢ = yᵢ − c − βxᵢ, and SSE = ∑ εᵢ².

Fraction of strategy-return variation explained by the fitted benchmark regression. Requires nonconstant strategy returns.

R²=1SSESyy

Correlation

Pearson correlation of the exact-paired raw returns. Both series must have nonzero variation.

ρ=SxySxxSyy

For regression standard errors, use residual variance σ̂² = SSE/(n − 2), requiring at least three matched pairs.

Alpha Standard Error

Standard error of annualized alpha. The per-period intercept standard error is SE(c) = SE(α)/P.

SE(α)=PSSEn2(1n+x¯2Sxx)

Beta Standard Error

Standard error of the regression slope.

SE(β)=SSEn2Sxx

Information Ratio

Annualized mean active return divided by tracking error, using the same exact-paired intervals. Requires at least two pairs and nonzero variation in active returns.

IR=Prb¯s(rb)

Treynor Ratio

Annualized mean excess strategy return per unit of beta on the matched sample. Requires nonzero beta. Unit: annual return per beta.

Treynor=Pa¯β

Rolling and structured results

The full report also contains time series and distribution summaries. These reuse the metric definitions above rather than introducing a different return model.

Rolling 6M and 12M metrics

At each endpoint t, calculate each metric from the observations in the preceding six or twelve calendar months:

Metricw(t)=Metric(observations in window ending at t)w(6M,12M)

The outputs are annualized volatility, Sharpe, Sortino, alpha, and beta. The benchmark also has its own rolling volatility, Sharpe, and Sortino. Windows require complete scheduled coverage; alpha and beta use exact-paired intervals within each window.

Calendar series and yearly benchmark comparisons

Monthly and yearly returns use the calendar compounding formula above. Each value retains whether its period is complete. For a complete matched year:

Active return=RstrategyRbenchmark
Relative wealth=1+Rstrategy1+Rbenchmark

Relative wealth is a multiple, so equal performance gives 1. It does not subtract 1. Drawdown episode records include peak and trough timestamps, trough depth, recovery status, and elapsed duration as defined in Drawdowns and recovery.

Return quantiles and box-plot summaries

Daily, ISO-weekly, monthly, quarterly, and yearly aggregated returns have descriptive quantile summaries:

Q1=Q0.25(R)Median=Q0.50(R)Q3=Q0.75(R)
IQR=Q3Q1
Lower fence=Q11.5IQRUpper fence=Q3+1.5IQR

These are Tukey display fences. They describe the distribution and do not remove observations from the performance calculations. Distribution summaries include partial calendar periods when present.

Reading the reported values

  • N/A means the metric’s data or mathematical requirements are not met. A missing value is not zero.
  • Some ratios can be unbounded when the denominator is zero and the numerator is nonzero. Undefined expressions such as 0/0 are unavailable. Sharpe, Information Ratio, and other metrics with explicit variation requirements remain unavailable for constant input series.
  • Coverage matters: compare metrics over the same dates and check whether their inputs contain incomplete periods.
  • Trade count, adjustment count, profit-target/stop-loss hits, settlements, and average days in trade come from MesoSim’s trade execution records. They are separate from the MesoMetrics NAV-based formulas on this page.

To inspect the values, open MesoSim backtests, portfolio results, or the Tearsheet tab. For alternative paths from observed returns, use StatSim.

For background on risk-adjusted performance, see William Sharpe’s The Sharpe Ratio. Deltaray’s Portfolio Construction Methods provides a separate research example of comparing strategy and portfolio performance.