Monte Carlo over trades
backtest_monte_carloResamples a backtest's stored trades to estimate risk: returns p5/p50/p95 and mean final equity, return and max drawdown, plus probability of ruin. Use it to gauge strategy robustness.
Instructions
Resamples the stored trades. Returns p5/p50/p95 and the mean of final equity, return and max drawdown (p25/p75/min/max, the equity bands and the drawdown histogram of GET /backtests/{id}/monte-carlo are left out), plus probabilityOfRuinPct — the REST field name. Under SHUFFLE the final-equity spread is zero by construction — read the drawdown distribution. Inside a campaign it counts toward the robustness gate of the backtest's config.
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": {
"backtestId": "<backtestId>"
},
"name": "backtest_monte_carlo"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| runs | No | ||
| seed | No | ||
| method | No | BOOTSTRAP | |
| ruinPct | No | ||
| backtestId | Yes |