This page documents every environment variable the project reads, grouped by subsystem: MinIO (S3 object storage), Redis (time-ordered index), and CLI / Docker runtime flags passed to theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/theonetrade/backtest-kit-minio-s3-docker/llms.txt
Use this file to discover all available pages before exploring further.
@backtest-kit/cli entrypoint. All variables are optional — sensible defaults are baked into src/config/params.ts — but production deployments should always override credentials and endpoints explicitly via a .env file.
.env.example
Copy this file to .env at the project root and fill in values appropriate for your environment before starting any containers.
.env.example
MinIO variables
These variables are consumed bygetMinio() in src/config/minio.ts, which constructs a minio.Client instance pointed at your S3-compatible endpoint. SSL is disabled by default; configure a reverse proxy with TLS termination if you need encrypted transport.
The hostname or IP address of the MinIO server. When the backtest-kit process runs inside Docker (via
docker-compose.yaml) use host.docker.internal so the container can reach MinIO on the host machine. For a host-node run (Node.js started directly on the machine), use 127.0.0.1 or the loopback address. Override with a remote hostname if MinIO is deployed on a separate server.The S3 API port exposed by MinIO. The bundled
docker/minio/docker-compose.yaml publishes port 9000 on the host. Change this only if your MinIO deployment listens on a non-standard port or sits behind a load balancer on a different port.The MinIO root user / access key ID. This corresponds to
MINIO_ROOT_USER in the MinIO container’s environment. The default value matches the bundled docker/minio/docker-compose.yaml — change both values together when hardening a production deployment.The MinIO root password / secret access key. This corresponds to
MINIO_ROOT_PASSWORD in the MinIO container. Treat this as a credential: rotate it, store it in your secrets manager, and never commit it to source control.Redis variables
These variables are consumed bygetRedis() in src/config/redis.ts, which creates a singleton ioredis connection and keeps it alive with a 30-second PING interval. The connection is gracefully closed on SIGINT.
The hostname or IP address of the Redis server. Like the MinIO endpoint, use
host.docker.internal when the backtest-kit process runs inside Docker and Redis runs on the host, or 127.0.0.1 for a local host-node run.The Redis TCP port. The bundled
docker/redis/docker-compose.yaml publishes the standard Redis port 6379. Change this if your Redis instance uses a custom port or is reached through a proxy.The Redis ACL username. Redis 6+ supports multiple users via ACL; the special username
default is the built-in superuser and is the correct value for the bundled single-user setup. Adjust this if your Redis deployment uses a named ACL account.The Redis authentication password, passed as
requirepass in the bundled Redis container command. This must match the password configured in docker/redis/docker-compose.yaml. Change it for any non-local deployment and store it in a secrets manager.MongoDB connection string (unused)
CC_MONGO_CONNECTION_STRING is exported from src/config/params.ts as a convenience export but is not consumed anywhere in this project. This MinIO + Redis variant has no MongoDB dependency — the variable exists only because params.ts is shared across multiple backtest-kit variants and the export is harmless when unused.
MongoDB connection URI. Not used by this project. Present in
src/config/params.ts for cross-variant compatibility but no adapter, service, or initialisation path reads it. Do not set this variable — it has no effect on the MinIO S3 Docker deployment.CLI / Docker runtime variables
These variables are forwarded to the@backtest-kit/cli process inside the main docker-compose.yaml container. They map directly to CLI flags — see the backtest-kit CLI reference for the full flag specification. None of them need to be set in .env; they are typically passed on the docker-compose up command line or exported in the shell before running npm scripts.
| Variable | Values / Format | Description |
|---|---|---|
MODE | backtest | live | paper | Selects the running mode. backtest replays historical candles, live trades with real funds, paper simulates live trading without placing real orders. |
STRATEGY_FILE | File path string | Path to the compiled strategy bundle inside the container. Defaults to ./build/index.cjs (relative to /workspace). |
ENTRY | 1 | Set to 1 to actually start the strategy runner. Maps to the --entry CLI flag; without it the process exits immediately after initialisation. |
SYMBOL | e.g. BTCUSDT | Overrides the trading symbol defined in the strategy file. Useful for running the same compiled bundle against different pairs. |
STRATEGY | strategy name string | Overrides the strategy name / identifier in the backtest-kit context. |
EXCHANGE | exchange name string | Overrides the exchange identifier (e.g. CCXT). |
FRAME | frame name string | Overrides the time-frame / candle-window name used by the strategy. |
UI | 1 | Enables the web UI served on port 60050. Open http://localhost:60050 in your browser after the container is healthy. |
TELEGRAM | 1 | Enables Telegram notifications. Requires a valid Telegram bot token and chat ID configured separately in the strategy bundle. |
VERBOSE | 1 | Enables verbose logging — useful for debugging adapter behaviour and network calls. |
NO_CACHE | 1 | Disables in-memory caching of MinIO and Redis results. |
NO_FLUSH | 1 | Skips the flush / clear step that normally runs once on startup before a backtest. Use this to resume an interrupted run without wiping previous results. |
host.docker.internal vs 127.0.0.1The address you use for CC_MINIO_ENDPOINT and CC_REDIS_HOST depends on where the backtest-kit process runs:- Inside Docker (running via
docker-compose.yaml): usehost.docker.internal. The maindocker-compose.yamladds anextra_hostsentry —host.docker.internal:host-gateway— that maps this hostname to the Docker host’s gateway IP. On macOS and Windows, Docker Desktop provides this mapping automatically even without theextra_hostsentry. On Linux, the explicithost-gatewaymapping inextra_hostsis required because the OS does not inject the hostname by default. - Host-node run (Node.js started directly on the machine, not inside a container): use
127.0.0.1. The default values insrc/config/params.tsassume this case, so no.envoverride is needed for a purely local setup.