Bentrix Docs
HomePricingDashboard

Python: recordings, imports and generated markets

Every method of client.recordings in the Python SDK.

data_quality#

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
def data_quality(self, bench: str, symbol: str) -> Dict[str, Any]

Parameters

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

Returns

Dict[str, Any] — the tool’s answer as a dict of plain values.

What it answers

What the tool's description says.

Example

client.recordings.data_quality(bench, "SYN-DOCS")

download_drop#

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
def download_drop(self, queued: int) -> Dict[str, Any]

Parameters

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

Returns

Dict[str, Any] — the tool’s answer as a dict of plain values.

What it answers

Answers the downloads.

Example

client.recordings.download_drop(1)

download_retry#

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
def download_retry(self, download: int) -> Dict[str, Any]

Parameters

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

Returns

Dict[str, Any] — the tool’s answer as a dict of plain values.

What it answers

Answers the downloads.

Example

client.recordings.download_retry(1)

download_stop#

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
def download_stop(self, download: int) -> Dict[str, Any]

Parameters

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

Returns

Dict[str, Any] — the tool’s answer as a dict of plain values.

What it answers

Answers the downloads.

Example

client.recordings.download_stop(1)

downloads_list#

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
def downloads_list(self) -> Dict[str, Any]

It takes no arguments.

Returns

Dict[str, Any] — the tool’s answer as a dict of plain values.

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

client.recordings.downloads_list()

generated_basket_create#

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
def generated_basket_create(self, laboratory: str, *, basket: Optional[str] = None, factors: Optional[int] = None, group: Optional[str] = None, matrix: Optional[List[List[float]]] = None, members: Optional[List[str]] = None, workbench: Optional[str] = None) -> Dict[str, Any]

Parameters

NameTypeWhat it is
laboratorystrrequiredThe laboratory of generated markets, as a bentrix://lab/... Uri.
basketOptional[str]optionalA basket of the gallery by its name (USD majors, Crypto majors, Two markets).
factorsOptional[int]optionalHow many factors the fit uses, 1 to the members' count; 1 when omitted.
groupOptional[str]optionalThe members' group, a name.
matrixOptional[List[List[float]]]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.
membersOptional[List[str]]optionalOr the members, each a recipe's text; with matrix, fitted to it.
workbenchOptional[str]optionalA workbench of it the markets are added to.

Returns

Dict[str, Any] — the tool’s answer as a dict of plain values.

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

client.recordings.generated_basket_create(laboratory)

generated_correlation#

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
def generated_correlation(self, laboratory: str, markets: List[str], *, days: Optional[int] = None, from_: Optional[str] = None) -> Dict[str, Any]

Parameters

NameTypeWhat it is
laboratorystrrequiredThe laboratory of generated markets, as a bentrix://lab/... Uri.
marketsList[str]requiredThe kept markets, by name.
daysOptional[int]optionalThe days measured, 1 to 31; 5 when omitted.
from_Optional[str]optionalThe first day measured, YYYY-MM-DD; the first market's first day when omitted.

Returns

Dict[str, Any] — the tool’s answer as a dict of plain values.

What it answers

What the tool's description says.

Example

client.recordings.generated_correlation(laboratory, "…")

generated_episode#

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
def generated_episode(self, laboratory: str, workbench: str, seed: int, *, preset: Optional[str] = None, recipe_text: Optional[str] = None) -> Dict[str, Any]

Parameters

NameTypeWhat it is
laboratorystrrequiredThe laboratory of generated markets, as a bentrix://lab/... Uri.
workbenchstrrequiredThe workbench the episode's market joins (env_make on it reads the market).
seedintrequiredThe episode's seed: the same seed is the same market on every computer.
presetOptional[str]optionalA preset by its name (TAPE is the CI tape's shape), the first when neither this nor recipe_text is given.
recipe_textOptional[str]optionalA whole recipe as text.

Returns

Dict[str, Any] — the tool’s answer as a dict of plain values.

What it answers

What the tool's description says.

Example

client.recordings.generated_episode(laboratory, "…", 1)

generated_generate#

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
def generated_generate(self, laboratory: str, market: str, from_: str, to: str) -> Dict[str, Any]

Parameters

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

Returns

Dict[str, Any] — the tool’s answer as a dict of plain values.

What it answers

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

Example

client.recordings.generated_generate(laboratory, "…", "…", "…")

generated_market_create#

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
def generated_market_create(self, laboratory: str, *, name: Optional[str] = None, preset: Optional[str] = None, recipe_text: Optional[str] = None, seed: Optional[int] = None, workbench: Optional[str] = None) -> Dict[str, Any]

Parameters

NameTypeWhat it is
laboratorystrrequiredThe laboratory of generated markets, as a bentrix://lab/... Uri.
nameOptional[str]optionalThe market's name after SYN-, letters, digits and -.
presetOptional[str]optionalA preset to start from, by its name (generated_recipes); the first when neither this nor recipe_text is given.
recipe_textOptional[str]optionalA whole recipe as text (bentrix-recipe:{...}), as generated_recipes and the sheet's Copy give it.
seedOptional[int]optionalThe seed: the same recipe and seed make the same market on every computer.
workbenchOptional[str]optionalA workbench of it the market is added to.

Returns

Dict[str, Any] — the tool’s answer as a dict of plain values.

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

client.recordings.generated_market_create(laboratory)

generated_preview#

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
def generated_preview(self, *, days: Optional[int] = None, preset: Optional[str] = None, recipe_text: Optional[str] = None) -> Dict[str, Any]

Parameters

NameTypeWhat it is
daysOptional[int]optionalTrading days previewed, 1 to 10; 5 when omitted.
presetOptional[str]optionalA preset by its name, the first when neither this nor recipe_text is given.
recipe_textOptional[str]optionalA whole recipe as text.

Returns

Dict[str, Any] — the tool’s answer as a dict of plain values.

What it answers

What the tool's description says.

Example

client.recordings.generated_preview()

generated_recipe_read#

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
def generated_recipe_read(self, text: str) -> Dict[str, Any]

Parameters

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

Returns

Dict[str, Any] — the tool’s answer as a dict of plain values.

What it answers

What the tool's description says.

Example

client.recordings.generated_recipe_read("…")

generated_recipe_write#

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
def generated_recipe_write(self, recipe: Any) -> Dict[str, Any]

Parameters

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

Returns

Dict[str, Any] — the tool’s answer as a dict of plain values.

What it answers

What the tool's description says.

Example

client.recordings.generated_recipe_write("…")

generated_recipes#

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
def generated_recipes(self, laboratory: str) -> Dict[str, Any]

Parameters

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

Returns

Dict[str, Any] — the tool’s answer as a dict of plain values.

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

client.recordings.generated_recipes(laboratory)

import_forget#

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
def import_forget(self, laboratory: str, batch: str) -> Dict[str, Any]

Parameters

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

Returns

Dict[str, Any] — the tool’s answer as a dict of plain values.

What it answers

What the tool's description says.

Example

client.recordings.import_forget(laboratory, "…")

import_inspect#

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
def import_inspect(self, laboratory: str, path: str, *, read: Optional[ReadOptions] = None) -> Dict[str, Any]

Parameters

NameTypeWhat it is
laboratorystrrequiredA laboratory of the person's own files, as a bentrix://lab/... Uri.
pathstrrequiredThe file's path on this computer.
readOptional[ReadOptions]optionalHow the file is read, beyond the reader's own detection.

Returns

Dict[str, Any] — the tool’s answer as a dict of plain values.

What it answers

What the tool's description says.

Example

client.recordings.import_inspect(laboratory, "…")

import_ledger#

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
def import_ledger(self, laboratory: str) -> Dict[str, Any]

Parameters

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

Returns

Dict[str, Any] — the tool’s answer as a dict of plain values.

What it answers

What the tool's description says.

Example

client.recordings.import_ledger(laboratory)

import_run#

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
def import_run(self, laboratory: str, path: str, *, carry_long: Optional[float] = None, carry_short: Optional[float] = None, carry_triple: Optional[str] = None, file_symbol: Optional[int] = None, fixed_rates: Optional[Dict[str, float]] = None, form: Optional[FormArgs] = None, hours: Optional[str] = None, label: Optional[str] = None, market: Optional[str] = None, mode: Optional[str] = None, read: Optional[ReadOptions] = None, spread_points: Optional[int] = None, workbench: Optional[str] = None) -> Dict[str, Any]

Parameters

NameTypeWhat it is
laboratorystrrequiredA laboratory of the person's own files, as a bentrix://lab/... Uri.
pathstrrequiredThe file's path on this computer.
carry_longOptional[float]optionalA new market's carry a night for a long position, in points a lot (MetaTrader's swap in points); 0 when omitted.
carry_shortOptional[float]optionalA new market's carry a night for a short position, in points a lot; 0 when omitted.
carry_tripleOptional[str]optionalThe weekday a triple carry is charged on: Mon, Tue, Wed, Thu or Fri; Wed when omitted.
file_symbolOptional[int]optionalWhich of the file's own markets (its symbol column), by index into import_inspect's symbols.
fixed_ratesOptional[Dict[str, float]]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.
formOptional[FormArgs]optionalA market the laboratory has never held: its facts. The Forex template with the file's own decimals when omitted.
hoursOptional[str]optionalA 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.
labelOptional[str]optionalWhere the file came from, in the ledger; the file's name when omitted.
marketOptional[str]optionalThe market it is imported into; read off the file when omitted.
modeOptional[str]optionalMerge (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.
readOptional[ReadOptions]optionalHow the file is read, beyond the reader's own detection.
spread_pointsOptional[int]optionalThe spread, in points, for a file of bids alone or candles with no spread column.
workbenchOptional[str]optionalA workbench of the laboratory the market is added to when it lands.

Returns

Dict[str, Any] — the tool’s answer as a dict of plain values.

What it answers

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

Example

client.recordings.import_run(laboratory, "…")

recording_rescan#

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
def recording_rescan(self) -> Dict[str, Any]

It takes no arguments.

Returns

Dict[str, Any] — the tool’s answer as a dict of plain values.

What it answers

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

Example

client.recordings.recording_rescan()

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