Skip to main content
Glama

TradingCalc MCP: Options, Forex, Risk Stats, Prediction Markets, On-Chain & Crypto Futures

Deflated Sharpe Ratio

workflow.run_dsr
Read-only

Deflated Sharpe Ratio (Bailey & Lopez de Prado): given how many strategy variants you tried (and how correlated they are), what Sharpe ratio would the best of N clear by luck alone, and does your actual strategy still clear that higher bar? Use when user asks "is my backtested Sharpe ratio real, or did I get lucky trying many variants?" or "how many independent trials does this really represent?". Provide either trial_sharpes[] (the N trials' own observed Sharpe ratios, most rigorous) or n_trials (+ optional avg_correlation to correct for correlated trials via Kish's design effect). Two limits to know. n_trials assumes the paper's illustrative case (trial Sharpes with mean 0 and variance 1, in per-period units), which is a very high bar for a low-frequency series: the threshold is about 1.6 at N=10, 2.5 at N=100 and 3.3 at N=1000, while a daily series has a per-period Sharpe of order 0.05, so dsr comes out effectively 0; use trial_sharpes there. trial_sharpes centers the threshold on the trials' own mean Sharpe plus their dispersion times the expected-maximum factor; this answers "does my strategy beat the best of N trials drawn from the spread I observed", not the zero-skill-null variant (mean fixed at 0) used in some texts; the two thresholds differ by exactly the trials' mean Sharpe. Returns: expected_max_sharpe (the luck-alone threshold), dsr (probability your strategy's true Sharpe exceeds it, 0-1), n_trials_effective.

Input Schema

NameRequiredDescriptionDefault
returnsYesThe candidate strategy's own return series
n_trialsNoNumber of strategy variants tried, if trial_sharpes were not tracked individually. Assumes trial Sharpes with mean 0 and variance 1 (per-period units): too strict for daily series, prefer trial_sharpes there.
trial_sharpesNoObserved Sharpe ratios of all N trials tried, if tracked. Takes priority over n_trials if both are given.
avg_correlationNoAverage pairwise correlation between trials, 0-1 (default 0 = independent). Only used with n_trials; lowers the effective trial count via Kish's design effect.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / n_trials / description
      Previous value: -"Number of strategy variants tried, if trial_sharpes were not tracked individually"New value: +"Number of strategy variants tried, if trial_sharpes were not tracked individually. Assumes trial Sharpes with mean 0 and variance 1 (per-period units): too strict for daily series, prefer trial_sharpes there."
  2. Added

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint/non-destructive/closed-world, and the description adds substantial context beyond them: the unit assumption baked into n_trials (per-period, mean 0, variance 1), concrete threshold values at N=10/100/1000, why that makes dsr effectively 0 for daily series, and that trial_sharpes centers on the observed mean rather than a zero-skill null. These are exactly the interpretive traps an agent would otherwise fall into.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with concept, then usage triggers, then two labeled limits, then return values — a sensible order. It is a dense unbroken paragraph of roughly 250 words for a four-parameter tool; the content earns its place but bullets or line breaks would improve scanability.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite being a numeric workflow with no output schema, the description names the three returned fields and how to read them (expected_max_sharpe as the threshold, dsr as a 0-1 probability), and covers the failure mode that would otherwise produce a silent wrong answer. An agent has everything needed to call it and interpret the result.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3; the description goes beyond the schema by explaining the priority relationship, the Kish design-effect role of avg_correlation, and the unit caveat that makes n_trials unsuitable for daily data. It does not restate scalar ranges or types, which the schema already covers, so it falls just short of a 5.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Names a specific, well-defined statistic (Deflated Sharpe Ratio, Bailey & Lopez de Prado) and states in plain language exactly what it computes: the Sharpe ratio the best of N trials would clear by luck alone, and whether the actual strategy still clears it. This is clearly distinguishable from a plain Sharpe calculation in the sibling list (run_sharpe_stats) without opening either schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit trigger phrasing ('is my backtested Sharpe ratio real, or did I get lucky...?', 'how many independent trials does this really represent?') and an explicit selection rule between the two input paths: prefer trial_sharpes[] as most rigorous, fall back to n_trials + optional avg_correlation. It even states when NOT to use n_trials ('use trial_sharpes there' for low-frequency series). Nothing is left to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.