Documentation 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.
addFrameSchema defines the time window and tick granularity for a backtest run. Every call to Backtest.run or Walker.run requires a registered frame. The frame schema tells Backtest Kit how to generate the sequence of timestamps it iterates over—one tick per interval step from startDate through endDate. Live mode does not use frames; the engine produces ticks by reading the system clock.
Function Signature
Parameters
A unique string identifier for this frame. Referenced as
frameName in Backtest.run and Walker.run context objects. Duplicate names throw at registration.The spacing between consecutive ticks in the backtest. Each tick represents one point in simulated time at which the strategy is evaluated.Accepted values:
"1m" | "3m" | "5m" | "15m" | "30m" | "1h" | "2h" | "4h" | "6h" | "8h" | "12h" | "1d"Inclusive start of the backtest period. The first tick is generated at
alignToInterval(startDate, interval).Inclusive end of the backtest period. No ticks are generated beyond this date.
Optional developer note for documentation or introspection.
Optional lifecycle callbacks:
onTimeframe(timeframe, startDate, endDate, interval)— called once after the timestamp array is generated. Useful for logging the number of ticks or validating the configured period.
Example
The
interval in the frame schema controls backtest tick granularity—it determines how frequently the strategy is evaluated and how finely time advances through the historical period. It is independent of the interval in addStrategySchema, which controls signal-generation throttling. A frame with interval: "1m" and a strategy with interval: "5m" will step every minute but call getSignal at most every 5 minutes.