Audit a strategy return series
audit_returnsRun a statistical red-team on a backtest return series: net vs gross costs and break-even, autocorrelation-aware Sharpe, Deflated Sharpe, stability, drawdown and a plain-English verdict with a 0-100 audit score.
Instructions
Statistical red-team of a backtest's return series: net vs gross at 0/5/10/20 bps and the break-even cost; Sharpe with Newey-West and Lo-style t-stats (autocorrelation-aware); the Deflated Sharpe Ratio (Bailey & Lopez de Prado 2014) for n_trials and the minimum track record length; stability by thirds and by year; share of PnL from the best 5% of days; max drawdown and duration; excess return, IR and beta against an optional benchmark. Ends with a plain-English verdict (No red flags found / Some red flags / Major red flags), the reasons, and a 0-100 audit score with its breakdown. No red flags doesn't mean a strategy will make money; it means these checks didn't find the common errors.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"returns": "<returns>"
},
"name": "audit_returns"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| freq | No | Return frequency: auto (inferred from the dates; default), D, W, M, Q, Y, or periods per year as a number. | auto |
| units | No | 'decimal' (0.01 = 1%) or 'percent' (1 = 1%). | decimal |
| returns | Yes | Per-period strategy returns as CSV (date,return) or JSON (list of numbers, {date: return}, or records). Decimals: 0.01 = 1%. | |
| n_trials | No | Total number of strategy variants tried before choosing this one (parameters, universes, rules). Drives the Deflated Sharpe Ratio. | |
| turnover | No | One-way turnover per period (sum of |change in weights|): a number (average) or a series like `returns`. | |
| benchmark | No | Optional benchmark returns, same format as `returns`. | |
| costs_bps | No | Your all-in cost per unit of one-way turnover, in bps. Default 10 when turnover is given. | |
| positions | No | Optional weights table (CSV/JSON): wide date + one column per asset, or long date,ticker,weight. Used to compute turnover. | |
| input_kind | No | 'returns' or 'equity' (an equity/NAV curve). | returns |
| returns_are_net | No | True if the returns already include trading costs. | |
| trials_sr_variance | No | Optional variance of the annualized Sharpe ratios across all trials. Default assumes zero-skill trials. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||