MongoDB is the primary data store for the UZSE Backtest App, holding both the raw trades scraped fromDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/backtest-kit/uzse-backtest-app/llms.txt
Use this file to discover all available pages before exploring further.
uzse.uz and the OHLCV candlestick series built from them. Every script in the pipeline reads from or writes to a MongoDB database named backtest, making a running MongoDB instance a hard requirement before executing any data collection or candle-building commands.
Collections
The app works with two collections inside thebacktest database:
trade-results
Raw UZSE trade records imported from HTML pages via
scripts/import-trades.ts. Each document represents a single executed trade with ticker, volume, price, and timestamp.candle-items
OHLCV candles built by
build-candles.ts from the raw trades in trade-results. These are the series consumed by backtest-kit indicators and Pine Script strategies.Running MongoDB with Docker
The repository ships a ready-to-use Docker Compose file atdocker/mongo/docker-compose.yaml. It runs MongoDB Community Server 8.0.4 and persists data to a local volume so the database survives container restarts.
docker/mongo/docker-compose.yaml
Connecting the App
Connection logic lives inconfig/setup.ts. The file reads the MONGO_URI environment variable and falls back to a local default when the variable is not set:
config/setup.ts
Using a Remote MongoDB Instance
To point the app at a hosted or remote MongoDB, setMONGO_URI before running any script:
import-trades.ts, build-candles.ts, etc.) because they all import config/setup.ts.
Bulk Import from JSON Dumps
If you already have exported data from a previous run, you can restore both collections directly withmongoimport instead of re-running the scraper:
The
--jsonArray flag is required because dump files contain a top-level JSON array. Omitting it will cause mongoimport to reject the file.