sandbox_backtest
Run a sandbox backtest of strategy code without persisting anything.
This is the fastest way to test a strategy. The code is run through
static checks and a full backtest on historical data, but no Strategy
or StrategyVersion rows are created. Use this for rapid iteration.
Args:
code: Python source code implementing the Strategy contract.
Must define a METADATA dict and a class extending Strategy
with an on_bar(ctx) -> Signal method. See CREATOR_API.md.
domain: Trading domain (e.g. "eth_usdc", "btc_usdc", "sol_usdc").
symbol: Price symbol for historical data (e.g. "ETHUSDT").
user_id: Identifier for trial tracking (used for DSR correction).
Returns JSON with: success, metrics (sharpe, sortino, win_rate,
total_trades, return_bps, max_drawdown, regime_breakdown,
exit_reason_breakdown), or error details if validation failed.
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": {
"code": "<code>"
},
"name": "sandbox_backtest"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | ||
| domain | No | eth_usdc | |
| symbol | No | ETHUSDT | |
| user_id | No | mcp_sandbox |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |