UZSE Backtest App is an open-source toolkit that bridges the gap between the Uzbekistan Stock Exchange (UZSE) and the Pine Script ecosystem. It scrapes raw trade data directly from uzse.uz, stores it in MongoDB, aggregates it into continuous OHLCV candlestick series, and feeds the result into the backtest-kit editor — giving you full TradingView-style technical analysis on a market that TradingView doesn’t support.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.
Quickstart
Set up MongoDB, download your first trades, and view a chart in under 10 minutes.
Data Pipeline
Download, parse, and import UZSE trade pages into MongoDB automatically.
Build Candles
Aggregate raw trades into 11 OHLCV timeframes with continuous gap-filling.
Pine Script Editor
Connect MongoDB candles to the backtest-kit editor and run technical indicators.
How It Works
UZSE Backtest App follows a three-stage pipeline:Download Trade Data
Use
download-trades.ts to scrape paginated trade results from uzse.uz using a headless Playwright browser. HTML pages are saved locally in tmp/.Import into MongoDB
Run
import-trades.ts to parse the saved HTML tables, deduplicate records via SHA1 hash, and insert trades into the trade-results collection.Build Candlesticks
Execute
build-candles.ts to aggregate trades into OHLCV candles across 11 timeframes (1m → 1d), filling intraday and non-trading day gaps automatically.Key Features
Playwright Scraping
Headless browser automation handles pagination and JavaScript-rendered pages on uzse.uz with automatic retries.
Idempotent Imports
SHA1-based deduplication ensures re-running any script never creates duplicate records in MongoDB.
11 Timeframes
From 1-minute to daily candles — all built from the same raw 1m series for perfect consistency.
Continuous Series
Intraday gaps and non-trading days are automatically filled so indicators always receive a gapless series.
Batch Fetch Scripts
Cross-platform scripts (
fetch.sh / fetch.bat) download and import the full UZSE history from Feb 2018 to present.Reference Schemas
Typed Mongoose models for
trade-results and candle-items with unique indexes for safety.No TradingView account or API key is required. All data is collected directly from the public UZSE trade results page at uzse.uz.