Skip to content
TotalFinance

backtest · wire operation

Run a cross-sectional backtest

Backtest a point-in-time cross-sectional strategy: a returns dataset with declared features, a universe history with entries and exits, one declarative signal (a versioned factor recipe, a composite score, or a screen), a rebalance schedule, and a portfolio construction (quantile/count/fraction selection on each side; equal, score, inverse-volatility, or risk-budget weights; dollar/sector/beta/factor neutrality; position, weight, turnover, and participation caps — every trim a reported goal). Fills go through the execution policy into the portfolio ledger; the final value reconciles to the ledger NAV. Rebalances, holdings, fills, the ledger, the timeline, attribution, the benchmark block, and the performance summary — crossSectionalBacktest(...) verbatim. Opt-in (backtestPack): payloads and runtime are heavier than the default set; bulk row sets above the row cap travel by handle.

totalfinance.backtest.cross_sectional_run
MCP tool name
totalfinance_backtest_cross_sectional_run
Pack / profiles
backtest / backtesting, full
Default discovery
Opt-in (select its pack or profile)
Required capabilities
None
Effects / authorization
none / none
Cost / cancellation
job / Do not assume inline interruption
Handle-eligible inputs
dataset
Idempotency
not-applicable

Input schema

FieldTypeMeaning
datasetRequiredobject—
universeHistoryRequiredobject—
signalRequiredobject | object | objectThe three declarative signal forms; a signal callback is SDK-only
rebalanceScheduleRequiredobject—
portfolioConstructionRequiredobject—
executionOptionalobjectA declared execution policy over session bars (execution.declared): the label is the caller's claim; a caller fill model, session rules, and quote/order-book observations are SDK-only
transactionCostModelOptionalobject—
initialCapitalOptionalnumberDefault 1,000,000
baseCurrencyOptionalstringDefault 'USD'
windowOptionalobject—
periodsPerYearOptionalnumberDefault 252
riskFreeRateOptionalnumberPer-period; default 0
seedOptionalintegerSeeds only the bootstrap confidence intervals; absent = none
Complete JSON Schema

Loading…

Output schema

FieldTypeMeaning
rebalancesRequiredobject[]—
holdingsRequiredobject[]—
pointsRequiredobject[]—
returnsRequirednumber[]—
tradesRequiredobject[]—
fillsRequiredobject[]—
ledgerRequiredobjectThe portfolio ledger snapshot (events)
timelineRequiredobjectThe ledger timeline
attributionRequiredobject—
benchmarkRequiredobject | null—
performanceRequiredobjectThe standard performance summary
performanceConfidenceRequiredobject | null—
finalValueRequirednumber—
runIdRequiredstring—
assumptionsRequiredobjectApplied conventions
diagnosticsRequiredobjectEngine, method, warnings
Complete JSON Schema

Loading…