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
| Argument | Default | What it is |
|---|---|---|
bench | required | the workbench's address, bentrix://…/bench/… — a laboratory workbench kept for training |
symbol | the workbench's first market | the market the agent trades |
interval | H1 | how long a step lasts: any fixed interval from M1 to W1 (not a month) |
window | 32 | the closed candles an observation holds |
action | discrete | discrete, continuous or order (actions) |
reward | dsr_dd_penalty@1 | one of the eight rewards |
lots | 0.01 | the volume of a whole position |
episode | window | window, session or tape (episodes) |
episode_bars | 200 | a window episode's steps |
growing | none | {first, last, over}: window episodes lengthening from first to last steps over over episodes |
deadband | 0.1 | a continuous action's flat zone |
ruin | 0.5 | the share of the opening equity at or below which an episode ends in ruin |
participation | none | a cap on an order's units, as a share (0 to 1] of the last candle's volume |
impact | 0 | with participation: the reward charged impact × units ÷ the candle's volume |
max_points | 10000 | an order action's largest stop or target, in points |
max_steps | none | on a live workbench, the steps after which an episode is truncated |
follow | false | follow a clock someone else moves instead of driving it (always so on a paper or real workbench) |
It answers:
| Field | Example |
|---|---|
env | "env-1" — the id every other call takes |
symbol, interval, length_ms | "SYN-DOCS", "H1", 3600000 |
reward | "dsr_dd_penalty@1" |
live | false in the laboratory |
first_ms, last_ms | the 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
| Argument | Default | What it is |
|---|---|---|
env | required | the environment |
seed | the last seed's next episode | restarts the seed's draws from its first episode |
start_ms | none | a window episode's start, chosen by you |
bars | episode_bars | with 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
| Argument | What it is |
|---|---|
env | the environment |
action | 0/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
| Argument | What it is |
|---|---|
env | the environment |
seed | optional, as env_reset's |
actions | a 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
| Call | Arguments | It answers |
|---|---|---|
env_act | env, action | refused, outcome — sent, awaiting_person or refused — and participation |
env_observe | env, 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.