An alert when an output's act becomes buy, a strategy rule that reads an output's field, and the conditions a meaning declares — every one read by arrival.
01In plain words
An output on a chart is something to look at. This page is about making it do something:
- An alert rings, on your screen or as a notification, when an output turns into a buy, a sell, or crosses a line you chose. You do not have to watch the chart.
- A strategy — rules Bentrix runs at every candle's close — reads an output and trades on it in the laboratory, on paper or, if you allow it, on a real account.
- A target lets a strategy hold exactly the position or portfolio a model asks for, buying or selling only the difference each time the model changes its mind.
- A size gate lets one model decide whether to trade and another how much — for example, a second model that says how sure am I that this trade will work?, so that trades it doubts are made smaller or not at all.
Everything here reads an output by its arrival, exactly as the chart does, so a strategy run over history acts on each value no earlier than it could have acted live.
Try every one of these in the laboratory first, where nothing is real money.
02The fields
Each kind of output offers numbers a rule can read. They are called its fields:
Every output gives numbers a rule can read, by kind:
| Kind | Fields |
|---|---|
scalar, rank | value |
classes | p_<outcome> (its probability), top (the winning outcome's place), is_<outcome> (1 or 0) |
quantiles | q05, q50, q95 — a level written as its digits |
position | target_<market> |
weights | w_<market> |
event | score, fired (1 where the score is above your Acts above, else ½) |
levels | the level's name — a price |
action | is_buy, is_sell, is_close_buys, is_close_sells, size |
series | the line's name |
| every kind with a meaning | act (+1 buy, −1 sell, 0 nothing), buy, sell, nothing (1 or 0) |
03A strategy
A strategy's rule reads an output as an operand: output:<model>.<name> for its main number, output:<model>.<name>.<field> for a field at step 1, and <field>_<k> for step k — output:dir_v4.direction.act crosses above 0 is the act became buy. At the last closed candle the rule reads the newest output that had arrived by that candle's close, under your meaning — so a run over history reads exactly what a live one would have read. Change the meaning and the same outputs make different trades, with nothing new put.
04An alert
An alert's condition can read an output's field, compared by any of the alert operators, or one of the conditions its meaning declares:
| Condition | Holds |
|---|---|
output:<model>.<name>.buy / .sell | at the arrival that made the act |
.nothing, .act | while no act stands / while one does |
.above, .below | while the value is beyond your threshold |
.in_<outcome>, .entered_<outcome>, .left_<outcome> | an output of named outcomes |
.fired | an event's score crossing ½ |
An alert on an output is made by your program or an assistant (alert_create) and is kept through the alert editor. It reads only what had arrived by each moment, and it is never watched while Bentrix is closed: a program's outputs stop with the program.
05A target: hold what the model says
A model that answers a position (how much to hold) or weights (each market's share of a portfolio) can drive a strategy directly. The strategy document's target slot names the output, and the run then holds what the model says:
"target": {"from": "output:rl_ppo.position", "max_lots": 2.0, "rebalance": "every_output"}
fromnames the output:output:<model>.<name>, a position or a weights output.max_lotsis what a target of 1 (or a weight of 1) means in lots. The run never holds more than this, long or short. A target of −0.5 withmax_lots2 means 1 lot short.rebalancesays when the run orders:every_output(the default) — once at each new value, never twice for one; orevery_bar— at every close where the holding has drifted from the target.- Only the difference is ordered. Holding 1 lot with a new target of 1.5 lots buys 0.5; a new target of 0.5 lots sells 0.5.
- A strategy with a target has no entry rules of its own: the model decides. Its sessions and daily limits still apply.
The run's trace marks each order it made for the target, so you can follow which value moved it.
06A size gate: one model decides how much
A second model can say how much of each trade the strategy should make. Its output is a number from 0 to 1; give it a meaning that reads Size and gates the strategy. At each entry the strategy multiplies the trade's volume by that number, at that close, by arrival:
- 1 keeps the trade whole, 0.5 halves it;
- a value that makes the trade smaller than the market's smallest volume — or 0, or no value arrived yet — holds the trade back, and the run's trace says gated out.
How the number becomes a size is the meaning's size rule:
| Rule | The size it gives |
|---|---|
| none | the value itself, up to max |
linear | 0 at floor, rising evenly to max at 1 |
stepped | max from floor up, else 0 |
kelly_capped | twice the value minus one, from 0 up to max — a cautious size from a probability of success |
In a meaning, that is {"reads": "size", "gates": "strategy", "size": {"rule": "linear", "floor": 0.5, "max": 1}}, set by a program or an assistant (output_meaning_set). This pattern is often called meta-labelling: one model chooses the side, a second model judges how likely each of its trades is to work.
07A real account
No output places an order. An act reaches a real account only through a strategy you run, under its Automations setting.