Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/theonetrade/uzse-backtest-app/llms.txt

Use this file to discover all available pages before exploring further.

Before running any script in UZSE Backtest App, your environment needs a handful of tools in place. This page documents every prerequisite — from the Node.js runtime version to the Playwright browser binary — so you can work through the checklist once and then follow the Quickstart without interruption.
MongoDB must be running and reachable before you execute import-trades.ts, build-candles.ts, or npm start. All three scripts open a database connection on startup and will exit immediately with a connection error if MongoDB is unavailable.

Prerequisites Checklist

1

Node.js 18 or later

All pipeline scripts are written in TypeScript and run directly via npx tsx — a zero-config TypeScript executor that requires Node.js 18 or later for its native ESM and built-in fetch support.Check your current version:
node --version
# v18.20.0  (or higher)
If you need to upgrade, use nvm (macOS / Linux) or download the installer from nodejs.org:
nvm install 18
nvm use 18
2

MongoDB (local or remote)

UZSE Backtest App uses MongoDB as its storage layer for both raw trade records (trade-results collection) and assembled OHLCV candles (candle-items collection). You need a running MongoDB instance — version 6 or 7 — before executing any pipeline script.The connection string is read from the MONGO_URI environment variable at startup. If the variable is not set, the app falls back to the default:
// config/setup.ts
const MONGO_URI = process.env.MONGO_URI || "mongodb://localhost:27017/backtest";
mongoose.connect(MONGO_URI);
To use the default, simply ensure MongoDB is listening on port 27017 on your local machine. To point at a remote or Dockerised instance, export the variable before running any script:
export MONGO_URI="mongodb://user:password@host:27017/backtest"
docker run -d \
  --name uzse-mongo \
  -p 27017:27017 \
  mongo:7
For a production-ready Docker Compose stack that bundles MongoDB together with Redis and MinIO, see the MongoDB infrastructure guide.
3

Playwright Chromium browser

The download-trades.ts script uses Playwright to launch a headless Chromium browser and scrape paginated HTML trade tables from uzse.uz. Playwright’s browser binaries are not bundled with npm install — they must be installed separately with the following command:
npx playwright install chromium
This downloads the Chromium binary managed by Playwright (separate from any system Chrome installation) and places it in Playwright’s local cache. You only need to run this once per machine.
If you are running in a CI or headless Linux environment, you may also need the OS-level dependencies that Chromium requires. Run npx playwright install-deps chromium to install them automatically on Debian/Ubuntu-based systems.
4

npm install — project dependencies

Clone the repository and install all Node.js packages declared in package.json:
git clone https://github.com/theonetrade/uzse-backtest-app.git
cd uzse-backtest-app
npm install
The following packages will be installed:
PackageVersionPurpose
backtest-kit^10.2.0Core runtime: exchange adapter API, candle types
@backtest-kit/cli^10.2.0CLI that serves the visual editor (npm start)
@backtest-kit/graph^10.2.0Chart rendering engine used by the editor
@backtest-kit/pinets^10.2.0Pine Script indicator and strategy library
@backtest-kit/ui^10.2.0Editor UI components
mongoose^8.23.0MongoDB ODM for trade and candle schemas
playwright^1.59.1Headless browser for scraping uzse.uz
functools-kit^2.2.0Functional utilities used throughout pipeline scripts
get-moment-stamp^2.0.0Timestamp utility used in pipeline date calculations
garch^1.2.3GARCH volatility modelling for advanced indicators
volume-anomaly^1.2.3Volume anomaly detection indicator library
agent-swarm-kit^2.7.0AI agent orchestration for news-sentiment analysis
ollama^0.6.3Local LLM integration for sentiment signals
agent-swarm-kit and ollama are required by the news-sentiment AI layer. If you only intend to use the data pipeline and editor, these packages are still installed as part of npm install but do not need any additional setup unless you activate that feature.
5

Docker (optional, recommended)

Docker is not strictly required, but it is the fastest way to spin up the full infrastructure stack — MongoDB, Redis, and MinIO — without installing any services natively on your machine.If you choose to use Docker, ensure you have:
  • Docker Engine 24+ or Docker Desktop 4+
  • Docker Compose v2 (included with Docker Desktop; available separately as docker-compose-plugin on Linux)
Check your versions:
docker --version
# Docker version 24.0.7, build afdd53b

docker compose version
# Docker Compose version v2.23.0
Infrastructure setup guides:

MongoDB

Run MongoDB in Docker with optional persistence volumes.

Redis

Run Redis for caching and session state used by the editor.

MinIO

Run MinIO as S3-compatible object storage for large trade dumps.

Quick Reference

RequirementMinimum VersionRequired?Notes
Node.js18.x✅ YesNeeded for npx tsx and native ESM
MongoDB6.x✅ YesDefault URI: mongodb://localhost:27017/backtest
Playwright ChromiumLatest (via npx playwright install chromium)✅ YesOnly needed for download-trades.ts
Docker24.xOptionalRecommended for MongoDB / Redis / MinIO
Docker Composev2OptionalRequired if using the Compose stack
OllamaLatestOptionalOnly needed for AI news-sentiment features

Environment Variables

VariableDefaultDescription
MONGO_URImongodb://localhost:27017/backtestFull MongoDB connection string; set this to override the default local instance.
To persist this variable across terminal sessions, add it to your shell profile (.bashrc, .zshrc, etc.) or use a .env file with a tool like dotenv-cli.

Ready to Continue?

With all prerequisites satisfied, head to the Quickstart to download your first month of UZSE trade data and open it in the visual editor.

Quickstart

Run the four-stage pipeline end to end and open your first chart in the backtest-kit editor.

Configuration

Review all available environment variables and configuration options for the full stack.

Build docs developers (and LLMs) love