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.

check-gaps.ts is a diagnostic utility that scans the trade-results collection and identifies every calendar day in the data range that has no recorded trades. The output gives you a clear map of UZSE national holidays, extended closures, COVID-era lockdowns, and any days where data collection may have failed.

Usage

npx tsx scripts/check-gaps.ts
The script takes no arguments and requires no configuration beyond a running MongoDB instance with the trade-results collection already populated.

Prerequisites

The trade-results collection must contain imported trade records before running this script. If the collection is empty the script will have no date range to walk.
Run Download Trades followed by Import Trades to populate trade-results before using this diagnostic tool.

What It Does

1

Load all trade timestamps

Queries every document in trade-results, projecting only the time field to minimise memory usage.
2

Build the set of trading days

Each timestamp is normalised to a YYYY-MM-DD key. A Set of unique trading day keys is constructed, giving the total count of days on which at least one trade occurred.
3

Walk the full calendar range

Starting from the earliest trading day and ending at the latest, the script increments day-by-day. Any date not present in the trading-day set is appended to the missing list, along with its day-of-week label.
4

Print the report

The total count of trading days and the full list of missing dates are printed to stdout.

Output Format

Day-of-week labels are rendered in Russian using the abbreviated names Вс / Пн / Вт / Ср / Чт / Пт / Сб (Sunday through Saturday).
Trading days in DB: 1842
Missing days (47):
  2020-03-23 (Пн)
  2020-03-24 (Вт)
  2020-03-25 (Ср)
  2020-03-26 (Чт)
  2020-03-27 (Пт)
  ...

Use Cases

National Holidays

Identifies recurring Uzbek public holidays such as Navruz (March 21), Independence Day (September 1), and Eid closures.

COVID Lockdowns

The March–April 2020 gap cluster corresponds to pandemic-related trading halts across Uzbekistan’s financial markets.

Trading Halts

Isolated single-day gaps may indicate circuit-breaker events, system maintenance, or exchange infrastructure outages.

Collection Gaps

If a gap appears on a day that should have been a trading day, it may mean the scraping run for that month was incomplete or failed silently.
Weekends (Saturday and Sunday) will naturally appear in the missing-days list because the script walks every calendar day without filtering for weekdays. Use the day-of-week label (Сб / Вс) to quickly distinguish weekends from genuine exchange closures.

Build docs developers (and LLMs) love