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.
download-trades.ts is the first step in the data pipeline. It launches a headless Chromium browser via Playwright, navigates to the UZSE trade results page at uzse.uz/trade_results, and iterates through every paginated result for a given symbol and date range — saving each page as a raw HTML file in the local tmp/ directory, ready for import.
How It Works
The script uses Playwright’s Chromium engine in headless mode so it can execute the JavaScript-rendered UZSE trade results page just as a real browser would. Pagination detection is handled bygetLastPage(), which scans the first page’s HTML for a class="last next" anchor tag and reads its page= query parameter. This tells the script exactly how many pages to fetch before stopping.
Retry logic is built into every page fetch. If a navigation times out (the networkidle wait exceeds 30 seconds), the script warns and retries automatically:
- Retries: 10 attempts per page
- Retry delay: 30 seconds between attempts
- Timeout per attempt: 30 seconds
tmp/ if it does not exist and clears any pre-existing .html files from a previous run before fetching fresh pages.
Usage
Parameters
The ISIN code of the security to download trades for.
Example:
Example:
UZ7011340005Start date of the query window in
Example:
DD.MM.YYYY format.Example:
01.03.2026End date of the query window in
Example:
DD.MM.YYYY format.Example:
31.03.2026Market sector filter. Defaults to
Common values:
STK (equities) when omitted.Common values:
STK (stocks), BON (bonds).Examples
Download all trades for March 2026:Output
Each paginated result is written to thetmp/ directory as a numbered HTML file:
The
tmp/ directory is wiped of all .html files at the start of every run and again automatically after import-trades.ts has finished processing them. Never store files you want to keep inside tmp/.Next Step
Import Trades into MongoDB
Parse the downloaded HTML files, extract structured trade records, and insert them into MongoDB with SHA1-based deduplication.