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.
@pro/main package reads all runtime configuration from a single call to getArgs(), which wraps Node’s built-in parseArgs utility with strict: false and allowPositionals: true. Every flag is a plain boolean that defaults to false; flags are not mutually exclusive and are routinely combined in a single command. The positional argument — a path to a .strategy.ts file — tells the CLI loader which strategy module to execute before the entry-point gates are evaluated.
Mode flags
These flags gate execution insidepackages/main/src/main/backtest.ts, live.ts, and paper.ts. Each module checks for both its own flag and --entry; omitting either causes an early return.
Activates backtest mode. Routes execution to
packages/main/src/main/backtest.ts, which calls Backtest.background(symbol, …) for every symbol in CC_SYMBOL_LIST. Requires --entry for the parallel (Mode A) path; without --entry, the bundled @backtest-kit/cli runner handles the file instead (Mode B, single-symbol).Activates live trading mode. Routes execution to
packages/main/src/main/live.ts, which calls Live.background(symbol, …) for every symbol in CC_SYMBOL_LIST. Requires --entry.Activates paper trading mode. Routes execution to
packages/main/src/main/paper.ts. Structurally identical to live mode — the same Live.background call is used — but paper mode does not send real orders. Requires --entry.Activates Telegram QR-code session auth. Routes execution to
packages/main/src/main/session.ts. Does not require --entry — the session module checks only its own flag and runs unconditionally when set. Saves the resulting session string to ./session.txt.Parallel-runner flag
Enables the parallel runner gate inside
backtest.ts, live.ts, and paper.ts. When present, each module proceeds to load schemas, iterate CC_SYMBOL_LIST, and call *.background(symbol, …) for every symbol concurrently in the same Node process. When absent, the module’s main() function returns immediately and the @backtest-kit/cli runner (Mode B) takes over.--entry is required for Mode A (parallel, multi-symbol) and has no effect in Mode B. In Mode B, the @backtest-kit/cli package reads the strategy file directly and drives a single-symbol backtest without consulting packages/main/src/main/backtest.ts at all.Cache flag
Pre-warms candles for every symbol in
CC_SYMBOL_LIST into MongoDB before starting the parallel runners. Calls cacheCandles({ exchangeName, from, to, interval: '1m', symbol }) for each symbol using the registered frame’s startDate / endDate. Ignored when --entry is not set.Pass-through flags
The following flags are not parsed bygetArgs() in packages/main. Because parseArgs is called with strict: false and allowPositionals: true, any unrecognised flags are silently ignored by @pro/main and forwarded to @backtest-kit/cli, which handles them directly.
--ui— Starts the@backtest-kit/uiweb interface on port 60050. The dashboard shows live equity curves, open positions, and log streams for all running symbols.--noCache— Explicitly disables candle caching. Useful in Mode B when you want to force a fresh fetch from the exchange on every run.
Positional argument
Path to the strategy entry file, passed as the first positional argument. The
@backtest-kit/cli loader evaluates this file at startup, which registers strategy, exchange, and frame schemas via addStrategySchema, addExchangeSchema, and addFrameSchema before any entry-point gate runs.Environment variables
These are declared inpackages/main/src/config/params.ts and consumed throughout the entry-point modules.
Comma-separated list of trading-pair symbols iterated by the parallel runner.Default:
BTCUSDT,POLUSDT,ZECUSDT,HYPEUSDT,XAUTUSDT,DOGEUSDT,SOLUSDT,PENGUUSDT,HBARUSDTTelegram MTProto application ID. Used exclusively by
session.ts when --session is set.Default: 31861455 (development placeholder — replace with your own from my.telegram.org)Telegram MTProto application hash. Used exclusively by
session.ts when --session is set.Default: ca60446c67ce250ee4e789c730163449 (development placeholder — replace with your own)