TheDocumentation 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.
TradeModel represents a single executed trade scraped from the Uzbekistan Stock Exchange (UZSE) website. Every row returned by the UZSE HTML trade history pages — with its Russian-language date format, ISIN identifier, and UZS-denominated values — is normalised and stored as a document in the trade-results collection. This collection is the raw source of truth that the build-candles.ts script reads when constructing OHLCV candlestick series.
Collection Details
| Property | Value |
|---|---|
| MongoDB collection | trade-results |
| Mongoose model | TradeModel |
| TypeScript interface | ITradeDto |
| Database | backtest (configured via MONGO_URI) |
Fields
Trade execution timestamp. The UZSE website presents dates in Russian-language format — for example,
17 апреля 2026, 16:02 — which the download/import scripts parse into a JavaScript Date stored in UTC.Indexed individually ({ time: 1 }) and as part of the compound { symbol, time } index used by the candle builder.ISIN code of the security — e.g.
UZ7011340005. This is the authoritative identifier used by UZSE in its trade records. Note that this differs from the display symbol (HMKB) stored in the candle-items collection; the build-candles.ts script accepts the ISIN as a separate argument and handles the mapping.Indexed individually ({ symbol: 1 }) and as part of the compound { symbol, time } index.Full name of the security issuer (company) as listed on UZSE. Examples:
<Hamkorbank> ATB, O'zbekiston temir yo'llari JSC. The issuer name is scraped verbatim from the exchange and may contain angle brackets or Uzbek/Russian characters.Type of security as reported by UZSE. Common values include:
Additional security types (e.g. bonds, ETFs) may appear depending on the queried
| Value | Meaning |
|---|---|
Простые акции | Common (ordinary) stock |
Привилегированные акции | Preferred stock |
market.Market sector (trading segment) of the trade. Common values:
The market code is used to filter the correct segment when scraping UZSE pages.
| Value | Meaning |
|---|---|
STK | Equities / stocks |
BON | Bonds |
Trading session or platform identifier assigned by UZSE — e.g.
G1, G2. Different platforms may represent different auction mechanisms or session windows on the exchange.Price per security in UZS (Uzbekistani soums) at which this trade was executed. This value is used directly as the OHLCV price signal when aggregating 1-minute candles.
Number of securities (shares, bonds, etc.) exchanged in this single trade. This is the raw share count, not the monetary value. It maps directly to the
volume field in candle documents (candle volume = sum of trade quantity values within the period).Total monetary value of the trade in UZS, calculated as
tradePrice × quantity. This represents the full consideration exchanged, not the number of securities. See the note below about the semantic distinction between trade volume and candle volume.SHA1 deduplication fingerprint. Computed from the pipe-delimited concatenation:where
urlKey is itself begin|end|search_key — the query parameters extracted from the UZSE trade-results URL for that scrape run. The { hash: 1 } unique index means that re-importing the same UZSE export file will silently skip any row whose hash already exists in the database, making the import pipeline fully idempotent.Carries a unique: true index constraint.Creation timestamp managed automatically by Mongoose via
timestamps: { createdAt: "createDate" }. Set once at insert time; never modified.Last-updated timestamp managed automatically by Mongoose via
timestamps: { updatedAt: "updatedDate" }. Refreshed on any subsequent document save.Indexes
| Index | Type | Purpose |
|---|---|---|
{ hash: 1 } | Unique | Prevents duplicate trade imports across re-runs |
{ symbol: 1, time: 1 } | Compound | Efficient range queries by ISIN and date range (primary access pattern for build-candles.ts) |
{ time: 1 } | Standard | Date-range scans across all symbols |
{ symbol: 1 } | Standard | Lookups by ISIN across all dates |
TypeScript Interface
ITradeDto:
TradeDocument— extends bothITradeDtoand MongooseDocument; used for typed Mongoose operations.ITradeRow— addsid: string,createDate: Date, andupdatedDate: Date; used when reading fully-hydrated documents.
Mongoose Schema Definition
Trade
volume vs candle volume: In UZSE trade records, the volume field is the total monetary value of the trade in UZS soums (tradePrice × quantity). In the candle-items collection, however, the volume field represents the sum of quantity (share count) across all trades in the candle period. These are different quantities with different units — always check which collection you are querying.Deduplication Hash Details
The SHA1 hash is computed over a pipe-delimited string that includes not only the trade data itself but also the scraping context (pageIndex, rowIndex, urlKey). This means:
Including scraping-context fields (pageIndex, rowIndex, urlKey) in the hash ensures that the fingerprint captures both the trade content and the scraping context, making the import pipeline fully idempotent across re-runs.
Related Pages
Candle Schema
The
candle-items collection schema that stores aggregated OHLCV candles derived from these trades.Data Model
How trade records flow into candles and are queried by the backtest editor.
Import Trades
How to import downloaded UZSE HTML trade files into the
trade-results collection.Build Candles
How
build-candles.ts reads from trade-results and writes to candle-items.