This quickstart walks you through the complete UZSE Backtest App pipeline — from a fresh clone to a live Pine Script chart in the browser — in roughly 10–15 minutes, depending on how many pages of trades the date range returns. By the end you will have a running MongoDB instance, one month of HMKB trade data imported and built into 11 OHLCV timeframes, and the backtest-kit editor open and ready for indicators.Documentation 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.
Clone the repository and install dependencies
The project is not published to npm. Clone it, enter the directory, and install all Node.js dependencies:
Node.js 18 or newer is required. Check your version with
node --version before continuing.Start MongoDB with Docker
The project ships a Docker Compose file at Start the container:MongoDB will be available at
docker/mongo/docker-compose.yaml that runs MongoDB Community Server 8.0 and persists data to a local mongo_data/ volume.mongodb://localhost:27017/backtest. All scripts connect to this URI by default; override it with the MONGO_URI environment variable if needed.Download a month of UZSE trades
Return to the project root, then run The script launches a headless Chromium browser, paginates through the
download-trades.ts with the HMKB ticker’s ISIN (UZ7011340005) and a one-month date range. Dates use DD.MM.YYYY format.trade_results endpoint on uzse.uz, and saves each page as tmp/trades_page_N.html. The terminal will report the total page count and progress as files are written.The
tmp/ directory is created automatically if it does not exist. Any existing *.html files there are deleted at the start of each run, so you always start with a clean slate for the date range you specified.Import the trades into MongoDB
Once the HTML files are in The script reads every
tmp/, parse and insert them into the trade-results collection:trades_page_*.html file in order, extracts rows from the HTML tables, converts Russian-language date strings to UTC timestamps, and inserts each record. Duplicate detection is handled by a SHA-1 hash of the trade’s key fields, so re-running this command is completely safe — duplicate records are silently skipped and counted separately in the output. The tmp/ directory is cleaned up automatically after a successful import.Sample output:Build OHLCV candlesticks
With trades in MongoDB, generate candlesticks for all supported timeframes:The first argument is the display symbol (
HMKB) written into the candle-items collection; the second is the ISIN used to query the trade-results collection. The script builds all 11 timeframes — 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, and 1d — in a single pass. Intraday gaps and non-trading days (weekends and holidays) are automatically filled using the previous close price so the series is continuous.Progress is printed inline as each day is processed:Start the editor
Launch the backtest-kit editor from the project root:This runs
node ./node_modules/@backtest-kit/cli/build/index.mjs --editor, which starts a local web server and opens the backtest-kit editor in your browser. Select HMKB from the symbol list, choose a timeframe, and paste any Pine Script indicator into the editor panel to run it against the UZSE candlestick data you just built.The editor reads candlestick data directly from MongoDB. Make sure the Docker container from Step 2 is still running before you start the editor.
Next Steps
Download Trades
Learn date formatting, all CLI arguments, how pagination and retries work, and how to generate a batch fetch script that covers years of history in one shot.
Build Candles
Deep dive into the gap-filling algorithm, how higher timeframes are aggregated from the 1m series, and the idempotency guarantee.
Editor
Configure the backtest-kit editor, load symbols, switch timeframes, and apply Pine Script indicators to your UZSE charts.
Batch Fetch
Use the parser sequence script to auto-generate a shell script that downloads and imports multiple years of trade history month by month.