One list for a team building its own trading agent — what Bentrix does for you today, what you build yourself on top of it, and what this version does not do — with the page that shows each.
A team that builds its own agent — its own observations, actions, rewards, position logic and risk rules — wants a platform that does three things well and stays out of the rest: replay the market, execute the orders, keep the account. This page is the whole list of what Bentrix gives such a team in this version, what remains yours, and what is not there.
01In one paragraph
Your agent talks to an environment you write. That environment calls Bentrix's engine for candles, ticks, orders and the account — in your own Python process, with no window — and returns to your agent whatever observation and reward you designed. No ready-made environment, action space or reward is required. Orders are filled by a venue that works on bid and ask, tick by tick, with commission, swap, margin, stops rules and stop-out; the clock cannot be read past; equal inputs give equal results.
your agent → your environment class → Bentrix's engine → replay clock + venue + account
(observation, reward) (candles, ticks, orders, book, deals)
02What Bentrix does
An environment of your own
You can
Page
Write a Gymnasium environment without the ready-made one: your spaces, state, reward, episodes, termination
Hold several positions of one market at once, each with its own ticket, entry, stop, target and profit — long and short together (a hedging account); or one net position per market (a netting account)
Bentrix gives you the facts; these are your design, computed in your own code from the book, the deals and the account:
The observation and the features — from candles, ticks, indicators, or your own sources.
The action space and how an action becomes orders.
The reward — any function of equity, drawdown, exposure, costs, holding time or anything else you can compute.
A logical session: a group of positions you treat as one. Keep the tickets; sum the deals.
Risk rules: limits on exposure, loss or margin, checked in your own code before an order is sent.
Risk and performance statistics: drawdown, expected shortfall, Sharpe, Sortino, Calmar and the rest, from the equity you record at each step and the deal list.
Train, validation and test periods: separate, non-overlapping date ranges that your environment draws its episode starts from — the one in an environment of your own draws its start from one range. An episode can never read past its own clock, so a training episode cannot see a test period that lies after it; keep the ranges apart and leave a gap between them as long as your longest observation window.
Your environment's own state beside a snapshot: counters, memory, random generators.
04What this version does not do
Said plainly, so that nobody builds on something that is not there:
Not there
What happens instead
Partial fills, several fills of one order
An order fills whole, at one price.
A chance that an order is not filled or is rejected at random
An order is refused only for a reason: volume, stops, margin, a closed market.
A limit on order size from the market's volume, and market impact on the fill price
Size is limited by the contract's maximum and by margin. The ready-made environment can charge the reward for size against a candle's volume (participation, impact); the fill itself is unchanged.
An expiry time on a pending order
It rests until it is met or cancelled. Cancel it from your own loop at the time you choose.
A broker's freeze level
The stops level is enforced; no separate freeze distance.
A trailing stop moved at every tick on the engine
It is moved when your program calls settle(). A fixed stop is watched at every tick.
The time a position was opened, its commission and swap, on the position itself
In its deals.
The largest adverse and favourable move of a position (MAE, MFE), kept by the venue
Record the open profit of each position at each step in your own code.
A tag or a comment of your own on an order
Keep a table from ticket to your own data.
A snapshot saved to a file
A snapshot lives in memory; a closed workbench is on disk and resumes.
Environments in parallel threads inside one program
One program steps its environments one after another; several programs run side by side.
An event for each order state on the engine
Read last_answer after a send, and the deals.
A ready library of risk statistics in Python
Compute them from your recorded equity and the deals.
05Requirements
Python 3.9 or later; pip install "bentrix[gym]"; Bentrix installed on the computer; the engine in your own program needs an account on Plus or Pro. The engine reaches laboratory and paper workbenches. A real account is reached only through the open application, where the person decides how an agent's orders are sent: real accounts and safety.
Bentrix 0.1.382Every number, name and default on these pages is read from the application itself.What is comingWhat changed