Quant Invest System

Probabilistic Sharpe ratio calculator

Is your backtest result distinguishable from luck, and if not, how many more trades does it need? Paste your trade results or four numbers from a MetaTrader 5 report. The calculation runs in your browser; nothing is uploaded.

What you have

One trade per line, in money or in percent of balance. Spaces, commas and semicolons also work as separators. Use percent if your lot size changes with the balance.

0 asks: is the edge above zero?

Where to find the numbers

Trade list. In the Strategy Tester, open the Backtest tab, right-click and save the report. In its Deals table each trade has an in row and an out row. Its result is the Profit, Commission and Swap of the out row plus the Commission of the in row. Positions closed in parts count as one trade: add the parts together.

Four numbers. Total Trades, Profit Trades (% of total), Average profit trade and Average loss trade, from the same report.

What it calculates

  • Sharpe ratio per trade: the average trade divided by the standard deviation of trades, not annualized.
  • PSR: the probability that the true Sharpe ratio per trade is above the benchmark, given the number of trades, their skewness and fat tails (Bailey and López de Prado, 2012). Shown from 30 trades.
  • Minimum track record length: how many trades this Sharpe ratio needs to reach the chosen confidence, and how many more you need now.

The formulas are the ones our engine uses for every report: PSR = Φ((SR − SR*) · √(n − 1) / √D) and MinTRL = 1 + D · (z / (SR − SR*))², where D = 1 − skewness · SR + (kurtosis − 1) / 4 · SR². Skewness and kurtosis are the unbiased sample estimates. The worked method is in How many trades does a backtest need? and The Sharpe ratio per trade.

The same calculation as an open-source library for Python and JavaScript, with its test cases: psr-mintrl on GitHub (MIT licence).

What it cannot tell you

The calculation trusts the trades it is given. It assumes one strategy tested once and trades independent of each other. The best of many optimization runs looks better than it is, and several positions open at once behave like one larger trade, so the real evidence is weaker than the count suggests. Costs set wrong in the tester change every number here. See the methodology for the rest of our tests.

Check your report for free

Send your MetaTrader 5 report and, optionally, the tester log. Before any payment we tell you whether we can read it, how many closed trades it has and what the tester log shows, including how much of the test ran on real ticks.

Check your file for free