A frame defines the time window, candle interval, and date range that the backtest runner steps through. Frames are registered withDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/backtest-kit/backtest-kit-minio-s3-docker/llms.txt
Use this file to discover all available pages before exploring further.
addFrameSchema and referenced by name when launching a Backtest.background() run. Separating the frame from the strategy means you can combine any frame with any strategy without modifying either file — simply reference the right FrameName in your runner entry point.
addFrameSchema API
Frames are registered by calling addFrameSchema at module load time. The example frame in src/logic/frame/jan_2026.frame.ts covers January 2026 at 1-minute resolution:
| Field | Type | Description |
|---|---|---|
frameName | string | Unique identifier for the frame, typically sourced from the FrameName enum |
interval | CandleInterval | Candle step size; determines how often getSignal is called and which candle series is iterated |
startDate | Date | Inclusive start of the backtest window |
endDate | Date | Inclusive end of the backtest window |
note | string | Human-readable label shown in the backtest-kit UI and stored in session metadata |
Available intervals
CandleInterval is a union of the string literals defined in the backtest-kit INTERVAL_MINUTES record. Every value maps to the number of minutes in that candle:
| Interval | Minutes |
|---|---|
"1m" | 1 |
"3m" | 3 |
"5m" | 5 |
"15m" | 15 |
"30m" | 30 |
"1h" | 60 |
"2h" | 120 |
"4h" | 240 |
"6h" | 360 |
"8h" | 480 |
"1d" | 1440 |
interval you choose for a frame becomes the step size used in readCandlesData() — the runner advances the simulation clock by exactly one interval per tick.
FrameName enum
src/enum/FrameName.ts centralises all registered frame identifiers:
"jan_2026_frame") must match the frameName string passed to addFrameSchema in the corresponding frame module.
Adding a new frame
Create the frame file
Create a new file under
src/logic/frame/. Name it to match the period you are testing:Import in src/logic/index.ts
Register the frame module by importing it in The import is purely for its side-effect — calling
src/logic/index.ts:addFrameSchema at module load registers the frame with the runtime.Candle warming
Before the backtest loop starts,backtest.ts calls warmCandles() to pre-fetch the full OHLCV dataset from the exchange and store it in the MinIO/Redis persistence layer. Subsequent reads during the simulation are served from the local cache — no live exchange calls during replay.
| Parameter | Description |
|---|---|
exchangeName | The registered exchange adapter to fetch from (matches ExchangeName enum) |
from | Warming start date — should match the frame’s startDate |
to | Warming end date — should match the frame’s endDate |
interval | Candle granularity — should match the frame’s interval |
symbol | The trading pair to pre-fetch |
warmCandles is designed to be idempotent: candle objects in MinIO are immutable insert-only (stat + PUT) so re-running the same warm call never overwrites existing data.
Always use UTC dates for
startDate, endDate, and the from/to arguments of warmCandles. The backtest-kit runtime stores and compares all timestamps in UTC. A local-timezone new Date("2026-01-01") may shift the boundary by hours and leave the first or last partial day uncached.The
interval you set on the frame controls the step size in readCandlesData(). A "1m" frame advances the simulation one minute at a time, calling getSignal at every bar. Choosing a coarser interval (e.g. "1h") dramatically reduces the number of getSignal calls and the volume of candle data that needs warming, at the cost of intra-hour precision. Match the frame interval to the finest resolution your strategy actually needs.