Matana Labs

Deflated Sharpe ratio: the “Adjustment for the number of attempts” check

The deflated Sharpe ratio corrects the best result of an optimization for the number of combinations tried. The best of many tries always looks good; Bailey and López de Prado’s method asks whether it beats what the best of the same number of random tries would show. Matana Labs computes it on the same optimization grid as the “Two optimization maps” check.

What it checks

The best of K always looks good. The honest Sharpe is adjusted for K.

The question behind it: Is it overfitted to history? In the app it is in Analysis Lab → Checks, stage “After optimization”. Were the numbers overfitted by brute force? Needed after parameter optimization in the “Improvement” step.

How it works

Deflated Sharpe (Bailey and López de Prado) on the same optimization as “Two maps”: how many cells, the best daily Sharpe on the head, and what bar the best of K random ones would set.

How it gets its status

These are the app’s own rules, shown on the check’s card:

With fewer than 30 trades or 20 days in the run, the check still shows its numbers, but its status is at most “with a caveat” and the result is marked as unreliable.

How to read the result

The Adjustment for the number of attempts check in Matana Labs: the number of attempts, the best Sharpe ratio, the bar the best of that many random attempts would reach and the probability that the best is not chance
“Adjustment for the number of attempts” on a test data set: the best Sharpe ratio against the bar for the best of that many random tries.

In the score out of 100

When it has a status, it counts toward the overall score with weight 1: “holds” earns full points, “with a caveat” half and “broke down” none; “can’t compute” is left out.

Every plan, the free one included, can run it; any engine runs it needs are counted in backtest-years.

If it breaks down

Too many attempts for this sample size. Reduce the number of optimized values or extend the period.

This is the app’s own suggestion; under Improvement the app tests candidate changes on the engine before it shows them.

Screenshots show the real app on a test data set. Backtests and simulations are not real trading, and past results don’t guarantee future ones. Not investment advice.

Keep reading

See Matana Labs plans, from free

Questions

Why does the number of tries matter?

The more combinations you try, the higher the best one scores by chance alone. The correction raises the bar to match.

Where do the tries come from?

From the same grid the “Two optimization maps” check builds on the fitting part of the period. It is computed once and shared.

What if the probability is low?

Then the best combination can’t be told apart from luck. Optimize fewer numbers or use a longer period, as the app suggests.