compare_backtests
Run several trading strategies on identical data and view side-by-side comparisons, with support for benchmarks and adjustable result detail.
Instructions
Run several strategies on the same data and compare side by side.
One quota-counted call, but compute scales with the number of strategies. The engine enforces a wall-clock budget for the whole comparison; when it runs out mid-way the response carries "truncated": true and the remaining strategies are missing — report that to the user rather than re-running blindly.
Args: data_source: Shared data source (same shape as run_backtest). strategies: List of {"label": str, "strategy": {...}, "execution": {...}?} entries. include_benchmark: Add a buy-and-hold benchmark to the comparison. response_detail: Shaping level applied to each strategy's result. trades_limit: Max trades per strategy when detail is 'full'.
Returns: {"strategies": [{"label", "result"}, ...], "equity_curves": {...}}, each result shaped at the requested detail. Two truncation flags are distinct and may both appear: the engine's "truncated" (wall-clock budget exhausted mid-comparison — strategies are missing) and the MCP size-cap marker "truncated_by_mcp". A 400/422 rejection returns {"accepted": false, "error": ...}; capacity/timeout/permission failures raise a tool error.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| strategies | Yes | ||
| data_source | Yes | ||
| trades_limit | No | ||
| response_detail | No | summary | |
| include_benchmark | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||