Bentrix Docs
HomePricingDashboard

Every setting

Every argument of env_make, env_reset, env_step, run_episode, env_act, env_observe and env_close, with its default and what it answers.

env_make — make an environment

ArgumentDefaultWhat it is
benchrequiredthe workbench's address, bentrix://…/bench/… — a laboratory workbench kept for training
symbolthe workbench's first marketthe market the agent trades
intervalH1how long a step lasts: any fixed interval from M1 to W1 (not a month)
window32the closed candles an observation holds
actiondiscretediscrete, continuous or order (actions)
rewarddsr_dd_penalty@1one of the eight rewards
lots0.01the volume of a whole position
episodewindowwindow, session or tape (episodes)
episode_bars200a window episode's steps
growingnone{first, last, over}: window episodes lengthening from first to last steps over over episodes
deadband0.1a continuous action's flat zone
ruin0.5the share of the opening equity at or below which an episode ends in ruin
participationnonea cap on an order's units, as a share (0 to 1] of the last candle's volume
impact0with participation: the reward charged impact × units ÷ the candle's volume
max_points10000an order action's largest stop or target, in points
max_stepsnoneon a live workbench, the steps after which an episode is truncated
followfalsefollow a clock someone else moves instead of driving it (always so on a paper or real workbench)

It answers:

FieldExample
env"env-1" — the id every other call takes
symbol, interval, length_ms"SYN-DOCS", "H1", 3600000
reward"dsr_dd_penalty@1"
livefalse in the laboratory
first_ms, last_msthe recording's first and last moment
observation_space{"market": {"shape": [32, 4]}, "account": {"shape": [3]}}
action_space{"kind": "discrete", "n": 3, "meaning": ["flat", "long", "short"]}

A workbench whose engine is still being prepared refuses with call env_make again in a moment — a new workbench takes a few seconds.

01env_reset — start an episode

ArgumentDefaultWhat it is
envrequiredthe environment
seedthe last seed's next episoderestarts the seed's draws from its first episode
start_msnonea window episode's start, chosen by you
barsepisode_barswith start_ms: the episode's steps
at_ms—on a live workbench only: the close the market last reached

It answers obs and info — start_ms, end_ms, opening (the equity), episode_index, ledger_hash, reward.

02env_step — take an action

ArgumentWhat it is
envthe environment
action0/1/2, a number in [−1, 1], or {side, size, stop, target} — as the kind says

It answers obs, reward, terminated, truncated and info — equity, refused, cursor_ms, ledger_hash, reward, and participation when there is a cap. On a paper or real workbench env_step is refused: use env_act and env_observe.

03run_episode — a whole episode in one call

ArgumentWhat it is
envthe environment
seedoptional, as env_reset's
actionsa list of actions, taken in turn until the episode ends or the list does

It answers start_ms, steps, rewards (one per step), refused (one per step), equity (one per step), terminated, truncated and ledger_hash. For a policy fixed in advance it is much faster than a call per step.

04env_act and env_observe — on the market's clock

CallArgumentsIt answers
env_actenv, actionrefused, outcome — sent, awaiting_person or refused — and participation
env_observeenv, at_ms (the close reached), moved (false when no candle closed: the episode is truncated)what env_step answers

On a live market shows the loop.

05env_close

Takes env; answers {"closed": "env-1"}. The workbench and every deal on it stay as they were. Up to 64 environments are open at once; making one more lets the oldest go.

06Plans and scopes

Every Gym call needs a pairing with the lab scope. extract_dataset needs only read.

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