Bentrix Docs
HomePricingDashboard

Julia: laboratories

Every method of client.laboratory in the Julia SDK.

bench_data#

Keep or move a workbench's data · tool bench_data

scope: labplan: freesince 2.1.0

A workbench of a laboratory of the person's own files whose data a later import rewrote, as its card does: state says which imports changed its data and on how many days; keep keeps its data and puts the card away; move rebuilds it from its record over the new data and says what changed (deals filled at another price, deals no longer made, the balance before and after); keep_move keeps the move; undo puts the workbench back on its own data.

Declaration

client.laboratory
bench_data(workbench; action = nothing)

Parameters

NameTypeWhat it is
workbenchanyrequiredA laboratory workbench, as a bentrix://bench/... Uri.
actionanyoptionalState (the default), keep, move, keep_move or undo.

Returns

Dict{String,Any} — the tool’s answer as a Dict.

What it answers

What the tool's description says.

Example

client.laboratory.bench_data("…")

generated_lab_create#

Make the laboratory of generated markets · tool generated_lab_create

scope: labplan: freesince 2.1.0

Makes the one laboratory of markets made from a recipe and a seed, as the Sources sheet's Generated markets card does, or answers it where it exists already: there is one, so a program run twice, or after another, finds it here. Answers the laboratory and made (false when it was there).

Declaration

client.laboratory
generated_lab_create()

It takes no arguments.

Returns

Dict{String,Any} — the tool’s answer as a Dict.

What it answers

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

{
  "laboratory": "bentrix://lab/lab-1",
  "made": true
}

Example

client.laboratory.generated_lab_create()

import_lab_create#

Make a laboratory of the person's own files · tool import_lab_create

scope: labplan: freesince 2.1.0

Makes a laboratory of the person's own market data files under a name, as the Sources sheet's card of the person's own files does: empty until a file is imported into it (import_run). There may be many. Answers the laboratory; bench_create makes its workbenches.

Declaration

client.laboratory
import_lab_create(label)

Parameters

NameTypeWhat it is
labelanyrequiredThe laboratory's name, as the person would type it on the Sources sheet.

Returns

Dict{String,Any} — the tool’s answer as a Dict.

What it answers

Answers the laboratory; bench_create makes its workbenches.

Example

client.laboratory.import_lab_create("…")

lab_adopt#

Answer the one-time adoption · tool lab_adopt

scope: adminplan: freesince 1.0.0

When Bentrix offers once to move an older laboratory's workbenches into the laboratory of the same history, answers it as the offer's own buttons do: keep_both keeps them apart, else they move. Refused when nothing is offered.

Declaration

client.laboratory
lab_adopt(keep_both)

Parameters

NameTypeWhat it is
keep_bothanyrequiredKeep the two apart rather than move the older one's workbenches into the newer.

Returns

Dict{String,Any} — the tool’s answer as a Dict.

What it answers

What the tool's description says.

Example

client.laboratory.lab_adopt(true)

lab_create#

Make a laboratory · tool lab_create

scope: labplan: freesince 1.0.0

Makes a laboratory over a data source this edition carries (source, a token from bentrix://sources; the first when omitted) and its first, empty workbench, as the New laboratory sheet's Create does: the account's currency (USD, EUR, GBP, JPY, CHF; over the crypto exchange USDT, USDC, EUR, JPY), opening balance, leverage, hedging or netting and time zone are fixed at birth. Its markets come from Market Watch and its days from the Replay widget. Answers the laboratory and the workbench.

Declaration

client.laboratory
lab_create(; currency = nothing, leverage = nothing, margin_mode = nothing, name = nothing, opening_balance = nothing, source = nothing, time_zone = nothing)

Parameters

NameTypeWhat it is
currencyanyoptionalThe account's currency: USD, EUR, GBP, JPY or CHF; over the crypto exchange (the crypto exchange) USDT, USDC, EUR or JPY.
leverageanyoptionalThe leverage, 1 to the venue's ceiling (100 is 1:100).
margin_modeanyoptionalHedging or netting.
nameanyoptionalThe first workbench's name; a generated one when omitted.
opening_balanceanyoptionalWhat the workbench's account opens on, in its currency.
sourceanyoptional**The recording the laboratory is over**by its token — one of the sources this edition carries (bentrix://sources); the first of them when omitted. A source this edition does not carry is refused: its laboratory found on disk replays, and no new one is made.
time_zoneanyoptionalA time zone's code, as the sheet offers them (UTC by default).

Returns

Dict{String,Any} — the tool’s answer as a Dict.

What it answers

Answers the laboratory and the workbench.

Example

client.laboratory.lab_create()

lab_delete#

Ask the person to delete a laboratory · tool lab_delete

scope: adminplan: freesince 1.0.0long work: answers a job

Opens Bentrix's own delete sheet for a laboratory, the one that names what goes - its recording's data - and what stays; the person deletes it or keeps it. Answers a job: completed when it is gone, failed when the person kept it.

Declaration

client.laboratory
lab_delete(lab)

Parameters

NameTypeWhat it is
labanyrequiredThe laboratory's uri, as get_state gives it.

Returns

A job — job.wait() answers the result: this is long work, or work the person allows first, so the call answers at once with a job and its result comes when it ends, as a Dict.

What it answers

Answers a job: completed when it is gone, failed when the person kept it.

Example

client.laboratory.lab_delete("…")

lab_restore_orphan#

Restore, move or remove a laboratory the list does not name · tool lab_restore_orphan

scope: adminplan: freesince 1.0.0

Restore puts an orphan whose recording has no laboratory back on the list, as its row's restore does, at once. Move (its workbenches into the laboratory its recording already has) and remove (its workbenches lost) ask the person on its row; answers a job for those.

Declaration

client.laboratory
lab_restore_orphan(orphan, action)

Parameters

NameTypeWhat it is
orphananyrequiredThe orphan's uri, as orphans_list gives it.
actionanyrequiredRestore, move or remove - as its row offers.

Returns

Dict{String,Any} — the tool’s answer as a Dict.

What it answers

What the tool's description says.

Example

client.laboratory.lab_restore_orphan("…", "…")

orphans_list#

Read the laboratories the list does not name · tool orphans_list

scope: readplan: freesince 1.0.0

Answers each laboratory on disk that the workspace's list does not name - its uri, how many of its workbenches read, its own words when it does not read, the laboratory its recording already has and what can be done with it (restore, or move and remove) - and whether a one-time adoption is offered.

Declaration

client.laboratory
orphans_list()

It takes no arguments.

Returns

Dict{String,Any} — the tool’s answer as a Dict.

What it answers

Answers each laboratory on disk that the workspace's list does not name - its uri, how many of its workbenches read, its own words when it does not read, the laboratory its recording already has and what can be done with it (restore, or move and remove) - and whether a one-time adoption is offered.

Example

client.laboratory.orphans_list()

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