AI Strategy Backtester
cc.strategy_backtestCall cc.strategy_backtest — Takes a natural language strategy description, generates executable code, and runs it against historical OHLCV data with full TP/SL/trailing stop simulation. Purpose: Takes a natural language strategy description, generates executable code, and runs it against historical OHLCV data with full TP/SL/trailing stop simulation. Behavior: READ-ONLY. Does not place orders, move funds, or mutate your exchange account. Live / near-real-time data. Auth: X-Api-Key or x402 payment proof (X-PAYMENT / __x_payment). Anonymous unauthenticated calls receive HTTP 402 with payment accepts. Cost: $0.05 USDC per successful call (x402 Base USDC pay-per-use or prepaid X-Api-Key balance). Linked Connect keys are free. This is billing, not a side effect. Rate limit: 5/min (per API key). Tier: premium. Returns: Complete backtest results: total trades, win rate, net PnL, max drawdown, Sharpe ratio, profit factor, and individual trade log with entry/exit details. Guidelines: Compute / parse / backtest only — no live orders. Feed outputs into cc.agent_strategy with force_paper=true to paper-trade. Tags: backtest, strategy, simulation, performance, sharpe, drawdown.
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": {
"strategy": "<strategy>",
"symbol": "<symbol>"
},
"name": "cc.strategy_backtest"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| days | No | History lookback (default: 90) Optional. | |
| symbol | Yes | Parameter `symbol` (string). Required. | |
| strategy | Yes | Natural language strategy description Required. | |
| timeframe | No | 1h, 4h, 1d Optional. | |
| __x_payment | No | Optional x402 payment proof (same value as X-PAYMENT header). Use when retrying after HTTP 402 if your MCP client cannot set custom headers. Not a business parameter. Optional. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | True when the gateway HTTP status is 2xx. | |
| data | No | Parsed JSON body from the endpoint (shape varies by slug). | |
| error | No | Error message when ok is false. | |
| status | Yes | Upstream HTTP status from x402-gateway. | |
| billing | No | Optional payment / cost metadata when present. | |
| endpoint | Yes | Catalog slug that was invoked (e.g. funding-rates). |