Write a strategy in Python against Bentrix's engine, or train a learning agent in a Gym environment on Bentrix's venue.
The SDK's engine binding runs Bentrix's replay and venue inside your own Python program: open a session on a recording, step it, read bars, place orders, read the book. The same strategy rules hold: the clock advances, and nothing after it exists.
For reinforcement learning, a Gym-shaped environment wraps the venue: observations from the bars, actions as orders, the episode a stretch of history. A recipe-generated market gives a fresh episode with every seed.
The Gym section covers it step by step: how one step works, the observation, the three kinds of action, the eight rewards, episodes and seeds, then guides that run an episode, beat a rule, train a policy in nine languages, and train PPO with Gymnasium and Stable-Baselines3.
The engine binding, page by page
- The engine in your own program — open a workspace with
bentrix.local.Local, step the clock, send orders, read the book. - A strategy in Python, candle by candle —
bentrix.backtest: a callback at every closed candle. - An environment of your own — a Gymnasium environment with your own observation, actions and reward on the same venue.
- Datasets and a fast first pass — candles as NumPy columns, labels, splits, and a vectorised pass checked against the engine.
- What the engine supports for an autonomous agent — everything on one page, with what is not there.