TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/theonetrade/backtest-kit/llms.txt
Use this file to discover all available pages before exploring further.
Walker singleton runs walk-forward analysis across a list of strategies over a shared historical period. Walk-forward analysis is a validation technique that avoids overfitting: instead of testing all strategies on the same data, you optimize on an in-sample window and evaluate the winner on an unseen out-of-sample window. In Backtest Kit, the Walker iterates a strategies list, backtests each one against the same frame and exchange, scores them on a configured metric, and streams progress updates after each strategy completes.
Walk-forward analysis matters because a strategy can be hand-fitted to historical data (curve-fit) and show outstanding in-sample metrics that collapse on live data. By comparing multiple strategy variants and measuring performance on held-out data, you detect overfitting before deploying real capital.
addWalkerSchema
Before runningWalker, register a walker schema:
IWalkerSchema Parameters
Unique identifier for the walker configuration.
Exchange schema used for all strategy backtests in this walker run.
Frame schema defining the shared backtest period.
Ordered list of strategy names to compare. Each must be registered via
addStrategySchema.Optimization target. Higher values are always better.Available metrics:
"sharpeRatio" | "annualizedSharpeRatio" | "winRate" | "totalPnl" | "certaintyRatio" | "avgPnl" | "expectedYearlyReturns"onStrategyStart, onStrategyComplete, onStrategyError, onComplete hooks.run()
WalkerContract after each strategy completes, giving real-time visibility into the optimization progress.
WalkerContract Fields
| Field | Description |
|---|---|
walkerName | Name of the running walker. |
strategyName | Strategy that just finished testing. |
stats | Full BacktestStatisticsModel for the completed strategy. |
metricValue | The configured metric value for this strategy (null if invalid). |
metric | Which metric is being optimized. |
bestMetric | Best metric value seen so far across all strategies. |
bestStrategy | Strategy name that achieved bestMetric. |
strategiesTested | Count of strategies completed so far. |
totalStrategies | Total number of strategies in the walker. |
background()
listenWalker or listenWalkerComplete to observe results.
getData()
bestStrategy, bestMetric, bestStats, and totalStrategies.
getReport()
dump()
./dump/walker/.
stop()
The Walker requires a registered walker schema (
addWalkerSchema) before Walker.run or Walker.background can be called. The walker schema specifies the exchange, frame, and list of strategies to compare—all of which must be registered independently before the walker schema is created.