Every method of client.laboratory in the C++ SDK.
bench_data#
Keep or move a workbench's data · tool bench_data
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
Json bench_data(const BenchDataArgs &args)Parameters
| Name | Type | What it is | |
|---|---|---|---|
workbench | std::string | required | A laboratory workbench, as a bentrix://bench/... Uri. |
action | std::string | optional | State (the default), keep, move, keep_move or undo. |
Returns
Json — the tool’s answer as a Json value.
What it answers
What the tool's description says.
Example
client.laboratory.bench_data(LaboratoryApi::BenchDataArgs("…"))generated_lab_create#
Make the laboratory of generated markets · tool generated_lab_create
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
Json generated_lab_create()It takes no arguments.
Returns
Json — the tool’s answer as a Json value.
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
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
Json import_lab_create(const ImportLabCreateArgs &args)Parameters
| Name | Type | What it is | |
|---|---|---|---|
label | std::string | required | The laboratory's name, as the person would type it on the Sources sheet. |
Returns
Json — the tool’s answer as a Json value.
What it answers
Answers the laboratory; bench_create makes its workbenches.
Example
client.laboratory.import_lab_create(LaboratoryApi::ImportLabCreateArgs("…"))lab_adopt#
Answer the one-time adoption · tool lab_adopt
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
Json lab_adopt(const LabAdoptArgs &args)Parameters
| Name | Type | What it is | |
|---|---|---|---|
keep_both | bool | required | Keep the two apart rather than move the older one's workbenches into the newer. |
Returns
Json — the tool’s answer as a Json value.
What it answers
What the tool's description says.
Example
client.laboratory.lab_adopt(LaboratoryApi::LabAdoptArgs(true))lab_create#
Make a laboratory · tool lab_create
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
Json lab_create(const LabCreateArgs &args)Parameters
| Name | Type | What it is | |
|---|---|---|---|
currency | std::string | optional | The account's currency: USD, EUR, GBP, JPY or CHF; over the crypto exchange (the crypto exchange) USDT, USDC, EUR or JPY. |
leverage | double | optional | The leverage, 1 to the venue's ceiling (100 is 1:100). |
margin_mode | std::string | optional | Hedging or netting. |
name | std::string | optional | The first workbench's name; a generated one when omitted. |
opening_balance | double | optional | What the workbench's account opens on, in its currency. |
source | std::string | optional | **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_zone | std::string | optional | A time zone's code, as the sheet offers them (UTC by default). |
Returns
Json — the tool’s answer as a Json value.
What it answers
Answers the laboratory and the workbench.
Example
client.laboratory.lab_create(LaboratoryApi::LabCreateArgs())lab_delete#
Ask the person to delete a laboratory · tool lab_delete
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
Job lab_delete(const LabDeleteArgs &args)Parameters
| Name | Type | What it is | |
|---|---|---|---|
lab | std::string | required | The laboratory's uri, as get_state gives it. |
Returns
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 Json value.
What it answers
Answers a job: completed when it is gone, failed when the person kept it.
Example
client.laboratory.lab_delete(LaboratoryApi::LabDeleteArgs("…"))lab_restore_orphan#
Restore, move or remove a laboratory the list does not name · tool lab_restore_orphan
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
Json lab_restore_orphan(const LabRestoreOrphanArgs &args)Parameters
| Name | Type | What it is | |
|---|---|---|---|
orphan | std::string | required | The orphan's uri, as orphans_list gives it. |
action | std::string | required | Restore, move or remove - as its row offers. |
Returns
Json — the tool’s answer as a Json value.
What it answers
What the tool's description says.
Example
client.laboratory.lab_restore_orphan(LaboratoryApi::LabRestoreOrphanArgs("…", "…"))orphans_list#
Read the laboratories the list does not name · tool orphans_list
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
Json orphans_list()It takes no arguments.
Returns
Json — the tool’s answer as a Json value.
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()