backtest · wire operation
Run a vectorized backtest
Run a single-asset vectorized backtest: signal-following fills at close, optional bps fees. Returns final value, turnover, and the performance summary; every hidden policy the run assumed (fill timing, costs, slippage, settlement, calendar, margin) is echoed in `assumptions`, and the implementation-risk warnings (look-ahead, data alignment) ride `diagnostics`. Deliberately opt-in (backtestPack) — payloads and runtime are heavier than the default tools. executionLag shifts signal lookup before rebalance sampling; a month-end target can miss the next monthly sample. Use the SDK researchProtocol and selection-hygiene workflow before comparing candidates; see docs/guides/dogfood-journeys.md.
totalfinance.backtest.vectorized_run- MCP tool name
- totalfinance_backtest_vectorized_run
- Pack / profiles
- backtest / backtesting, full
- Default discovery
- Opt-in (select its pack or profile)
- Required capabilities
- None
- Effects / authorization
- none / none
- Cost / cancellation
- small / Do not assume inline interruption
- Handle-eligible inputs
- None
- Idempotency
- not-applicable
Input schema
| Field | Type | Meaning |
|---|---|---|
dataRequired | object[] | OHLC bars, chronological |
signalRequired | number[] | Target position per bar (1 long, 0 flat, -1 short; fractional = sized), aligned to data |
initialCapitalOptional | number | Opening capital (default 1) |
feeBpsOptional | number | Per-trade fee in basis points of traded notional |
slippageBpsOptional | number | Existing slippage.bps model; basis points, zero means no slippage |
executionLagOptional | integer | Signal-to-fill lag in bars (SDK default 1); 0 carries a look-ahead warning |
rebalanceOptional | "everyBar" | "daily" | "weekly" | "monthly" | integer | Existing SDK sampling schedule; samples signal[i - executionLag] only on rebalance bars |
periodsPerYearOptional | number | Bars per year for metrics (SDK default 252) |
riskFreeRateOptional | number | Annual risk-free rate as a decimal (SDK default 0) |
maxLeverageOptional | number | Existing per-asset gross weight cap (SDK default 1) |
Complete JSON Schema
Loading…
Output schema
| Field | Type | Meaning |
|---|---|---|
finalValueRequired | number | — |
turnoverRequired | number | Traded notional ÷ average equity over the run |
performanceRequired | object | The standard performance summary |
assumptionsRequired | object | The modelling policies the run assumed: initialCapital, fill, cost, slippage, cashSettlement, corporateAction, calendar, margin, conventionsVersion |
diagnosticsRequired | object | Implementation-risk warnings (look-ahead / data alignment) + benchmarkFixtureVersion |
Complete JSON Schema
Loading…