The backtest-kit-redis-mongo-docker integration is configured entirely through environment variables. Application-level variables control how the Node.js process connects to Redis and MongoDB, while Docker container variables control runtime behaviour such as which mode to run, which strategy to load, and which optional features to enable. All variables can live in a singleDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/theonetrade/backtest-kit-redis-mongo-docker/llms.txt
Use this file to discover all available pages before exploring further.
.env file that is shared by both the local Node.js process and the Docker container.
The
.env file is loaded by both the local Node.js process (via dotenv) and the Docker container (via the env_file directive in docker-compose.yaml). A single file therefore configures the full stack consistently across local and containerised runs.Quickstart: .env.example
Copy .env.example to .env and fill in the values for your environment before starting any service.
Application Environment Variables
These variables are consumed by the Node.js process at startup viasrc/config/params.ts and src/config/redis.ts / src/config/mongo.ts. They control the connection details for Redis and MongoDB.
Redis Connection
Hostname or IP address of the Redis server. When running inside Docker, set this to
host.docker.internal so the container can reach a Redis instance on the host machine.TCP port on which Redis is listening. The standard Redis port is
6379 and matches the port exposed by the bundled docker/redis/docker-compose.yaml.Redis ACL username. The default Redis user is named
default; change this only if your Redis instance uses a custom ACL configuration.Password for the Redis user. Must match the
--requirepass value set in docker/redis/docker-compose.yaml. Update both files together whenever you rotate the password.MongoDB Connection
Full MongoDB connection URI including host, port, database name, and connection options. The
wtimeoutMS=15000 query parameter sets a 15-second write-concern timeout to prevent indefinite hangs on slow writes. When running in Docker, replace localhost with host.docker.internal.Docker Container Environment Variables
These variables are declared in theenvironment block of docker-compose.yaml and are forwarded from the host shell (or the .env file) into the running container. They are read by the backtest-kit CLI and the application entry points at runtime.
Execution Control
Selects the run mode passed to the CLI. Accepted values are
backtest, live, and paper. When using npm run start:docker the script sets MODE=backtest automatically.Set to
1 to allow the strategy entry points to execute. All three main entry points (backtest.ts, live.ts, paper.ts) immediately return if ENTRY is not set to 1. This acts as a safety guard against accidental execution.Path to the compiled strategy bundle that the CLI will load. The default value matches the Rollup output path produced by
npm run build.Strategy Overrides
Override the default trading symbol (e.g.
TRXUSDT). When set, this value takes precedence over any symbol hardcoded in the strategy entry point.Override the strategy name registered in the IoC container. Useful for running a different strategy without rebuilding the image.
Override the exchange name (e.g.
ccxt). Corresponds to the ExchangeName enum values used inside the strategy entry points.Override the frame name that defines the historical time window for backtesting. Corresponds to
FrameName enum values.Optional Features
Set to
1 to enable the web dashboard. When active, the dashboard is served on port 60050 and is accessible at http://localhost:60050. The health-check endpoint at /api/v1/health/health_check is also available when the UI is enabled.Set to
1 to enable Telegram trade notifications. Requires additional Telegram bot credentials to be configured in the strategy code.Set to
1 to enable verbose logging output from the CLI and strategy runtime. Useful for debugging indicator calculations and order flow.Set to
1 to disable the Redis O(1) ID cache. All ID lookups will fall back to MongoDB queries. Useful for testing persistence logic without a running Redis instance.Set to
1 to skip the Redis cache flush that normally occurs on startup. Preserves any cached IDs from a previous run, which can significantly speed up repeated backtests over the same date range.