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.

The backtest-kit visual editor is a browser-based charting environment that reads OHLCV candlestick data directly from MongoDB and lets you apply TradingView-compatible Pine Script indicators to UZSE securities — all without a TradingView subscription or an exchange listing. Once your candle data is loaded into the database, a single command brings up the full interactive chart.

Prerequisites

Before launching the editor, make sure the following are in place:
1

MongoDB is running with candle data

The editor queries the backtest database for OHLCV records. Follow the Build Candles guide to populate the candle-items collection before starting the editor.
2

Environment variable is set (optional)

The MONGO_URI environment variable controls which MongoDB instance the editor connects to. The default is mongodb://localhost:27017/backtest. Override it if your instance is remote or uses a non-standard port:
export MONGO_URI="mongodb://user:pass@host:27017/backtest"
3

Symbol config is configured

Open config/symbol.config.cjs and confirm the symbol you want to chart is listed. The editor uses this config to populate the symbol picker in the UI.

Starting the Editor

Run the following command from the project root:
npm start
This executes the start script defined in package.json:
{
  "scripts": {
    "start": "node ./node_modules/@backtest-kit/cli/build/index.mjs --editor"
  }
}
The command launches the @backtest-kit/cli package (v10.2.0+) in --editor mode, which starts a local web server and opens the chart interface in your browser.
If you need to chart a different UZSE security, update the config/symbol.config.cjs file with the relevant ticker (e.g. HMKB / UZ7011340005) before starting the editor. The symbol picker in the UI reads from this config at startup.

How the Exchange Module Connects

The editor does not connect to a live exchange. Instead, it loads modules/editor.module.ts at startup, which calls addExchangeSchema from the backtest-kit package to register a custom data source named "mongo-exchange". When you select a symbol and timeframe in the UI, the editor calls the registered getCandles function, which queries MongoDB for the matching OHLCV records and returns them to the chart renderer. See Exchange Module for the full implementation and API reference for addExchangeSchema.

Editor Features

Candlestick Charts

Interactive OHLCV candlestick charts rendered from your local MongoDB candle data across all supported timeframes.

Multiple Timeframes

Switch between any supported interval — 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, and 1d — without re-running the build pipeline.

Pine Script Indicators

Load and overlay TradingView-compatible Pine Script v6 indicators, including the bundled DeltaPulse Wave oscillator.

Trade History View

Browse the raw executed-trade history alongside the candlestick chart to correlate price action with individual transactions.

Environment Reference

MONGO_URI
string
default:"mongodb://localhost:27017/backtest"
MongoDB connection string used by the editor module. Set this environment variable before running npm start to point the editor at a different host, port, or database.
UZSE securities can experience multi-day trading halts, single-price auction days, and long periods of zero volume. These gaps appear as flat candles with volume = 0 in the chart — this is expected behaviour produced by the candle-building pipeline, not a data error.

Build docs developers (and LLMs) love