Mode B is the focused development path. When you run a backtest without theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/backtest-kit/backtest-monorepo-parallel/llms.txt
Use this file to discover all available pages before exploring further.
--entry flag, packages/main/src/main/backtest.ts detects the missing flag and early-returns immediately. Control passes entirely to @backtest-kit/cli, which loads the strategy file you provide as a path argument, calls the addStrategySchema, addExchangeSchema, and addFrameSchema functions registered inside it, and runs a single-symbol backtest based on whatever the strategy file dispatches. There is no parallel runner, no CC_SYMBOL_LIST iteration, and no cross-symbol coordination — just one strategy against one symbol at a time.
The exact command
Flag breakdown
| Flag | Type | Effect |
|---|---|---|
--backtest | boolean | Activates backtest mode globally |
--ui | boolean | Starts the @backtest-kit/ui web dashboard on port 60050 |
--noCache | boolean | Skips candle pre-warming; the CLI fetches candles on demand as the replay advances |
(no --entry) | — | backtest.ts early-returns; @backtest-kit/cli takes over as the sole runner |
How the CLI runner works
Load the strategy file by path
@backtest-kit/cli receives the positional argument (./content/apr_2026.strategy/apr_2026.strategy.ts) and evaluates it at runtime. The file’s top-level code runs immediately, registering all schemas with the engine.The apr_2026.strategy.ts file registers the core strategy logic:backtest.module.ts registers the exchange and frame:Resolve schemas
The CLI calls
listStrategySchema(), listExchangeSchema(), and listFrameSchema() to retrieve the registered schemas. If any are missing, the run fails with a clear error message before any replay begins.When to use Mode B
Developing a new strategy
Mode B gives you a tight feedback loop. Edit the strategy file, rerun the command, and see results without waiting for 8 other symbols to finish.
Debugging a specific symbol
When a signal misfires on a single pair, Mode B lets you focus log output and UI state on exactly that symbol without noise from the rest of the list.
Low-infrastructure environments
Running 9 parallel contexts multiplies Mongo write pressure and Redis round-trips. Mode B is far lighter and works fine on machines with constrained resources.
Validating a frame change
When you update
startDate or endDate in addFrameSchema, Mode B confirms the new window is sane before you commit to a full multi-symbol cache pre-warm with --cache.Mode A vs Mode B comparison
| Aspect | Mode A (parallel) | Mode B (single) |
|---|---|---|
--entry flag | Required | Must be omitted |
--cache flag | Recommended on first run | Not needed (--noCache typical) |
| Runner | packages/main/src/main/backtest.ts | @backtest-kit/cli built-in runner |
| Symbols | All in CC_SYMBOL_LIST (default: 9) | One, as dispatched by the strategy file |
| Concurrency | 9 contexts, single Node process | 1 context |
| Mongo / Redis pressure | High (9 concurrent writers) | Low (1 writer) |
| Best for | Measuring aggregate performance, regression testing | Strategy authoring, focused debugging, CI |
| Measured replay speed | ≈ 6 326× real-time (aggregate) | Single-symbol fraction of Mode A throughput |
The early-return gate
The mechanism that switches between modes is a simple guard at the top ofbacktest.ts. Because --entry is false by default, omitting it is all that is needed to hand control to @backtest-kit/cli: