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.

MongoDB is the primary data store for the UZSE Backtest App. It holds both the raw trade records scraped from the Uzbekistan Stock Exchange and the computed OHLCV candlestick data derived from them. All pipeline stages — from importing trades to building candles and running gap checks — read from and write to this database. The connection is configured via a single MONGO_URI environment variable, making it straightforward to point the app at a local container or a remote Atlas cluster.

Docker Compose

The project ships a ready-made docker-compose.yaml under docker/mongo/ that runs MongoDB Community Server 8.0.4 on the default port 27017. Data is persisted to a local mongo_data/ directory via a bind mount so it survives container restarts.
version: '3.8'
services:
  mongodb:
    image: mongodb/mongodb-community-server:8.0.4-ubi8
    container_name: node-ollama-agent-swarm-mongo-server
    ports:
      - '27017:27017'
    volumes:
      - ./mongo_data:/data/db
    restart: always

Starting MongoDB

1

Navigate to the Mongo Docker directory

cd docker/mongo
2

Start the container in detached mode

docker compose up -d
3

Verify the container is running

docker ps --filter name=node-ollama-agent-swarm-mongo-server

Connection

Set the MONGO_URI environment variable to point the application at your MongoDB instance. The default value targets the local Docker container:
MONGO_URI=mongodb://localhost:27017/backtest
SettingValue
Hostlocalhost
Port27017
Databasebacktest
The database name backtest is embedded in the URI. You can target a different database by changing the path segment. See Configuration for details on setting environment variables.

Collections

Mongoose creates both collections automatically on the first document insert — no manual setup is required. The two collections used by the app are:

trade-results

Raw UZSE trade records scraped from the exchange. Each document represents a single executed trade, including price, quantity, volume, issuer, and a SHA-1 hash for idempotent imports.

candle-items

Computed OHLCV candlestick data built from the raw trades. Each document stores open, high, low, close, volume, symbol, interval, and timestamp fields.

Importing Pre-Built Data Dumps

If you have existing JSON exports of the database (for example, from a colleague’s environment or a public snapshot), you can load them directly with mongoimport:
mongoimport --db backtest --collection trade-results --file backtest.trade-results.json --jsonArray
mongoimport --db backtest --collection candle-items  --file backtest.candle-items.json  --jsonArray
This is the fastest way to seed a fresh environment without re-running the full download and build-candles pipeline.
Eight years of UZSE trade history generates a substantial number of documents across both collections. Make sure the mongo_data volume is backed by a persistent, adequately-sized disk — especially in cloud or VM environments where ephemeral storage is the default. Running out of disk space mid-import will corrupt the volume and require a full re-import.

Configuration

Set MONGO_URI and other environment variables.

Import Trades

Load scraped trade JSON files into MongoDB.

Build Candles

Aggregate trade records into OHLCV candlesticks.

Trade Schema

Full field reference for the trade-results collection.

Build docs developers (and LLMs) love