From your own program in any of the SDK's nine languages, from a Python model Bentrix runs, or from a model file — the output document, and how it lands.
01From your program
Build the output document and put it with output_put (or several at one instant with output_put_many). Bentrix checks it, stamps its arrival on the workbench's clock, draws it and keeps it. Your program never names the arrival.
import bentrix
spec = bentrix.Output.scalar("dir_v4", "EURUSD", anchor_ms, value=0.73, range=(0, 1), units="probability", output="direction")
door.call("output_put", bench=bench, output=spec)
door.call("output_meaning_set", bench=bench, model="dir_v4", output="direction",
meaning={"reads": "direction", "high_means": "buy", "low_means": "sell", "act_above": 0.6, "act_below": 0.4})
The anchor is the open of the last closed bar the output is made at. Every builder checks the document as Bentrix does — a value outside its declared range is refused in words before anything is sent.
02The same in every language
| Language | Builders | Put |
|---|---|---|
| Python | bentrix.Output.scalar(...) … .series(...) | door.call("output_put", ...) |
| JavaScript | output.Output.scalar(...) | .put(client, bench), output.putOutputs(...) |
| Go | mcp.Scalar(...) | .Put(ctx, client, bench), mcp.PutOutputs(...) |
| Rust | output::Output::scalar(...) | .put(&client, bench), output::put_outputs(...) |
| Java | Output.scalar(...) | .put(client::call, bench), Output.putOutputs(...) |
| C# | Output.Scalar(...) | .Put(caller, bench), Output.PutOutputs(...) |
| C++ | bentrix::mcp::output::Output::scalar(...) | .put(client, bench), put_outputs(...) |
| Julia | output_scalar(...) | output_put(client, o, bench), output_put_many(...) |
| R | bx_output_scalar(...) | $put(client, bench), bx_output_put_many(...) |
Each also sets a meaning (set_meaning, SetMeaning, output_meaning_set, bx_output_meaning_set).
03From a Python model Bentrix runs
A model in your models folder declares its outputs and answers a dict by name:
import bentrix
from bentrix.model import Output
@bentrix.model(name="dir_v4", interval="H1", lookback=64,
outputs=[Output.declare("direction", "scalar", range=(0, 1), units="probability"),
Output.declare("regime", "classes", names=["trend", "range"], exclusive=True, persistent=True)])
def predict(window):
...
return {"direction": 0.73, "regime": {"trend": 0.7, "range": 0.3}}
At each close of its interval Bentrix puts each output as it comes back, stamped at its arrival.
04From a model file
A model file's manifest lists its outputs — each a name, a kind, the fields the kind needs, and for each where in the model's answer its values are (slice, from and to). A manifest of the earlier form, with one forecast of steps, is read as one path output, unchanged.
05Reading and clearing
output_get answers what a reader at a moment saw — never an output that arrived after it; outputs_state the workbench's outputs; output_clear removes them; chart_set_output shows or hides one on a chart.