Sortino Ratio Calculator

Measure mean return above a target per unit of observed shortfall. Enter equally spaced periodic returns and a target for the same period.

Enter values to calculate

Provide your portfolio returns and target MAR to see the analysis.

A Target-Based Measure of Shortfall

Sortino = (arithmetic mean return − target) / downside deviation. This tool uses downside deviation = √[Σ min(return − target, 0)² / N]. Every entered observation counts in N, including above-target periods.

Worked Example

For hypothetical monthly returns 4%, −2%, 1%, 5% and a monthly target of 1%, the mean is 2%. Only −2% has a shortfall: −3 percentage points. Downside deviation is √(9/4) = 1.5%, so Sortino = (2−1)/1.5 ≈ 0.6667.

The comparison uses population standard deviation √(30/4) ≈ 2.7386%, giving (2−1)/2.7386 ≈ 0.3651. This is labeled target/total-volatility because an arbitrary MAR is not necessarily a risk-free benchmark. A sample standard-deviation convention using N−1 would produce a different comparison.

Consistent Inputs and Limits

Use a complete sequence of equal-length return periods with consistent currency and fee treatment. Do not mix annual targets with monthly observations. Blank, malformed, or infinite tokens are rejected rather than silently dropped. The calculation runs in your browser and does not fetch market or account data.

No ratio proves that a strategy controls future losses. A negative ratio means mean return fell below the target, which can still be positive. When excess return is negative, ranking by the ratio alone can favor a larger downside denominator. Compare drawdown, tail exposure, and sample length separately.

Method reference: Rollinger and Hoffman, Sortino: A Sharper Ratio, published by Red Rock Capital and hosted by CME Group. The all-observations convention is stated explicitly because other estimators differ.

Frequently Asked Questions

How is downside deviation calculated here?

The square root of the mean squared shortfall below the target, using all N observations. Returns above the target contribute zero shortfall but stay in the denominator. This is not the standard deviation of the losing observations.

What period should the target use?

Use a target for the same period as every return. For monthly returns, enter a monthly target. The default 2% is an editable example, not a recommended or annual risk-free rate. No annualization is applied.

Why can the ratio be undefined?

When no return falls below the target, the observed downside denominator is zero. The tool displays Undefined rather than inventing a capped score. Absence of shortfalls in this sample does not imply no future downside risk.

Is the comparison metric a Sharpe Ratio?

The comparison divides mean return minus the chosen target by population standard deviation. It is a Sharpe-style ratio only when the target represents a constant matched risk-free return. An arbitrary investment target is not automatically a risk-free rate.

Does a higher ratio make a strategy better?

There is no universal quality grade. Compare the same target, sample window, return frequency, and fee convention, and examine drawdowns and tail losses separately. Historical ratios do not forecast future losses.

Draft and Review Trading Rules

Use Pineify to draft Pine Script strategies, then inspect their logic and test assumptions in TradingView. This calculator does not optimize or execute a portfolio.

Explore Pineify