Bentrix Docs
HomePricingDashboard

R: output

Every method of client$output in the R SDK.

chart_set_output#

Show or hide an output on a chart · tool chart_set_output

scope: labplan: freesince 3.9.0

Shows or hides one model's output on one chart, as its legend row's eye does - a hidden one keeps its row, dim - and turns the chart's Zones on or off (each output pane shaded beyond its thresholds). A field not named keeps its value. Answers the chart's hidden outputs and its Zones.

Declaration

client$output
chart_set_output(chart, model, output, shown = NULL, zones = NULL)

Parameters

NameTypeWhat it is
chartanyrequiredThe chart's uri.
modelanyrequired
outputanyrequired
shownanyoptionalDraw this output on this chart (the legend's eye).
zonesanyoptionalThe chart's Zones: every output pane shaded above its upper threshold and below its lower one.

Returns

list — the tool’s answer as a list.

What it answers

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

{
  "chart": "bentrix://lab/lab-1/bench/bench-2/chart/chart-5",
  "hidden": [
    "docs_model.direction"
  ],
  "zones": false
}

Example

client$output$chart_set_output(chart, "docs_model", "direction")

actual_put#

Hand over what an output's values came to · tool output_actual_put

scope: labplan: freesince 3.10.0

Paired with the output's value of the same anchor in output_report; a later put of the same anchor replaces it. Refused by name: an anchor past the workbench's clock (it is the future), a document carrying two realised things in one row or none, names not [a-z0-9_]{1,32}.

Declaration

client$output
actual_put(bench, actuals)

Parameters

NameTypeWhat it is
benchanyrequiredThe workbench's uri.
actualsanyrequiredThe output_actuals document: schema_version 1, model, output, symbol, and actuals [{anchor_ms, value | label | event}] - one realised thing each.

Returns

list — the tool’s answer as a list.

What it answers

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

{
  "bench": "bentrix://lab/lab-1/bench/bench-2",
  "model": "docs_model",
  "output": "breakout",
  "symbol": "SYN-DOCS",
  "taken": 1
}

Example

client$output$actual_put(bench, "…")

clear#

Remove outputs from a workbench · tool output_clear

scope: labplan: plussince 3.9.0

Removes the outputs of one market, model or output name, or all of them, from the workbench, every arrival kept for them included, as the x on an output's legend row does. The person's meanings stay. A path output is removed by forecast_clear. Answers how many arrivals went.

Declaration

client$output
clear(bench, model = NULL, output = NULL, symbol = NULL)

Parameters

NameTypeWhat it is
benchanyrequiredThe workbench's uri.
modelanyoptionalOne model; omitted, every model.
outputanyoptionalOne output; omitted, every output.
symbolanyoptionalOne market; omitted, every market.

Returns

list — the tool’s answer as a list.

What it answers

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

{
  "cleared": 1
}

Example

client$output$clear(bench)

compare#

Set outputs' reports side by side · tool output_compare

scope: readplan: freesince 3.10.0

Output_report for several outputs on one market, a row each, over the same bars and actuals, by name - never ranked: a comparison is the laboratory's instrument and nothing here is published or ordered by a measure. An output that cannot be reported says why in its row.

Declaration

client$output
compare(bench, symbol, interval = NULL, outputs = NULL)

Parameters

NameTypeWhat it is
benchanyrequiredThe workbench's uri.
symbolanyrequired
intervalanyoptional
outputsanyoptionalThe outputs to compare, each "model.output"; omitted, every output the bench holds on the market.

Returns

list — the tool’s answer as a list.

What it answers

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

{
  "bench": "bentrix://lab/lab-1/bench/bench-2",
  "ordered": "by name",
  "rows": [
    {
      "at_ms": 1791176400000,
      "interval": "H1",
      "kind": "event",
      "meaning": null,
      "model": "docs_model",
      "output": "breakout",
      "reads": "each value scored only against a bar that had not closed when it arrived",
      "result": {
        "as": "an event's score against the supplied events",
        "counts": {
          "late": 0,
          "outputs": 1,
          "pending": 0,
          "scored": 1,
          "unrealised": 0
        },
        "measures": {
          "at_threshold": {
            "accuracy": 1.0,
            "f1": 1.0,
            "fn": 0,
            "fp": 0,
            "matthews": null,
            "precision": 1.0,
            "recall": 1.0,
            "tn": 0,
            "tp": 1
          },
          "auc": null,
          "brier": 0.03999999999999998,
          "calibration": [
            {
              "came_true": 1.0,
              "count": 1,
              "mean_p": 0.8
            }
          ],
          "log_loss": 0.2231435513142097,
          "threshold": 0.5
        }
      },
      "symbol": "SYN-DOCS"
    },
    {
      "at_ms": 1791176400000,
      "interval": "H1",
      "kind": "scalar",
      "meaning": {
        "act_above": 0.55,
        "act_below": 0.45,
        "classes": {},
        "gates": null,
        "high_means": "buy",
        "hysteresis": 0.0,
        "labels": {},
        "low_means": "sell",
        "reads": "direction",
        "schema_version": 1,
        "size": null,
        "step": 1
      },
      "model": "docs_model",
      "output": "direction",
      "reads": "each value scored only against a bar that had not closed when it arrived",
      "result": {
        "as": "probability",
        "counts": {
          "late": 0,
          "outputs": 7,
          "pending": 1,
          "scored": 6,
          "unrealised": 0
        },
        "event": "a rise over the step",
        "measures": {
          "at_threshold": {
            "accuracy": 0.3333333333333333,
            "f1": 0.3333333333333333,
            "fn": 1,
            "fp": 3,
            "matthews": -0.25,
            "precision": 0.25,
            "recall": 0.5,
            "tn": 1,
            "tp": 1
          },
          "auc": 0.5,
          "brier": 0.29996666666666666,
          "calibration": [
            {
              "came_true": 1.0,
              "count": 1,
              "mean_p": 0.38
            },
            {
              "came_true": 0.0,
              "count": 1,
              "mean_p": 0.41
            },
            {
              "came_true": 0.0,
              "count": 1,
              "mean_p": 0.57
            },
            "… 1 more"
          ],
          "log_loss": 0.795207167847371,
          "threshold": 0.55
        }
      },
      "symbol": "SYN-DOCS"
    },
    {
      "at_ms": 1791176400000,
      "interval": "H1",
      "kind": "levels",
      "meaning": null,
      "model": "docs_model",
      "output": "levels",
      "reads": "each value scored only against a bar that had not closed when it arrived",
      "result": {
        "as": "levels' first barrier, from the bars' highs and lows",
        "counts": {
          "decided": 1,
          "not_yet": 0,
          "outputs": 1,
          "scored": 1
        },
        "measures": {
          "hit_before_stop": 1.0
        }
      },
      "symbol": "SYN-DOCS"
    },
    "… 1 more"
  ],
  "symbol": "SYN-DOCS"
}

Example

client$output$compare(bench, "SYN-DOCS")

get#

Read the outputs on a workbench · tool output_get

scope: readplan: freesince 3.9.0

Answers the outputs a reader at at_ms (the workbench's clock when omitted) sees on the workbench, by arrival - never one that arrived after that instant, whatever its anchor - each with its model, output, market, kind, epoch, anchor, put_ms, values, range, who put it, and the meaning in force (the person's, else the model's suggestion). Arrivals lists every arrival kept per output. A path output is read by forecast_get.

Declaration

client$output
get(bench, at_ms = NULL, model = NULL, output = NULL, symbol = NULL)

Parameters

NameTypeWhat it is
benchanyrequiredThe workbench's uri.
at_msanyoptionalThe instant to read at, UTC ms: what a reader at that instant saw. Omitted, the workbench's clock.
modelanyoptionalOne model; omitted, every model.
outputanyoptionalOne output of the model; omitted, every output.
symbolanyoptionalOne market; omitted, every market.

Returns

list — the tool’s answer as a list.

What it answers

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

{
  "arrivals": [
    {
      "model": "docs_model",
      "output": "direction",
      "put_ms": [
        1791154859967,
        1791158400000,
        1791162000000,
        1791165600000,
        1791169200000,
        1791172800000,
        1791176400000
      ],
      "symbol": "SYN-DOCS"
    }
  ],
  "at_ms": 1791176400000,
  "bench": "bentrix://lab/lab-1/bench/bench-2",
  "outputs": [
    {
      "anchor_ms": 1791172800000,
      "author": "agent:1",
      "by": "Agent 1",
      "epoch": 0,
      "held_until_replaced": false,
      "kind": "scalar",
      "meaning": {
        "act_above": 0.55,
        "act_below": 0.45,
        "classes": {},
        "gates": null,
        "high_means": "buy",
        "hysteresis": 0.0,
        "labels": {},
        "low_means": "sell",
        "reads": "direction",
        "schema_version": 1,
        "size": null,
        "step": 1
      },
      "meaning_is": "the_persons",
      "model": "docs_model",
      "note": null,
      "output": "direction",
      "put_ms": 1791176400000,
      "range": [
        0.0,
        1.0
      ],
      "symbol": "SYN-DOCS",
      "units": "probability",
      "values": [
        {
          "value": 0.52
        }
      ]
    }
  ]
}

Example

client$output$get(bench)

meaning_get#

Read what an output means on a workbench · tool output_meaning_get

scope: readplan: freesince 3.9.0

Answers the person's meaning of one model's output on one workbench and who set it (null where nobody has), the meaning the model suggests with its newest arrival, and the one in force: the person's, else the suggestion.

Declaration

client$output
meaning_get(bench, model, output)

Parameters

NameTypeWhat it is
benchanyrequiredThe workbench's uri.
modelanyrequired
outputanyrequired

Returns

list — the tool’s answer as a list.

What it answers

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

{
  "by": "Agent 1",
  "default": null,
  "in_force": {
    "act_above": 0.55,
    "act_below": 0.45,
    "classes": {},
    "gates": null,
    "high_means": "buy",
    "hysteresis": 0.0,
    "labels": {},
    "low_means": "sell",
    "reads": "direction",
    "schema_version": 1,
    "size": null,
    "step": 1
  },
  "meaning": {
    "act_above": 0.55,
    "act_below": 0.45,
    "classes": {},
    "gates": null,
    "high_means": "buy",
    "hysteresis": 0.0,
    "labels": {},
    "low_means": "sell",
    "reads": "direction",
    "schema_version": 1,
    "size": null,
    "step": 1
  },
  "model": "docs_model",
  "output": "direction",
  "set_by": "agent:1",
  "suggested": {
    "act_above": 0.6,
    "act_below": 0.4,
    "classes": {},
    "gates": null,
    "high_means": "buy",
    "hysteresis": 0.0,
    "labels": {},
    "low_means": "sell",
    "reads": "direction",
    "schema_version": 1,
    "size": null,
    "step": 1
  }
}

Example

client$output$meaning_get(bench, "docs_model", "direction")

meaning_set#

Set what an output means on a workbench · tool output_meaning_set

scope: labplan: plussince 3.9.0

The meaning is the person's setting and never touches the model's file; an agent's is marked with its pairing, which the person sees. Only on a workbench this agent writes on: a laboratory's with lab, a paper bench's with paper; a real account's meaning is the person's alone. Refused until an output of that name has arrived on the workbench. Answers the meaning and who set it.

Declaration

client$output
meaning_set(bench, model, output, meaning)

Parameters

NameTypeWhat it is
benchanyrequiredThe workbench's uri.
modelanyrequired
outputanyrequired
meaninganyrequiredThe meaning, as output_meaning describes it.

Returns

list — the tool’s answer as a list.

What it answers

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

{
  "by": "Agent 1",
  "meaning": {
    "act_above": 0.55,
    "act_below": 0.45,
    "classes": {},
    "gates": null,
    "high_means": "buy",
    "hysteresis": 0.0,
    "labels": {},
    "low_means": "sell",
    "reads": "direction",
    "schema_version": 1,
    "size": null,
    "step": 1
  },
  "model": "docs_model",
  "output": "direction",
  "set_by": "agent:1"
}

Example

client$output$meaning_set(bench, "docs_model", "direction", "…")

put#

Put a model's output on a workbench · tool output_put

scope: labplan: plussince 3.9.0

Hands over an output_spec of any kind: read by every chart, alert and tool from the instant it arrives, which Bentrix stamps as put_ms on the workbench's own clock - never from its anchor, so a late output is read late. A path output is today's forecast and lands through the forecast's own door (forecast_put's answer). Refused by name where it cannot be true: a value outside its declared range, an anchor past the workbench's clock, a market the workbench does not hold, a document naming its own arrival, an epoch lower than the one standing. Answers the arrival, the replaced epoch and each chart of the market with whether it draws it.

Declaration

client$output
put(bench, output)

Parameters

NameTypeWhat it is
benchanyrequiredThe workbench's uri.
outputanyrequiredThe output, as output_spec describes it.

Returns

list — the tool’s answer as a list.

What it answers

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

{
  "anchor_ms": 1791151200000,
  "author": "agent:1",
  "by": "Agent 1",
  "charts": [
    {
      "chart": "bentrix://lab/lab-1/bench/bench-2/chart/chart-5",
      "drawn": true
    }
  ],
  "epoch": 0,
  "held_until_replaced": false,
  "kind": "scalar",
  "meaning": {
    "act_above": 0.6,
    "act_below": 0.4,
    "classes": {},
    "gates": null,
    "high_means": "buy",
    "hysteresis": 0.0,
    "labels": {},
    "low_means": "sell",
    "reads": "direction",
    "schema_version": 1,
    "size": null,
    "step": 1
  },
  "meaning_is": "suggested",
  "model": "docs_model",
  "note": null,
  "output": "direction",
  "put_ms": 1791154859967,
  "range": [
    0.0,
    1.0
  ],
  "replaced_epoch": null,
  "symbol": "SYN-DOCS",
  "units": "probability",
  "uri": "bentrix://lab/lab-1/bench/bench-2/outputs",
  "values": [
    {
      "value": 0.68
    }
  ]
}

Example

client$output$put(bench, "…")

put_many#

Put several outputs at once · tool output_put_many

scope: labplan: plussince 3.9.0

Hands over up to 256 output_specs to one workbench in one call, every one arriving at the same instant of its clock: several markets, models and outputs of any kinds. Each refused one is named by its index with why; all_or_nothing lands none when one is refused. Answers put (each landed output as output_put answers it) and refused [{index, why}].

Declaration

client$output
put_many(bench, outputs, all_or_nothing = NULL)

Parameters

NameTypeWhat it is
benchanyrequiredThe workbench's uri.
outputsanyrequiredThe outputs, each an output_spec: several markets, models and outputs, at most 256.
all_or_nothinganyoptionalTrue lands none when one is refused; false (the default) lands every one that can be, and names the rest.

Returns

list — the tool’s answer as a list.

What it answers

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

{
  "put": [
    {
      "anchor_ms": 1791151200000,
      "author": "agent:1",
      "by": "Agent 1",
      "charts": [
        {
          "chart": "bentrix://lab/lab-1/bench/bench-2/chart/chart-5",
          "drawn": true
        }
      ],
      "epoch": 0,
      "held_until_replaced": true,
      "kind": "classes",
      "meaning": null,
      "meaning_is": "none",
      "model": "docs_model",
      "note": null,
      "output": "regime",
      "put_ms": 1791154859967,
      "range": null,
      "replaced_epoch": null,
      "symbol": "SYN-DOCS",
      "units": null,
      "uri": "bentrix://lab/lab-1/bench/bench-2/outputs",
      "values": [
        {
          "p": {
            "range": 0.3,
            "trend": 0.7
          }
        }
      ]
    },
    {
      "anchor_ms": 1791151200000,
      "author": "agent:1",
      "by": "Agent 1",
      "charts": [
        {
          "chart": "bentrix://lab/lab-1/bench/bench-2/chart/chart-5",
          "drawn": false
        }
      ],
      "epoch": 0,
      "held_until_replaced": false,
      "kind": "levels",
      "meaning": null,
      "meaning_is": "none",
      "model": "docs_model",
      "note": null,
      "output": "levels",
      "put_ms": 1791154859967,
      "range": null,
      "replaced_epoch": null,
      "symbol": "SYN-DOCS",
      "units": null,
      "uri": "bentrix://lab/lab-1/bench/bench-2/outputs",
      "values": [
        {
          "levels": {
            "stop": 0.98030385,
            "target": 0.99015615
          }
        }
      ]
    },
    {
      "anchor_ms": 1791151200000,
      "author": "agent:1",
      "by": "Agent 1",
      "charts": [
        {
          "chart": "bentrix://lab/lab-1/bench/bench-2/chart/chart-5",
          "drawn": true
        }
      ],
      "epoch": 0,
      "held_until_replaced": false,
      "kind": "event",
      "meaning": null,
      "meaning_is": "none",
      "model": "docs_model",
      "note": null,
      "output": "breakout",
      "put_ms": 1791154859967,
      "range": null,
      "replaced_epoch": null,
      "symbol": "SYN-DOCS",
      "units": null,
      "uri": "bentrix://lab/lab-1/bench/bench-2/outputs",
      "values": [
        {
          "score": 0.8,
          "within_steps": 3
        }
      ]
    }
  ],
  "refused": []
}

Example

client$output$put_many(bench, "…")

report#

Report how a model's output did · tool output_report

scope: readplan: freesince 3.10.0

Scores one output of one model on one market by its kind's own measures, against the workbench's bars up to its clock and the actuals handed over with output_actual_put - each value only against a bar that had not closed when it arrived (late values are counted, never scored; pending ones wait). A probability (a scalar read as a direction, or units probability): AUC, Brier, log-loss, a ten-bin calibration curve and the confusion at the meaning's act_above (0.5 without one), the event being the move over the step in the meaning's high direction. Another number: MAE, RMSE, mean signed error, Pearson and Spearman against the move over the step. Quantiles: pinball and coverage per level against the step's close. Event: AUC, Brier, log-loss and the confusion at tau against the supplied events. Levels: the share of trades whose target was met before the stop, read from the bars' highs and lows. Rank: the per-date IC against the supplied target and, apart and labelled raw, against the move over the horizon. Position, weights and action are measured in money only by a laboratory strategy run under the meaning; text is never evaluated. Nothing here is published or ranked anywhere else.

Declaration

client$output
report(bench, symbol, model, output, interval = NULL, line = NULL, since_ms = NULL)

Parameters

NameTypeWhat it is
benchanyrequiredThe workbench's uri.
symbolanyrequired
modelanyrequired
outputanyrequired
intervalanyoptionalThe interval the output's steps are bars of, where its horizon does not name one (M1, H1, D1...).
lineanyoptionalA series output: the line scored against the realised values supplied.
since_msanyoptionalOnly outputs that arrived at or after this instant, UTC ms.

Returns

list — the tool’s answer as a list.

What it answers

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

{
  "at_ms": 1791176400000,
  "interval": "H1",
  "kind": "scalar",
  "meaning": {
    "act_above": 0.55,
    "act_below": 0.45,
    "classes": {},
    "gates": null,
    "high_means": "buy",
    "hysteresis": 0.0,
    "labels": {},
    "low_means": "sell",
    "reads": "direction",
    "schema_version": 1,
    "size": null,
    "step": 1
  },
  "model": "docs_model",
  "output": "direction",
  "reads": "each value scored only against a bar that had not closed when it arrived",
  "result": {
    "as": "probability",
    "counts": {
      "late": 0,
      "outputs": 7,
      "pending": 1,
      "scored": 6,
      "unrealised": 0
    },
    "event": "a rise over the step",
    "measures": {
      "at_threshold": {
        "accuracy": 0.3333333333333333,
        "f1": 0.3333333333333333,
        "fn": 1,
        "fp": 3,
        "matthews": -0.25,
        "precision": 0.25,
        "recall": 0.5,
        "tn": 1,
        "tp": 1
      },
      "auc": 0.5,
      "brier": 0.29996666666666666,
      "calibration": [
        {
          "came_true": 1.0,
          "count": 1,
          "mean_p": 0.38
        },
        {
          "came_true": 0.0,
          "count": 1,
          "mean_p": 0.41
        },
        {
          "came_true": 0.0,
          "count": 1,
          "mean_p": 0.57
        },
        "… 1 more"
      ],
      "log_loss": 0.795207167847371,
      "threshold": 0.55
    }
  },
  "symbol": "SYN-DOCS"
}

Example

client$output$report(bench, "SYN-DOCS", "docs_model", "direction")

outputs_state#

A workbench's outputs and their meanings · tool outputs_state

scope: readplan: freesince 3.9.0

Every output the workbench holds, by market, model and output: its kind, how many arrivals are kept, the newest one's put_ms at the workbench's clock (null before the first arrived), the person's meaning and who set it, the model's suggested meaning, and whether a chart of this release draws its kind.

Declaration

client$output
outputs_state(bench)

Parameters

NameTypeWhat it is
benchanyrequiredThe workbench's uri.

Returns

list — the tool’s answer as a list.

What it answers

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

{
  "at_ms": 1791176400000,
  "bench": "bentrix://lab/lab-1/bench/bench-2",
  "outputs": [
    {
      "arrivals": 1,
      "drawn": true,
      "kind": "event",
      "meaning": null,
      "meaning_set_by": null,
      "model": "docs_model",
      "output": "breakout",
      "standing_put_ms": 1791154859967,
      "suggested_meaning": null,
      "symbol": "SYN-DOCS"
    },
    {
      "arrivals": 7,
      "drawn": true,
      "kind": "scalar",
      "meaning": {
        "act_above": 0.55,
        "act_below": 0.45,
        "classes": {},
        "gates": null,
        "high_means": "buy",
        "hysteresis": 0.0,
        "labels": {},
        "low_means": "sell",
        "reads": "direction",
        "schema_version": 1,
        "size": null,
        "step": 1
      },
      "meaning_set_by": {
        "author": "agent:1",
        "by": "Agent 1"
      },
      "model": "docs_model",
      "output": "direction",
      "standing_put_ms": 1791176400000,
      "suggested_meaning": null,
      "symbol": "SYN-DOCS"
    },
    {
      "arrivals": 1,
      "drawn": false,
      "kind": "levels",
      "meaning": null,
      "meaning_set_by": null,
      "model": "docs_model",
      "output": "levels",
      "standing_put_ms": 1791154859967,
      "suggested_meaning": null,
      "symbol": "SYN-DOCS"
    },
    "… 1 more"
  ]
}

Example

client$output$outputs_state(bench)

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