Bentrix Docs
HomePricingDashboard

JavaScript: recordings, imports and generated markets

Every method of client.recordings in the JavaScript SDK.

dataQuality#

Measure a market's data quality · tool data_quality

scope: readplan: freesince 1.14.0

The data-quality report Market Watch's Data quality... Shows for a laboratory workbench's market over the workbench's days, measured off the store's own files: digits and point, ticks per year, traded days, the first day with real ticks and the days modelled before it, holes with their days, spikes, the share of ticks with both sides, zero-spread ticks and stretches, duplicate and backward stamps, and whose data it is - each figure with what it counts. Beside the figures, for a gate of the caller's own: traded, every day the store holds candles for; modelled, the traded days with no tick file (replayed from candles, never from ticks); holes, each day of a tick file with hours graded missing and those UTC hours; and per_year, each year's ticks, traded days, days with a tick file, modelled days and days with a hole. It reads every tick, so the first call starts the measure and answers measuring: true; call again for the report.

Declaration

client.recordings
dataQuality(args: { bench: string; symbol: string }): Promise<any>

Parameters

NameTypeWhat it is
benchstringrequiredA laboratory workbench, as a bentrix://bench/... Uri.
symbolstringrequiredA market the workbench holds.

Returns

Promise<any> — the tool’s answer as a plain object.

What it answers

What the tool's description says.

Example

await client.recordings.dataQuality({ bench, symbol: "SYN-DOCS" })

downloadDrop#

Take an ask out of the download queue · tool download_drop

scope: labplan: freesince 1.0.0

Takes a queued ask out of the queue, as its row's Remove does; a market it was adding to a workbench, and that no trade names, leaves the workbench again. Answers the downloads.

Declaration

client.recordings
downloadDrop(args: { queued: number }): Promise<any>

Parameters

NameTypeWhat it is
queuednumberrequiredThe ask's place in the queue, as downloads_list gives it.

Returns

Promise<any> — the tool’s answer as a plain object.

What it answers

Answers the downloads.

Example

await client.recordings.downloadDrop({ queued: 1 })

downloadRetry#

Try a download again · tool download_retry

scope: labplan: freesince 1.0.0

Asks for the same download again, as the row that says it came back short does with Try again; it waits behind its laboratory's running walk. Answers the downloads.

Declaration

client.recordings
downloadRetry(args: { download: number }): Promise<any>

Parameters

NameTypeWhat it is
downloadnumberrequiredThe download's number, as downloads_list gives it.

Returns

Promise<any> — the tool’s answer as a plain object.

What it answers

Answers the downloads.

Example

await client.recordings.downloadRetry({ download: 1 })

downloadStop#

Stop a download · tool download_stop

scope: labplan: freesince 1.0.0

Stops a running download, as its row's Stop does; what landed is kept. Answers the downloads.

Declaration

client.recordings
downloadStop(args: { download: number }): Promise<any>

Parameters

NameTypeWhat it is
downloadnumberrequiredThe download's number, as downloads_list gives it.

Returns

Promise<any> — the tool’s answer as a plain object.

What it answers

Answers the downloads.

Example

await client.recordings.downloadStop({ download: 1 })

downloadsList#

Read the downloads · tool downloads_list

scope: readplan: freesince 1.0.0

Answers the downloads strip's rows - each download's number, laboratory, workbench, markets, days and whether it runs or is stopping - and the queue of asks waiting for their laboratory's walk, each by its place.

Declaration

client.recordings
downloadsList(): Promise<any>

It takes no arguments.

Returns

Promise<any> — the tool’s answer as a plain object.

What it answers

Recorded from a running Bentrix 0.1.382 on a laboratory of generated markets (long lists cut to their first rows):

{
  "downloads": [
    {
      "bench": "bentrix://lab/lab-1/bench/bench-2",
      "download": 1,
      "from": "2026-10-01",
      "laboratory": "bentrix://lab/lab-1",
      "markets": [
        "SYN-DOCS"
      ],
      "running": false,
      "stopping": false,
      "to": "2026-10-31"
    },
    {
      "bench": "bentrix://lab/lab-1/bench/bench-2",
      "download": 2,
      "from": "2026-10-01",
      "laboratory": "bentrix://lab/lab-1",
      "markets": [
        "SYN-DOCS2"
      ],
      "running": false,
      "stopping": false,
      "to": "2026-10-31"
    }
  ],
  "queue": []
}

Example

await client.recordings.downloadsList()

generatedBasketCreate#

Make a basket of generated markets · tool generated_basket_create

scope: labplan: freesince 2.2.0

Makes markets that move together in the laboratory of generated markets: a basket of the gallery by its name (USD majors with an exact derived cross, Crypto majors, Two markets), or members of the caller's own (each a recipe's text) with a correlation matrix the fit approximates - made positive semi-definite the nearest way, approximated by a number of factors and pair factors - each member storing its loadings, never the matrix. Answers the markets, the implied matrix, and for a fit the valid matrix, the achieved one and its largest distance from the typed one. With workbench, every market joins it.

Declaration

client.recordings
generatedBasketCreate(args: { laboratory: string; basket?: string; factors?: number; group?: string; matrix?: number[][]; members?: string[]; workbench?: string }): Promise<any>

Parameters

NameTypeWhat it is
laboratorystringrequiredThe laboratory of generated markets, as a bentrix://lab/... Uri.
basketstringoptionalA basket of the gallery by its name (USD majors, Crypto majors, Two markets).
factorsnumberoptionalHow many factors the fit uses, 1 to the members' count; 1 when omitted.
groupstringoptionalThe members' group, a name.
matrixnumber[][]optionalThe correlation the members should have, N by N in the members' order: made valid, fitted with factors factors and pair factors, the achieved matrix answered beside it.
membersstring[]optionalOr the members, each a recipe's text; with matrix, fitted to it.
workbenchstringoptionalA workbench of it the markets are added to.

Returns

Promise<any> — the tool’s answer as a plain object.

What it answers

Answers the markets, the implied matrix, and for a fit the valid matrix, the achieved one and its largest distance from the typed one.

Example

await client.recordings.generatedBasketCreate({ laboratory })

generatedCorrelation#

Read generated markets' correlation · tool generated_correlation

scope: readplan: freesince 2.2.0

The correlation of kept generated markets: the one their loadings imply (the shared factors' products and the pairs'), and the one their generated minute closes realise over the days asked, at the minutes they all traded - generated for the measure and kept nowhere. The two differ by the drift, the regimes' coupling and chance, which is what a person sees.

Declaration

client.recordings
generatedCorrelation(args: { laboratory: string; markets: string[]; days?: number; from?: string }): Promise<any>

Parameters

NameTypeWhat it is
laboratorystringrequiredThe laboratory of generated markets, as a bentrix://lab/... Uri.
marketsstring[]requiredThe kept markets, by name.
daysnumberoptionalThe days measured, 1 to 31; 5 when omitted.
fromstringoptionalThe first day measured, YYYY-MM-DD; the first market's first day when omitted.

Returns

Promise<any> — the tool’s answer as a plain object.

What it answers

What the tool's description says.

Example

await client.recordings.generatedCorrelation({ laboratory, markets: "…" })

generatedEpisode#

Make a Gym episode's market · tool generated_episode

scope: labplan: freesince 2.2.0

A seed per episode: makes the market of one episode of a reinforcement-learning curriculum - the recipe (a preset, the CI tape's shape among them, or a recipe's text) under the episode's seed, named SYN-<name>-S<seed> - keeps it and adds it to the workbench, so env_make on that market plays a market no episode before it saw, and the same seed replays the same episode on every computer. A market of that name kept already with the same recipe is reused.

Declaration

client.recordings
generatedEpisode(args: { laboratory: string; workbench: string; seed: number; preset?: string; recipe_text?: string }): Promise<any>

Parameters

NameTypeWhat it is
laboratorystringrequiredThe laboratory of generated markets, as a bentrix://lab/... Uri.
workbenchstringrequiredThe workbench the episode's market joins (env_make on it reads the market).
seednumberrequiredThe episode's seed: the same seed is the same market on every computer.
presetstringoptionalA preset by its name (TAPE is the CI tape's shape), the first when neither this nor recipe_text is given.
recipe_textstringoptionalA whole recipe as text.

Returns

Promise<any> — the tool’s answer as a plain object.

What it answers

What the tool's description says.

Example

await client.recordings.generatedEpisode({ laboratory, workbench: "…", seed: 1 })

generatedGenerate#

Generate a market's days now · tool generated_generate

scope: labplan: freesince 2.2.0

Generates and writes a kept generated market's days of a span now (at most 31 days), as a workbench asking for them would: each day not on this computer yet - its ticks, its minutes, its grading - a derived market from its kept legs. Answers the days written; a day held already is not written again.

Declaration

client.recordings
generatedGenerate(args: { laboratory: string; market: string; from: string; to: string }): Promise<any>

Parameters

NameTypeWhat it is
laboratorystringrequiredThe laboratory of generated markets, as a bentrix://lab/... Uri.
marketstringrequiredA kept market, by name.
fromstringrequiredThe first day, YYYY-MM-DD.
tostringrequiredThe last day, at most 31 days after the first.

Returns

Promise<any> — the tool’s answer as a plain object.

What it answers

Answers the days written; a day held already is not written again.

Example

await client.recordings.generatedGenerate({ laboratory, market: "…", from: "…", to: "…" })

generatedMarketCreate#

Make a generated market · tool generated_market_create

scope: labplan: freesince 2.1.0

Makes a market of the laboratory of generated markets from a recipe, as the recipe sheet's Create does: from a preset or a recipe's text, with its name (SYN- and the given word) and seed. The recipe is kept as the market's identity; a name already kept with other settings is refused (a changed recipe is a new market). Its days are generated when a workbench first plays them, the same bytes on every computer. With workbench, the market joins it. Answers the market, its identity and its text.

Declaration

client.recordings
generatedMarketCreate(args: { laboratory: string; name?: string; preset?: string; recipe_text?: string; seed?: number; workbench?: string }): Promise<any>

Parameters

NameTypeWhat it is
laboratorystringrequiredThe laboratory of generated markets, as a bentrix://lab/... Uri.
namestringoptionalThe market's name after SYN-, letters, digits and -.
presetstringoptionalA preset to start from, by its name (generated_recipes); the first when neither this nor recipe_text is given.
recipe_textstringoptionalA whole recipe as text (bentrix-recipe:{...}), as generated_recipes and the sheet's Copy give it.
seednumberoptionalThe seed: the same recipe and seed make the same market on every computer.
workbenchstringoptionalA workbench of it the market is added to.

Returns

Promise<any> — the tool’s answer as a plain object.

What it answers

Recorded from a running Bentrix 0.1.382 on a laboratory of generated markets (long lists cut to their first rows):

{
  "added_to_workbench": true,
  "identity": "205880963a8d5f2c",
  "market": "SYN-DOCS",
  "text": "bentrix-recipe:{\"version\":1,\"seed\":7,\"market\":\"SYN-DOCS\",\"digits\":5,\"start_price\":1.1,\"start_day\":\"2024-01-01\",\"process\":{\"kind\":\"market\",\"volatility\":0.07,\"drift\":0.0,\"mean_reversion\":0.0,\"anchor\":null,\"momentum\":0.0,\"jumps_per_day\":0.0,\"jump_size\":0.0,\"tails\":6,\"clustering_shock\":0.05,\"clustering_…"
}

Example

await client.recordings.generatedMarketCreate({ laboratory })

generatedPreview#

Preview a recipe · tool generated_preview

scope: readplan: freesince 2.2.0

A recipe's first trading days as the generator renders them, kept nowhere: each day's open, high, low and close of the bid, its minutes and its regime, and the hourly closes - the sheet's preview, as numbers. A derived market is previewed through generated_basket_create's legs, not here.

Declaration

client.recordings
generatedPreview(args: { days?: number; preset?: string; recipe_text?: string }): Promise<any>

Parameters

NameTypeWhat it is
daysnumberoptionalTrading days previewed, 1 to 10; 5 when omitted.
presetstringoptionalA preset by its name, the first when neither this nor recipe_text is given.
recipe_textstringoptionalA whole recipe as text.

Returns

Promise<any> — the tool’s answer as a plain object.

What it answers

What the tool's description says.

Example

await client.recordings.generatedPreview()

generatedRecipeRead#

Read a recipe's text · tool generated_recipe_read

scope: readplan: freesince 2.2.0

A recipe's text read into its settings, with its identity (the hash that is the market's) and the generator version it renders under; a text that does not read, or a recipe this build does not render, is refused in words.

Declaration

client.recordings
generatedRecipeRead(args: { text: string }): Promise<any>

Parameters

NameTypeWhat it is
textstringrequiredA recipe's text (bentrix-recipe:{...}).

Returns

Promise<any> — the tool’s answer as a plain object.

What it answers

What the tool's description says.

Example

await client.recordings.generatedRecipeRead({ text: "…" })

generatedRecipeWrite#

Write a recipe as text · tool generated_recipe_write

scope: readplan: freesince 2.2.0

A recipe's settings written as its text (what one person sends another to have the same market) with its identity; settings that do not make a recipe, or that this build does not render, are refused in words.

Declaration

client.recordings
generatedRecipeWrite(args: { recipe: unknown }): Promise<any>

Parameters

NameTypeWhat it is
recipeunknownrequiredA recipe's settings, as generated_recipe_read answers them.

Returns

Promise<any> — the tool’s answer as a plain object.

What it answers

What the tool's description says.

Example

await client.recordings.generatedRecipeWrite({ recipe: "…" })

generatedRecipes#

Read the generated markets' recipes · tool generated_recipes

scope: readplan: freesince 2.1.0

The recipes of the laboratory of generated markets, by market, each as its settings and as its text (what one person sends another to have the same market), with its identity (a hash of the recipe); and the presets a new market starts from, by name.

Declaration

client.recordings
generatedRecipes(args: { laboratory: string }): Promise<any>

Parameters

NameTypeWhat it is
laboratorystringrequiredThe laboratory of generated markets, as a bentrix://lab/... Uri.

Returns

Promise<any> — the tool’s answer as a plain object.

What it answers

Recorded from a running Bentrix 0.1.382 on a laboratory of generated markets (long lists cut to their first rows):

{
  "markets": {},
  "presets": [
    {
      "name": "CALM",
      "text": "bentrix-recipe:{\"version\":1,\"seed\":1,\"market\":\"SYN-CALM\",\"digits\":5,\"start_price\":1.1,\"start_day\":\"2024-01-01\",\"process\":{\"kind\":\"market\",\"volatility\":0.07,\"drift\":0.0,\"mean_reversion\":0.0,\"anchor\":null,\"momentum\":0.0,\"jumps_per_day\":0.0,\"jump_size\":0.0,\"tails\":6,\"clustering_shock\":0.05,\"clustering_…"
    },
    {
      "name": "TREND",
      "text": "bentrix-recipe:{\"version\":1,\"seed\":1,\"market\":\"SYN-TREND\",\"digits\":5,\"start_price\":1.1,\"start_day\":\"2024-01-01\",\"process\":{\"kind\":\"market\",\"volatility\":0.1,\"drift\":0.4,\"mean_reversion\":0.0,\"anchor\":null,\"momentum\":0.15,\"jumps_per_day\":0.0,\"jump_size\":0.0,\"tails\":0,\"clustering_shock\":0.0,\"clustering_…"
    },
    {
      "name": "RANGE",
      "text": "bentrix-recipe:{\"version\":1,\"seed\":1,\"market\":\"SYN-RANGE\",\"digits\":5,\"start_price\":1.1,\"start_day\":\"2024-01-01\",\"process\":{\"kind\":\"market\",\"volatility\":0.09,\"drift\":0.0,\"mean_reversion\":0.35,\"anchor\":null,\"momentum\":-0.2,\"jumps_per_day\":0.0,\"jump_size\":0.0,\"tails\":0,\"clustering_shock\":0.0,\"clusterin…"
    },
    "… 4 more"
  ]
}

Example

await client.recordings.generatedRecipes({ laboratory })

importForget#

Forget an import · tool import_forget

scope: labplan: freesince 2.1.0

Removes one import from a laboratory of the person's own files and rebuilds the days it touched from the imports that remain. Refused while a workbench that has traded stands on data that holds it: move that workbench to other data first.

Declaration

client.recordings
importForget(args: { laboratory: string; batch: string }): Promise<any>

Parameters

NameTypeWhat it is
laboratorystringrequiredA laboratory of the person's own files, as a bentrix://lab/... Uri.
batchstringrequiredThe batch, as import_ledger names it.

Returns

Promise<any> — the tool’s answer as a plain object.

What it answers

What the tool's description says.

Example

await client.recordings.importForget({ laboratory, batch: "…" })

importInspect#

Read a data file before importing it · tool import_inspect

scope: readplan: freesince 2.1.0

Reads a market data file on this computer as the import sheet does, and imports nothing: what it holds (ticks or candles and their length, bid and ask or traded prices or bids alone), rows, the first and last instant in UTC, its header, each column's meaning as read (correctable with mapping), the markets a symbol column names, every fault seen with its count and first line, the first records as written, the market's name read off the file's name, whether the laboratory knows that market already, and whether the file wants a spread said (bids alone, or candles with no spread column). A question only the person can answer (day order, which file of a container) is said with the argument that answers it.

Declaration

client.recordings
importInspect(args: { laboratory: string; path: string; read?: { day_order?: string; file_in_container?: string; mapping?: string[]; offset_hours?: number } }): Promise<any>

Parameters

NameTypeWhat it is
laboratorystringrequiredA laboratory of the person's own files, as a bentrix://lab/... Uri.
pathstringrequiredThe file's path on this computer.
read{ day_order?: string; file_in_container?: string; mapping?: string[]; offset_hours?: number }optionalHow the file is read, beyond the reader's own detection.

Returns

Promise<any> — the tool’s answer as a plain object.

What it answers

What the tool's description says.

Example

await client.recordings.importInspect({ laboratory, path: "…" })

importLedger#

Read a laboratory's imports · tool import_ledger

scope: readplan: freesince 2.1.0

Every import of a laboratory of the person's own files, in the order they were made: its batch, the file with its size and sha256, when, merge or replace, the source's label, the market, ticks or candles and their length, its rows and its UTC days; and each market's facts as kept.

Declaration

client.recordings
importLedger(args: { laboratory: string }): Promise<any>

Parameters

NameTypeWhat it is
laboratorystringrequiredA laboratory of the person's own files, as a bentrix://lab/... Uri.

Returns

Promise<any> — the tool’s answer as a plain object.

What it answers

What the tool's description says.

Example

await client.recordings.importLedger({ laboratory })

importRun#

Import a data file · tool import_run

scope: labplan: freesince 2.1.0

Imports a market data file on this computer into a market of a laboratory of the person's own files, as the import sheet's Import does: a market the laboratory never held is defined from form (or the Forex template at the file's own decimals), with its trading hours, its carry a night and the rates typed for its currencies as the sheet's form takes them (hours, carry_long, carry_short, carry_triple, fixed_rates), the file is written as an immutable batch of the ledger, and the market's days are rebuilt — merge: the newer file wins at every instant (minute, for candles) it covers and older rows stay where it is silent; replace: every day it covers is cleared first. A workbench that has traded keeps the data it traded on and says the data changed (bench_data); one that has not reads the new days. With workbench, the market joins it. Answers the batch and, per day, the instants added, changed, kept and removed, and the minutes modelled from longer candles. A file of bids alone, or candles with no spread column, needs spread_points.

Declaration

client.recordings
importRun(args: { laboratory: string; path: string; carry_long?: number; carry_short?: number; carry_triple?: string; file_symbol?: number; fixed_rates?: Record<string, unknown>; form?: { contract_size: number; currency_base: string; currency_profit: string; digits: number; volume_min: number }; hours?: string; label?: string; market?: string; mode?: string; read?: { day_order?: string; file_in_container?: string; mapping?: string[]; offset_hours?: number }; spread_points?: number; workbench?: string }): Promise<any>

Parameters

NameTypeWhat it is
laboratorystringrequiredA laboratory of the person's own files, as a bentrix://lab/... Uri.
pathstringrequiredThe file's path on this computer.
carry_longnumberoptionalA new market's carry a night for a long position, in points a lot (MetaTrader's swap in points); 0 when omitted.
carry_shortnumberoptionalA new market's carry a night for a short position, in points a lot; 0 when omitted.
carry_triplestringoptionalThe weekday a triple carry is charged on: Mon, Tue, Wed, Thu or Fri; Wed when omitted.
file_symbolnumberoptionalWhich of the file's own markets (its symbol column), by index into import_inspect's symbols.
fixed_ratesRecord<string, unknown>optionalRates typed for a new market's currencies, keyed "FROM/TO" (JPY/USD: 0.0068): used only while the laboratory holds no pair converting FROM into TO.
form{ contract_size: number; currency_base: string; currency_profit: string; digits: number; volume_min: number }optionalA market the laboratory has never held: its facts. The Forex template with the file's own decimals when omitted.
hoursstringoptionalA new market's trading hours in UTC, "HH:MM-HH:MM": a candle longer than a minute has its minutes laid inside them. The whole day when omitted.
labelstringoptionalWhere the file came from, in the ledger; the file's name when omitted.
marketstringoptionalThe market it is imported into; read off the file when omitted.
modestringoptionalMerge (the newer file wins where it has rows; older rows stay where it has none) or replace (every day the file covers is cleared first). Merge when omitted.
read{ day_order?: string; file_in_container?: string; mapping?: string[]; offset_hours?: number }optionalHow the file is read, beyond the reader's own detection.
spread_pointsnumberoptionalThe spread, in points, for a file of bids alone or candles with no spread column.
workbenchstringoptionalA workbench of the laboratory the market is added to when it lands.

Returns

Promise<any> — the tool’s answer as a plain object.

What it answers

Answers the batch and, per day, the instants added, changed, kept and removed, and the minutes modelled from longer candles.

Example

await client.recordings.importRun({ laboratory, path: "…" })

recordingRescan#

Look for the terminals and recordings again · tool recording_rescan

scope: labplan: freesince 1.0.0

Looks again for the MetaTrader terminals and the recordings on this computer and through the drivers, as the Sources sheet's Rescan does. Answers when the look has been asked; its answer arrives on a later frame.

Declaration

client.recordings
recordingRescan(): Promise<any>

It takes no arguments.

Returns

Promise<any> — the tool’s answer as a plain object.

What it answers

Answers when the look has been asked; its answer arrives on a later frame.

Example

await client.recordings.recordingRescan()

Bentrix 0.1.382Every number, name and default on these pages is read from the application itself.What is comingWhat changed