Strategies: validated, saved and read; run on a laboratory, paper or real workbench and followed, paused, resumed, paced and stopped; batches, walk-forward and the verification battery; the run's statistics and its ledger; and the reinforcement-learning environment (env_*, run_episode) over Bentrix's own venue.
Reached from a connected client as client.strategy in Python, client.strategy in JavaScript, client.strategy() in Rust — each tool below shows its call in every language.
batch_get#
Read a batch
Reads a batch: how many of its cells settled, each cell's figures and where it stands (queued, arming, running, ended with its run, refused or not started with why), and the path of its record once every cell settled; then too its statistics against chance - for the cell with the highest net, the probabilistic and deflated Sharpe ratio, the minimum backtest length and the Harvey-Liu haircut over every trial the ledger counts for the strategy, the probability of backtest overfitting over the cells, the interquartile mean of the cells' nets with a bootstrap interval, the first market's price change as the baseline, and the conventions labelled as such.
| Argument | Type | Required | Default | What it is |
|---|---|---|---|---|
batch | string | yes | — | The batch's uri (bentrix://batch/<id>). |
MCP
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "batch_get",
"arguments": {
"batch": "…"
},
"_meta": {
"io.modelcontextprotocol/protocolVersion": "2026-07-28",
"io.modelcontextprotocol/clientCapabilities": {}
}
}
}Python
client.strategy
def batch_get(self, batch: str) -> Dict[str, Any]JavaScript
client.strategy
batchGet(args)C#
client.Strategy
public Task<JsonNode?> BatchGet(string batch, CancellationToken ct = default)Go
client.Strategy
func (a *StrategyAPI) BatchGet(ctx context.Context, args StrategyBatchGetArgs) (any, error)Java
client.strategy
public Object batchGet(BatchGetArgs args)C++
client.strategy
Json batch_get(const BatchGetArgs &args)Julia
client.strategy
batch_get = (batch)R
client$strategy
`batch_get` = function(batch)Rust
client.strategy()
pub fn batch_get(&self, args: StrategyBatchGetArgs) -> Result<Value, Error>batch_stop#
Stop a batch
Stops a batch: its running cells end as a run's Stop ends them, the cells not yet started are not started, and what settled stays. Answers the batch.
| Argument | Type | Required | Default | What it is |
|---|---|---|---|---|
batch | string | yes | — | The batch's uri (bentrix://batch/<id>). |
MCP
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "batch_stop",
"arguments": {
"batch": "…"
},
"_meta": {
"io.modelcontextprotocol/protocolVersion": "2026-07-28",
"io.modelcontextprotocol/clientCapabilities": {}
}
}
}Python
client.strategy
def batch_stop(self, batch: str) -> Dict[str, Any]JavaScript
client.strategy
batchStop(args)C#
client.Strategy
public Task<JsonNode?> BatchStop(string batch, CancellationToken ct = default)Go
client.Strategy
func (a *StrategyAPI) BatchStop(ctx context.Context, args StrategyBatchStopArgs) (any, error)Java
client.strategy
public Object batchStop(BatchStopArgs args)C++
client.strategy
Json batch_stop(const BatchStopArgs &args)Julia
client.strategy
batch_stop = (batch)R
client$strategy
`batch_stop` = function(batch)Rust
client.strategy()
pub fn batch_stop(&self, args: StrategyBatchStopArgs) -> Result<Value, Error>battery_get#
Read the verification battery
Answers this session's verification battery: how many of its workbenches settled, and once all did, each of the sixteen checks — its verdict (pass, fail, measured, not run), what it found in a sentence, and its figures.
Takes no arguments.
MCP
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "battery_get",
"arguments": {},
"_meta": {
"io.modelcontextprotocol/protocolVersion": "2026-07-28",
"io.modelcontextprotocol/clientCapabilities": {}
}
}
}Python
client.strategy
def battery_get(self) -> Dict[str, Any]JavaScript
client.strategy
batteryGet(args)C#
client.Strategy
public Task<JsonNode?> BatteryGet(CancellationToken ct = default)Go
client.Strategy
func (a *StrategyAPI) BatteryGet(ctx context.Context) (any, error)Java
client.strategy
public Object batteryGet()C++
client.strategy
Json battery_get()Julia
client.strategy
battery_get = ()R
client$strategy
`battery_get` = function()Rust
client.strategy()
pub fn battery_get(&self) -> Result<Value, Error>battery_run#
Run the verification battery
Runs the sixteen checks of Bentrix's own engine on a laboratory workbench's recording: a reference strategy (EMA 8 crossing EMA 21, hourly) at machine speed on workbenches made alike it — as it is, again, on twice the spread, on one-minute OHLC ticks, over the first half of its days — and scripted orders on three more (a buy and a sell held to the middle of the days, a stop and a limit). Answers as battery_get does; battery_get again until every check is answered: pass, fail, measured or not run, each with its reason and figures.
| Argument | Type | Required | Default | What it is |
|---|---|---|---|---|
bench | string | yes | — | The laboratory workbench whose recording the battery runs on: bentrix://lab/<lab>/bench/<bench>. |
MCP
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "battery_run",
"arguments": {
"bench": "…"
},
"_meta": {
"io.modelcontextprotocol/protocolVersion": "2026-07-28",
"io.modelcontextprotocol/clientCapabilities": {}
}
}
}Python
client.strategy
def battery_run(self, bench: str) -> Dict[str, Any]JavaScript
client.strategy
batteryRun(args)C#
client.Strategy
public Task<JsonNode?> BatteryRun(string bench, CancellationToken ct = default)Go
client.Strategy
func (a *StrategyAPI) BatteryRun(ctx context.Context, args StrategyBatteryRunArgs) (any, error)Java
client.strategy
public Object batteryRun(BatteryRunArgs args)C++
client.strategy
Json battery_run(const BatteryRunArgs &args)Julia
client.strategy
battery_run = (bench)R
client$strategy
`battery_run` = function(bench)Rust
client.strategy()
pub fn battery_run(&self, args: StrategyBatteryRunArgs) -> Result<Value, Error>bench_set_automation#
Arm a workbench's automation
Arms or disarms a laboratory workbench's automation — whether a run's intents on it become orders — as the workbench's own switch does. A disarmed run still decides and journals what it would have sent. Answers the switch.
| Argument | Type | Required | Default | What it is |
|---|---|---|---|---|
armed | boolean | yes | — | Whether a run's intents on it become orders. |
bench | string | yes | — | The workbench's uri. |
MCP
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "bench_set_automation",
"arguments": {
"armed": true,
"bench": "…"
},
"_meta": {
"io.modelcontextprotocol/protocolVersion": "2026-07-28",
"io.modelcontextprotocol/clientCapabilities": {}
}
}
}Python
client.strategy
def bench_set_automation(self, bench: str, armed: bool) -> Dict[str, Any]JavaScript
client.strategy
benchSetAutomation(args)C#
client.Strategy
public Task<JsonNode?> BenchSetAutomation(string bench, bool armed, CancellationToken ct = default)Go
client.Strategy
func (a *StrategyAPI) BenchSetAutomation(ctx context.Context, args StrategyBenchSetAutomationArgs) (any, error)Java
client.strategy
public Object benchSetAutomation(BenchSetAutomationArgs args)C++
client.strategy
Json bench_set_automation(const BenchSetAutomationArgs &args)Julia
client.strategy
bench_set_automation = (bench, armed)R
client$strategy
`bench_set_automation` = function(bench, armed)Rust
client.strategy()
pub fn bench_set_automation(&self, args: StrategyBenchSetAutomationArgs) -> Result<Value, Error>env_act#
Act on the market's clock
Takes one action in a live environment's episode, at the close it stands at: the position brought to the action's side - a flip closes first, and opens only once the close was sent; on a real account under Confirm the close is proposed in the trade panel for the person's Send. Moves no clock. Answers the refusal in its words and the outcome (sent, awaiting_person, refused); env_observe at the next close gives the reward.
| Argument | Type | Required | Default | What it is |
|---|---|---|---|---|
action | any | yes | — | The action: 0, 1 or 2 for a discrete environment, a number in [-1, 1] for a continuous one, {side, size, stop, target} for an order one. |
env | string | yes | — |
MCP
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "env_act",
"arguments": {
"action": "…",
"env": "…"
},
"_meta": {
"io.modelcontextprotocol/protocolVersion": "2026-07-28",
"io.modelcontextprotocol/clientCapabilities": {}
}
}
}Python
client.strategy
def env_act(self, env: str, action: Any) -> Dict[str, Any]JavaScript
client.strategy
envAct(args)C#
client.Strategy
public Task<JsonNode?> EnvAct(string env, object action, CancellationToken ct = default)Go
client.Strategy
func (a *StrategyAPI) EnvAct(ctx context.Context, args StrategyEnvActArgs) (any, error)Java
client.strategy
public Object envAct(EnvActArgs args)C++
client.strategy
Json env_act(const EnvActArgs &args)Julia
client.strategy
env_act = (env, action)R
client$strategy
`env_act` = function(env, action)Rust
client.strategy()
pub fn env_act(&self, args: StrategyEnvActArgs) -> Result<Value, Error>env_close#
Close an environment
Lets an environment go. Its workbench and its deals stay as they are.
| Argument | Type | Required | Default | What it is |
|---|---|---|---|---|
env | string | yes | — |
MCP
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "env_close",
"arguments": {
"env": "…"
},
"_meta": {
"io.modelcontextprotocol/protocolVersion": "2026-07-28",
"io.modelcontextprotocol/clientCapabilities": {}
}
}
}Python
client.strategy
def env_close(self, env: str) -> Dict[str, Any]JavaScript
client.strategy
envClose(args)C#
client.Strategy
public Task<JsonNode?> EnvClose(string env, CancellationToken ct = default)Go
client.Strategy
func (a *StrategyAPI) EnvClose(ctx context.Context, args StrategyEnvCloseArgs) (any, error)Java
client.strategy
public Object envClose(EnvCloseArgs args)C++
client.strategy
Json env_close(const EnvCloseArgs &args)Julia
client.strategy
env_close = (env)R
client$strategy
`env_close` = function(env)Rust
client.strategy()
pub fn env_close(&self, args: StrategyEnvCloseArgs) -> Result<Value, Error>env_make#
Make a trading environment
Makes a reinforcement-learning environment over a workbench - observations of the closed candles and the account, discrete, continuous or order actions, eight named rewards, tape, window or session episodes (a growing curriculum optional), a modelled participation cap - and answers its id with its observation and action spaces. On a laboratory workbench env_reset starts an episode, env_step takes an action, run_episode runs a list; the workbench is rewound at each reset, its deals undone, so give it one of its own. On a paper or REAL workbench the clock is the market's: env_reset at a close, env_act, then env_observe at the next close. Env_close lets it go.
| Argument | Type | Required | Default | What it is |
|---|---|---|---|---|
action | "discrete" | "continuous" | "order" | — | — | Discrete (0 flat, 1 long, 2 short; the default), continuous (a target in [-1, 1]) or order (side, size, stop and target in points). |
bench | string | yes | — | The workbench's uri. A laboratory workbench is rewound at each reset, its deals undone — give it one of its own; a paper or REAL one runs on the market's clock (env_act, env_observe). |
deadband | number | — | — | A continuous action's flat zone, by default 0.1. |
episode | "tape" | "window" | "session" | — | — | Tape (the whole days), window (episode_bars candles from the seed's draw; the default) or session (one day). |
episode_bars | integer | — | — | A window episode's candles, by default 200. |
follow | boolean | — | false | Follow a clock someone else moves rather than drive it — a paper or REAL workbench always does; a laboratory one may (a replay the person plays, acted on at each close): no rewind, env_act and env_observe. |
growing | object | — | — | A curriculum: window episodes lengthening from first to last candles over over episodes. |
impact | number | — | — | With participation: the reward charged impact x units / the candle's volume - never the account. |
interval | string | — | — | The interval a step lasts (M1 to W1), by default H1. |
lots | number | — | — | The lots a whole position holds, by default 0.01. |
max_points | number | — | — | An order action's largest stop or target, in points, by default 10000. |
max_steps | integer | — | — | On a live workbench: the steps after which an episode is truncated. |
participation | number | — | — | A modelled participation cap: an order's units at most this share of the last closed candle's volume, in (0, 1]. |
reward | string | — | — | The reward plugin, by default dsr_dd_penalty@1. |
ruin | number | — | — | The share of the opening equity at or below which an episode ends in ruin, by default 0.5. |
symbol | string | — | — | The market, by default the workbench's first. |
window | integer | — | — | The closed candles an observation holds, by default 32. |
MCP
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "env_make",
"arguments": {
"bench": "…"
},
"_meta": {
"io.modelcontextprotocol/protocolVersion": "2026-07-28",
"io.modelcontextprotocol/clientCapabilities": {}
}
}
}Python
client.strategy
def env_make(self, bench: str, *, action: Optional[Literal["discrete", "continuous", "order"]] = None, deadband: Optional[float] = None, episode: Optional[Literal["tape", "window", "session"]] = None, episode_bars: Optional[int] = None, follow: Optional[bool] = None, growing: Optional[Growing] = None, impact: Optional[float] = None, interval: Optional[str] = None, lots: Optional[float] = None, max_points: Optional[float] = None, max_steps: Optional[int] = None, participation: Optional[float] = None, reward: Optional[str] = None, ruin: Optional[float] = None, symbol: Optional[str] = None, window: Optional[int] = None) -> Dict[str, Any]JavaScript
client.strategy
envMake(args)C#
client.Strategy
public Task<JsonNode?> EnvMake(string bench, string? action = null, double? deadband = null, string? episode = null, long? episodeBars = null, bool? follow = null, object? growing = null, double? impact = null, string? interval = null, double? lots = null, double? maxPoints = null, long? maxSteps = null, double? participation = null, string? reward = null, double? ruin = null, string? symbol = null, long? window = null, CancellationToken ct = default)Go
client.Strategy
func (a *StrategyAPI) EnvMake(ctx context.Context, args StrategyEnvMakeArgs) (any, error)Java
client.strategy
public Object envMake(EnvMakeArgs args)C++
client.strategy
Json env_make(const EnvMakeArgs &args)Julia
client.strategy
env_make = (bench; action = nothing, deadband = nothing, episode = nothing, episode_bars = nothing, follow = nothing, growing = nothing, impact = nothing, interval = nothing, lots = nothing, max_points = nothing, max_steps = nothing, participation = nothing, reward = nothing, ruin = nothing, symbol = nothing, window = nothing)R
client$strategy
`env_make` = function(bench, action = NULL, deadband = NULL, episode = NULL, episode_bars = NULL, follow = NULL, growing = NULL, impact = NULL, interval = NULL, lots = NULL, max_points = NULL, max_steps = NULL, participation = NULL, reward = NULL, ruin = NULL, symbol = NULL, window = NULL)Rust
client.strategy()
pub fn env_make(&self, args: StrategyEnvMakeArgs) -> Result<Value, Error>env_observe#
Observe at a close
Answers where an environment's episode stands at the close at_ms: the observation, the reward of the move since the last env_act, terminated (ruin), truncated (no candle closed, or the episode's steps) and info. On a live workbench it follows env_act at each close; on a laboratory workbench standing at at_ms it reads the observation a laboratory step would.
| Argument | Type | Required | Default | What it is |
|---|---|---|---|---|
at_ms | integer | yes | — | The close the workbench stands at. |
env | string | yes | — | |
moved | boolean | — | true | False when no candle closed since the last observation (the market said nothing): the episode is truncated. |
MCP
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "env_observe",
"arguments": {
"at_ms": 1,
"env": "…"
},
"_meta": {
"io.modelcontextprotocol/protocolVersion": "2026-07-28",
"io.modelcontextprotocol/clientCapabilities": {}
}
}
}Python
client.strategy
def env_observe(self, env: str, at_ms: int, *, moved: Optional[bool] = None) -> Dict[str, Any]JavaScript
client.strategy
envObserve(args)C#
client.Strategy
public Task<JsonNode?> EnvObserve(string env, long atMs, bool? moved = null, CancellationToken ct = default)Go
client.Strategy
func (a *StrategyAPI) EnvObserve(ctx context.Context, args StrategyEnvObserveArgs) (any, error)Java
client.strategy
public Object envObserve(EnvObserveArgs args)C++
client.strategy
Json env_observe(const EnvObserveArgs &args)Julia
client.strategy
env_observe = (env, at_ms; moved = nothing)R
client$strategy
`env_observe` = function(env, at_ms, moved = NULL)Rust
client.strategy()
pub fn env_observe(&self, args: StrategyEnvObserveArgs) -> Result<Value, Error>env_reset#
Start an episode
Starts an environment's next episode. In the laboratory the workbench is rewound to its start with its deals undone, then advanced as Play would to the episode's start (the tape's first hour after the warm-up, a window the seed draws or start_ms gives, or a session's day); on a live workbench nothing moves and the episode starts at at_ms. Answers the observation and info (the reward's name, the ledger hash, the start, the end, the opening equity).
| Argument | Type | Required | Default | What it is |
|---|---|---|---|---|
at_ms | integer | — | — | On a live workbench: the close the market last reached, where the episode starts. |
bars | integer | — | — | With start_ms: the episode's candles. |
env | string | yes | — | The environment, as env_make answered it. |
seed | integer | — | — | The seed: given, the episode draws start over from it; absent, the next episode of the last seed. |
start_ms | integer | — | — | A window episode's start, chosen by a person's own sampler instead of the seed's draw. |
MCP
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "env_reset",
"arguments": {
"env": "…"
},
"_meta": {
"io.modelcontextprotocol/protocolVersion": "2026-07-28",
"io.modelcontextprotocol/clientCapabilities": {}
}
}
}Python
client.strategy
def env_reset(self, env: str, *, at_ms: Optional[int] = None, bars: Optional[int] = None, seed: Optional[int] = None, start_ms: Optional[int] = None) -> Dict[str, Any]JavaScript
client.strategy
envReset(args)C#
client.Strategy
public Task<JsonNode?> EnvReset(string env, long? atMs = null, long? bars = null, long? seed = null, long? startMs = null, CancellationToken ct = default)Go
client.Strategy
func (a *StrategyAPI) EnvReset(ctx context.Context, args StrategyEnvResetArgs) (any, error)Java
client.strategy
public Object envReset(EnvResetArgs args)C++
client.strategy
Json env_reset(const EnvResetArgs &args)Julia
client.strategy
env_reset = (env; at_ms = nothing, bars = nothing, seed = nothing, start_ms = nothing)R
client$strategy
`env_reset` = function(env, at_ms = NULL, bars = NULL, seed = NULL, start_ms = NULL)Rust
client.strategy()
pub fn env_reset(&self, args: StrategyEnvResetArgs) -> Result<Value, Error>env_step#
Take an action
Takes one action in a laboratory environment's episode: the position brought to the action's side through the workbench's venue (refused in its words, never clipped into another), then the workbench advanced to the interval's next close. Answers the observation, the reward, terminated (ruin), truncated (the episode's or the tape's end) and info (the ledger hash, the refusal, the equity, the cursor, the participation it was cut to).
| Argument | Type | Required | Default | What it is |
|---|---|---|---|---|
action | any | yes | — | The action: 0, 1 or 2 for a discrete environment, a number in [-1, 1] for a continuous one, {side, size, stop, target} for an order one. |
env | string | yes | — |
MCP
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "env_step",
"arguments": {
"action": "…",
"env": "…"
},
"_meta": {
"io.modelcontextprotocol/protocolVersion": "2026-07-28",
"io.modelcontextprotocol/clientCapabilities": {}
}
}
}Python
client.strategy
def env_step(self, env: str, action: Any) -> Dict[str, Any]JavaScript
client.strategy
envStep(args)C#
client.Strategy
public Task<JsonNode?> EnvStep(string env, object action, CancellationToken ct = default)Go
client.Strategy
func (a *StrategyAPI) EnvStep(ctx context.Context, args StrategyEnvStepArgs) (any, error)Java
client.strategy
public Object envStep(EnvStepArgs args)C++
client.strategy
Json env_step(const EnvStepArgs &args)Julia
client.strategy
env_step = (env, action)R
client$strategy
`env_step` = function(env, action)Rust
client.strategy()
pub fn env_step(&self, args: StrategyEnvStepArgs) -> Result<Value, Error>ledger_query#
Read the trial ledger
Reads the trial ledger: every run, batch cell and re-run written before its result was shown, and each result after it, in order - sequence number, wall clock, kind (trial or result), body (strategy, version, digest, tick model, span start, the batch and its figures; or of, trades and net; or an external family's name, count and description) and the hash chain. With strategy, that strategy's trials and their results only, and trials counts them (the N a multiple-testing correction needs). Always answers union, every trial the ledger holds (a run one, an external line its count), and families, each family's and strategy's count. Says where the chain stops following, if it does. The ledger has no door that removes a line.
| Argument | Type | Required | Default | What it is |
|---|---|---|---|---|
from_seq | integer | — | — | The first line to answer (its sequence number); omitted, from the first. |
limit | integer | — | — | How many lines at most; omitted, 500. |
strategy | string | — | — | A strategy, by its name as every other tool takes it (rsi pullback) or its stem (its file name, rsi_pullback), to read that strategy's trials and their results only. |
MCP
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "ledger_query",
"arguments": {},
"_meta": {
"io.modelcontextprotocol/protocolVersion": "2026-07-28",
"io.modelcontextprotocol/clientCapabilities": {}
}
}
}Python
client.strategy
def ledger_query(self, *, from_seq: Optional[int] = None, limit: Optional[int] = None, strategy: Optional[str] = None) -> Dict[str, Any]JavaScript
client.strategy
ledgerQuery(args)C#
client.Strategy
public Task<JsonNode?> LedgerQuery(long? fromSeq = null, long? limit = null, string? strategy = null, CancellationToken ct = default)Go
client.Strategy
func (a *StrategyAPI) LedgerQuery(ctx context.Context, args StrategyLedgerQueryArgs) (any, error)Java
client.strategy
public Object ledgerQuery(LedgerQueryArgs args)C++
client.strategy
Json ledger_query(const LedgerQueryArgs &args)Julia
client.strategy
ledger_query = (; from_seq = nothing, limit = nothing, strategy = nothing)R
client$strategy
`ledger_query` = function(from_seq = NULL, limit = NULL, strategy = NULL)Rust
client.strategy()
pub fn ledger_query(&self, args: StrategyLedgerQueryArgs) -> Result<Value, Error>ledger_record#
Record trials tried outside a run
Appends to the trial ledger a family of candidates tried in the person's own code - an event study's cells, a grid searched outside Bentrix - as one line with its count, before any of its result exists (kind trial: family, count, description, digest); or what came of such a trial (kind result: of, result). The family's count joins the ledger's union, the N a correction across everything tried takes, and never leaves it: the ledger has no door that removes a line. A run's own trials are Bentrix's to write and are refused here. Answers the line's sequence number, the family's count and the union.
| Argument | Type | Required | Default | What it is |
|---|---|---|---|---|
count | integer | — | — | Trial: how many candidates this line adds to the family, 1 to 10,000,000. |
description | string | — | — | Trial: what was tried, in words, at most 4,000 characters. |
digest | string | — | — | Trial: a digest of the pre-registration, at most 128 characters. |
family | string | — | — | Trial: the family's name, letters, digits, _, - and ., at most 64. |
kind | string | yes | — | trial: a family of candidates tried outside a run, written before any of its result exists. result: what came of an earlier external trial. |
of | integer | — | — | Result: the sequence number of the external trial it answers. |
result | any | — | — | Result: what came of it, an object of at most 64 KiB. |
MCP
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "ledger_record",
"arguments": {
"kind": "…"
},
"_meta": {
"io.modelcontextprotocol/protocolVersion": "2026-07-28",
"io.modelcontextprotocol/clientCapabilities": {}
}
}
}Python
client.strategy
def ledger_record(self, kind: str, *, count: Optional[int] = None, description: Optional[str] = None, digest: Optional[str] = None, family: Optional[str] = None, of: Optional[int] = None, result: Optional[Any] = None) -> Dict[str, Any]JavaScript
client.strategy
ledgerRecord(args)C#
client.Strategy
public Task<JsonNode?> LedgerRecord(string kind, long? count = null, string? description = null, string? digest = null, string? family = null, long? of = null, object? result = null, CancellationToken ct = default)Go
client.Strategy
func (a *StrategyAPI) LedgerRecord(ctx context.Context, args StrategyLedgerRecordArgs) (any, error)Java
client.strategy
public Object ledgerRecord(LedgerRecordArgs args)C++
client.strategy
Json ledger_record(const LedgerRecordArgs &args)Julia
client.strategy
ledger_record = (kind; count = nothing, description = nothing, digest = nothing, family = nothing, of = nothing, result = nothing)R
client$strategy
`ledger_record` = function(kind, count = NULL, description = NULL, digest = NULL, family = NULL, of = NULL, result = NULL)Rust
client.strategy()
pub fn ledger_record(&self, args: StrategyLedgerRecordArgs) -> Result<Value, Error>optimisation_import#
Import a MetaTrader optimisation
Reads a MetaTrader optimisation's results table (Pass, Result or Profit, Sharpe Ratio, Trades, and the expert's inputs), writes every pass to the trial ledger as a trial of name with its result, and judges the best pass (the highest Sharpe ratio) over the ledger's N for that name: its probabilistic and deflated Sharpe ratio and the Harvey-Liu haircut. The table carries no return series, so the sample is the pass's trades with a normal's skew and kurtosis, said, and PBO is not computed, said. The Strategies panel's Import optimisation results draws the same.
| Argument | Type | Required | Default | What it is |
|---|---|---|---|---|
name | string | yes | — | The expert's name: what its passes are counted under in the trial ledger. |
table | string | yes | — | The optimiser's exported table: its Export to XML file's text, or the table as CSV or tab-separated text with its header row. |
MCP
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "optimisation_import",
"arguments": {
"name": "…",
"table": "…"
},
"_meta": {
"io.modelcontextprotocol/protocolVersion": "2026-07-28",
"io.modelcontextprotocol/clientCapabilities": {}
}
}
}Python
client.strategy
def optimisation_import(self, name: str, table: str) -> Dict[str, Any]JavaScript
client.strategy
optimisationImport(args)C#
client.Strategy
public Task<JsonNode?> OptimisationImport(string name, string table, CancellationToken ct = default)Go
client.Strategy
func (a *StrategyAPI) OptimisationImport(ctx context.Context, args StrategyOptimisationImportArgs) (any, error)Java
client.strategy
public Object optimisationImport(OptimisationImportArgs args)C++
client.strategy
Json optimisation_import(const OptimisationImportArgs &args)Julia
client.strategy
optimisation_import = (name, table)R
client$strategy
`optimisation_import` = function(name, table)Rust
client.strategy()
pub fn optimisation_import(&self, args: StrategyOptimisationImportArgs) -> Result<Value, Error>run_episode#
Run an episode
Resets a laboratory environment (with the seed when given) and takes the actions in turn until the episode ends or they run out. Answers each step's reward, refusal and equity, the steps taken, whether it terminated or was truncated, and the ledger hash.
| Argument | Type | Required | Default | What it is |
|---|---|---|---|---|
actions | array of any | yes | — | The actions, taken in turn until the episode ends or they run out. |
env | string | yes | — | |
seed | integer | — | — |
MCP
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "run_episode",
"arguments": {
"actions": [],
"env": "…"
},
"_meta": {
"io.modelcontextprotocol/protocolVersion": "2026-07-28",
"io.modelcontextprotocol/clientCapabilities": {}
}
}
}Python
client.strategy
def run_episode(self, env: str, actions: List[Any], *, seed: Optional[int] = None) -> Dict[str, Any]JavaScript
client.strategy
runEpisode(args)C#
client.Strategy
public Task<JsonNode?> RunEpisode(string env, object actions, long? seed = null, CancellationToken ct = default)Go
client.Strategy
func (a *StrategyAPI) RunEpisode(ctx context.Context, args StrategyRunEpisodeArgs) (any, error)Java
client.strategy
public Object runEpisode(RunEpisodeArgs args)C++
client.strategy
Json run_episode(const RunEpisodeArgs &args)Julia
client.strategy
run_episode = (env, actions; seed = nothing)R
client$strategy
`run_episode` = function(env, actions, seed = NULL)Rust
client.strategy()
pub fn run_episode(&self, args: StrategyRunEpisodeArgs) -> Result<Value, Error>run_get#
Read a run
A run's state, its counts, and once it has ended its manifest: the tester report MetaTrader's tester shows, the trades and the equity samples.
| Argument | Type | Required | Default | What it is |
|---|---|---|---|---|
run | string | yes | — | The run's uri. |
MCP
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "run_get",
"arguments": {
"run": "…"
},
"_meta": {
"io.modelcontextprotocol/protocolVersion": "2026-07-28",
"io.modelcontextprotocol/clientCapabilities": {}
}
}
}Python
client.strategy
def run_get(self, run: str) -> Dict[str, Any]JavaScript
client.strategy
runGet(args)C#
client.Strategy
public Task<JsonNode?> RunGet(string run, CancellationToken ct = default)Go
client.Strategy
func (a *StrategyAPI) RunGet(ctx context.Context, args StrategyRunGetArgs) (any, error)Java
client.strategy
public Object runGet(RunGetArgs args)C++
client.strategy
Json run_get(const RunGetArgs &args)Julia
client.strategy
run_get = (run)R
client$strategy
`run_get` = function(run)Rust
client.strategy()
pub fn run_get(&self, args: StrategyRunGetArgs) -> Result<Value, Error>run_parity#
Compare a run with another engine's trades
Compares an ended run's closed trades with a trade list another engine produced - MetaTrader's tester, another backtester, an earlier run - each put in one canonical form (one line a closed trade: close time in ms, L or S, net at two decimals, in closing order) and hashed with sha256. Answers both hashes and counts, whether they are one list, and the first trade where they part with each side's line. Times are compared as each list writes them. The Run window's Validation tab draws the same.
| Argument | Type | Required | Default | What it is |
|---|---|---|---|---|
list | string | yes | — | The other engine's trade list, as its file's text: a JSON list of trades (time_ms or time, long or side, net or profit with commission and swap), a Bentrix run.json, or a CSV with a header naming those columns (a deals report's Direction column keeps its out rows). |
run | string | yes | — | The run's uri. |
MCP
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "run_parity",
"arguments": {
"list": "…",
"run": "…"
},
"_meta": {
"io.modelcontextprotocol/protocolVersion": "2026-07-28",
"io.modelcontextprotocol/clientCapabilities": {}
}
}
}Python
client.strategy
def run_parity(self, run: str, list: str) -> Dict[str, Any]JavaScript
client.strategy
runParity(args)C#
client.Strategy
public Task<JsonNode?> RunParity(string run, string list, CancellationToken ct = default)Go
client.Strategy
func (a *StrategyAPI) RunParity(ctx context.Context, args StrategyRunParityArgs) (any, error)Java
client.strategy
public Object runParity(RunParityArgs args)C++
client.strategy
Json run_parity(const RunParityArgs &args)Julia
client.strategy
run_parity = (run, list)R
client$strategy
`run_parity` = function(run, list)Rust
client.strategy()
pub fn run_parity(&self, args: StrategyRunParityArgs) -> Result<Value, Error>run_pause#
Pause a run
Hands a running run's clock back to the person at the end of its candle, as Pause does. Answers the run.
| Argument | Type | Required | Default | What it is |
|---|---|---|---|---|
run | string | yes | — | The run's uri. |
MCP
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "run_pause",
"arguments": {
"run": "…"
},
"_meta": {
"io.modelcontextprotocol/protocolVersion": "2026-07-28",
"io.modelcontextprotocol/clientCapabilities": {}
}
}
}Python
client.strategy
def run_pause(self, run: str) -> Dict[str, Any]JavaScript
client.strategy
runPause(args)C#
client.Strategy
public Task<JsonNode?> RunPause(string run, CancellationToken ct = default)Go
client.Strategy
func (a *StrategyAPI) RunPause(ctx context.Context, args StrategyRunPauseArgs) (any, error)Java
client.strategy
public Object runPause(RunPauseArgs args)C++
client.strategy
Json run_pause(const RunPauseArgs &args)Julia
client.strategy
run_pause = (run)R
client$strategy
`run_pause` = function(run)Rust
client.strategy()
pub fn run_pause(&self, args: StrategyRunPauseArgs) -> Result<Value, Error>run_resume#
Resume a run
Continues a paused run from wherever its workbench's clock now stands, as Resume does. Answers the run.
| Argument | Type | Required | Default | What it is |
|---|---|---|---|---|
run | string | yes | — | The run's uri. |
MCP
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "run_resume",
"arguments": {
"run": "…"
},
"_meta": {
"io.modelcontextprotocol/protocolVersion": "2026-07-28",
"io.modelcontextprotocol/clientCapabilities": {}
}
}
}Python
client.strategy
def run_resume(self, run: str) -> Dict[str, Any]JavaScript
client.strategy
runResume(args)C#
client.Strategy
public Task<JsonNode?> RunResume(string run, CancellationToken ct = default)Go
client.Strategy
func (a *StrategyAPI) RunResume(ctx context.Context, args StrategyRunResumeArgs) (any, error)Java
client.strategy
public Object runResume(RunResumeArgs args)C++
client.strategy
Json run_resume(const RunResumeArgs &args)Julia
client.strategy
run_resume = (run)R
client$strategy
`run_resume` = function(run)Rust
client.strategy()
pub fn run_resume(&self, args: StrategyRunResumeArgs) -> Result<Value, Error>run_robustness#
Test a run's robustness
Tests how robust an ended run of this session is, over its trades read with their entries, every draw from one fixed seed: the maximum drawdown over the trades drawn again in another order, the net with a tenth of the trades left out, the net with each trade's fill degraded by up to a tenth of the median absolute trade net (each as 5th, 50th and 95th percentiles of 1,000 draws); the random-entry percentile (the share of random draws - as many trades, each held as long as one of the run's, at a random minute in a random direction on its first market - whose sum of price moves is below the run's); and its trades, net and wins under the quiet, middle and busy days; and its metrics - Van Tharp's SQN, expectancy and its parts, the longest drawdown duration and the market's own trading days a year. Each with its definition; kept as robustness.json beside the run's run.json. The Run window's Validation tab draws the same.
| Argument | Type | Required | Default | What it is |
|---|---|---|---|---|
run | string | yes | — | The run's uri. |
MCP
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "run_robustness",
"arguments": {
"run": "…"
},
"_meta": {
"io.modelcontextprotocol/protocolVersion": "2026-07-28",
"io.modelcontextprotocol/clientCapabilities": {}
}
}
}Python
client.strategy
def run_robustness(self, run: str) -> Dict[str, Any]JavaScript
client.strategy
runRobustness(args)C#
client.Strategy
public Task<JsonNode?> RunRobustness(string run, CancellationToken ct = default)Go
client.Strategy
func (a *StrategyAPI) RunRobustness(ctx context.Context, args StrategyRunRobustnessArgs) (any, error)Java
client.strategy
public Object runRobustness(RunRobustnessArgs args)C++
client.strategy
Json run_robustness(const RunRobustnessArgs &args)Julia
client.strategy
run_robustness = (run)R
client$strategy
`run_robustness` = function(run)Rust
client.strategy()
pub fn run_robustness(&self, args: StrategyRunRobustnessArgs) -> Result<Value, Error>run_set_pace#
Change a run's pace
Switches a run between machine speed and the replay's pace at the cursor, as the Run window's pace does. Answers the run.
| Argument | Type | Required | Default | What it is |
|---|---|---|---|---|
pace | string | yes | — | |
run | string | yes | — |
MCP
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "run_set_pace",
"arguments": {
"pace": "…",
"run": "…"
},
"_meta": {
"io.modelcontextprotocol/protocolVersion": "2026-07-28",
"io.modelcontextprotocol/clientCapabilities": {}
}
}
}Python
client.strategy
def run_set_pace(self, run: str, pace: Literal["machine", "replay"]) -> Dict[str, Any]JavaScript
client.strategy
runSetPace(args)C#
client.Strategy
public Task<JsonNode?> RunSetPace(string run, string pace, CancellationToken ct = default)Go
client.Strategy
func (a *StrategyAPI) RunSetPace(ctx context.Context, args StrategyRunSetPaceArgs) (any, error)Java
client.strategy
public Object runSetPace(RunSetPaceArgs args)C++
client.strategy
Json run_set_pace(const RunSetPaceArgs &args)Julia
client.strategy
run_set_pace = (run, pace)R
client$strategy
`run_set_pace` = function(run, pace)Rust
client.strategy()
pub fn run_set_pace(&self, args: StrategyRunSetPaceArgs) -> Result<Value, Error>run_stop#
Stop a run
Ends a run at the end of its candle, as the Run window's Stop does; Stop is never refused while a run runs or waits paused. Answers the run.
| Argument | Type | Required | Default | What it is |
|---|---|---|---|---|
run | string | yes | — | The run's uri. |
MCP
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "run_stop",
"arguments": {
"run": "…"
},
"_meta": {
"io.modelcontextprotocol/protocolVersion": "2026-07-28",
"io.modelcontextprotocol/clientCapabilities": {}
}
}
}Python
client.strategy
def run_stop(self, run: str) -> Dict[str, Any]JavaScript
client.strategy
runStop(args)C#
client.Strategy
public Task<JsonNode?> RunStop(string run, CancellationToken ct = default)Go
client.Strategy
func (a *StrategyAPI) RunStop(ctx context.Context, args StrategyRunStopArgs) (any, error)Java
client.strategy
public Object runStop(RunStopArgs args)C++
client.strategy
Json run_stop(const RunStopArgs &args)Julia
client.strategy
run_stop = (run)R
client$strategy
`run_stop` = function(run)Rust
client.strategy()
pub fn run_stop(&self, args: StrategyRunStopArgs) -> Result<Value, Error>stats_family_test#
Test a family of candidates against chance
Tests a family of candidates against a benchmark at once, from each candidate's performance less the benchmark's period by period: Hansen's test for superior predictive ability (the consistent p-value, with the liberal one and the conservative one, which is White's reality check) and each candidate's Romano-Wolf stepdown adjusted p-value, over one stationary bootstrap drawn the same for every candidate. The same series and seed give the same answer. Pure arithmetic: reads and writes nothing; a family larger than candidates x periods x resamples = 200,000,000 is refused with its size.
| Argument | Type | Required | Default | What it is |
|---|---|---|---|---|
mean_block | number | — | — | The stationary bootstrap's mean block length in periods; omitted, 10. |
resamples | integer | — | — | Bootstrap resamples; omitted, 1,000; at most 20,000. |
seed | integer | — | — | The bootstrap's seed (the same seed, the same answer); omitted, 1. |
series | array of array of number | yes | — | Each candidate's performance less the benchmark's, period by period (larger is better), every row the same length: one row a candidate. |
MCP
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "stats_family_test",
"arguments": {
"series": []
},
"_meta": {
"io.modelcontextprotocol/protocolVersion": "2026-07-28",
"io.modelcontextprotocol/clientCapabilities": {}
}
}
}Python
client.strategy
def stats_family_test(self, series: List[List[float]], *, mean_block: Optional[float] = None, resamples: Optional[int] = None, seed: Optional[int] = None) -> Dict[str, Any]JavaScript
client.strategy
statsFamilyTest(args)C#
client.Strategy
public Task<JsonNode?> StatsFamilyTest(object series, double? meanBlock = null, long? resamples = null, long? seed = null, CancellationToken ct = default)Go
client.Strategy
func (a *StrategyAPI) StatsFamilyTest(ctx context.Context, args StrategyStatsFamilyTestArgs) (any, error)Java
client.strategy
public Object statsFamilyTest(StatsFamilyTestArgs args)C++
client.strategy
Json stats_family_test(const StatsFamilyTestArgs &args)Julia
client.strategy
stats_family_test = (series; mean_block = nothing, resamples = nothing, seed = nothing)R
client$strategy
`stats_family_test` = function(series, mean_block = NULL, resamples = NULL, seed = NULL)Rust
client.strategy()
pub fn stats_family_test(&self, args: StrategyStatsFamilyTestArgs) -> Result<Value, Error>strategy_batch#
Run a strategy over a grid of its figures
Runs a saved strategy once per combination of the grid's values, each cell on a workbench of its own made over every condition of the given laboratory workbench (stretch, markets, zone, account, costs) and run from its first moment at machine speed, at most workers at once. A cell the validator refuses is said by field and never run; a batch past Largest batch is refused with the number. Two figures vary the cells' benches rather than the document: tick_model (real, every-tick, ohlc-m1, open-only) and spread_multiplier (numbers above zero, 1 as recorded); a settled batch's record compares the results under each, with a sign-flip flag. With dry, answers the cells and the estimate and makes nothing. Answers the batch's uri; batch_get reads its cells and their runs.
| Argument | Type | Required | Default | What it is |
|---|---|---|---|---|
bench | string | yes | — | The laboratory workbench whose conditions every cell's own bench copies. |
dry | boolean | — | false | Plan only: the cells and the estimate, nothing made. |
grid | object | yes | — | Each figure the batch varies, by its path in the document (studies.fast.settings.period, sizing.value, a script's script.inputs.<title>), and the values it takes. |
strategy | string | yes | — | The saved strategy's name. |
version | integer | — | — | A version; the latest when absent. |
workers | integer | — | — | How many cells run at once; the computer's cores less two when absent. |
MCP
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "strategy_batch",
"arguments": {
"bench": "…",
"grid": {},
"strategy": "…"
},
"_meta": {
"io.modelcontextprotocol/protocolVersion": "2026-07-28",
"io.modelcontextprotocol/clientCapabilities": {}
}
}
}Python
client.strategy
def batch(self, strategy: str, bench: str, grid: Dict[str, List[Any]], *, dry: Optional[bool] = None, version: Optional[int] = None, workers: Optional[int] = None) -> Dict[str, Any]JavaScript
client.strategy
batch(args)C#
client.Strategy
public Task<JsonNode?> Batch(string strategy, string bench, object grid, bool? dry = null, long? version = null, long? workers = null, CancellationToken ct = default)Go
client.Strategy
func (a *StrategyAPI) Batch(ctx context.Context, args StrategyBatchArgs) (any, error)Java
client.strategy
public Object batch(BatchArgs args)C++
client.strategy
Json batch(const BatchArgs &args)Julia
client.strategy
batch = (strategy, bench, grid; dry = nothing, version = nothing, workers = nothing)R
client$strategy
`batch` = function(strategy, bench, grid, dry = NULL, version = NULL, workers = NULL)Rust
client.strategy()
pub fn batch(&self, args: StrategyBatchArgs) -> Result<Value, Error>strategy_get#
Read strategies
Lists the person's strategies with their versions, or reads one version of one — the latest when none is named — as the file holds it.
| Argument | Type | Required | Default | What it is |
|---|---|---|---|---|
name | string | — | — | The strategy's name; absent lists every strategy with its versions. |
version | integer | — | — | A version; the latest when absent. |
MCP
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "strategy_get",
"arguments": {},
"_meta": {
"io.modelcontextprotocol/protocolVersion": "2026-07-28",
"io.modelcontextprotocol/clientCapabilities": {}
}
}
}Python
client.strategy
def get(self, *, name: Optional[str] = None, version: Optional[int] = None) -> Dict[str, Any]JavaScript
client.strategy
get(args)C#
client.Strategy
public Task<JsonNode?> Get(string? name = null, long? version = null, CancellationToken ct = default)Go
client.Strategy
func (a *StrategyAPI) Get(ctx context.Context, args StrategyGetArgs) (any, error)Java
client.strategy
public Object get(GetArgs args)C++
client.strategy
Json get(const GetArgs &args)Julia
client.strategy
get = (; name = nothing, version = nothing)R
client$strategy
`get` = function(name = NULL, version = NULL)Rust
client.strategy()
pub fn get(&self, args: StrategyGetArgs) -> Result<Value, Error>strategy_run#
Run a strategy
Runs a saved strategy version on a laboratory workbench from its cursor, as the Run sheet does — one run per workbench; on a paper workbench at the market's own pace only (pace: replay); on a real account's workbench (with real) the person allows it on a card first, and every order follows the account's Automations mode - answered as a job. Its intents become orders only while the workbench's automation is armed (bench_set_automation). Answers the run's uri; run_get reads it, and its tester report once it ends.
| Argument | Type | Required | Default | What it is |
|---|---|---|---|---|
bench | string | yes | — | The laboratory workbench it runs on, from its cursor. |
pace | string | — | — | |
strategy | string | yes | — | The saved strategy's name. |
version | integer | — | — | A version; the latest when absent. |
MCP
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "strategy_run",
"arguments": {
"bench": "…",
"strategy": "…"
},
"_meta": {
"io.modelcontextprotocol/protocolVersion": "2026-07-28",
"io.modelcontextprotocol/clientCapabilities": {}
}
}
}Python
client.strategy
def run(self, strategy: str, bench: str, *, pace: Optional[Literal["machine", "replay"]] = None, version: Optional[int] = None) -> Dict[str, Any]JavaScript
client.strategy
run(args)C#
client.Strategy
public Task<JsonNode?> Run(string strategy, string bench, string? pace = null, long? version = null, CancellationToken ct = default)Go
client.Strategy
func (a *StrategyAPI) Run(ctx context.Context, args StrategyRunArgs) (any, error)Java
client.strategy
public Object run(RunArgs args)C++
client.strategy
Json run(const RunArgs &args)Julia
client.strategy
run = (strategy, bench; pace = nothing, version = nothing)R
client$strategy
`run` = function(strategy, bench, pace = NULL, version = NULL)Rust
client.strategy()
pub fn run(&self, args: StrategyRunArgs) -> Result<Value, Error>strategy_save#
Save a strategy
Saves a strategy document as its next version — version 1 for a new name — validated first, never over a file; a document the latest version already says is not written again. Answers the version, its digest and the validation.
| Argument | Type | Required | Default | What it is |
|---|---|---|---|---|
document | any | yes | — | The strategy document, as bentrix://strategy/schema describes it. |
MCP
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "strategy_save",
"arguments": {
"document": "…"
},
"_meta": {
"io.modelcontextprotocol/protocolVersion": "2026-07-28",
"io.modelcontextprotocol/clientCapabilities": {}
}
}
}Python
client.strategy
def save(self, document: Any) -> Dict[str, Any]JavaScript
client.strategy
save(args)C#
client.Strategy
public Task<JsonNode?> Save(object document, CancellationToken ct = default)Go
client.Strategy
func (a *StrategyAPI) Save(ctx context.Context, args StrategySaveArgs) (any, error)Java
client.strategy
public Object save(SaveArgs args)C++
client.strategy
Json save(const SaveArgs &args)Julia
client.strategy
save = (document)R
client$strategy
`save` = function(document)Rust
client.strategy()
pub fn save(&self, args: StrategySaveArgs) -> Result<Value, Error>strategy_validate#
Validate a strategy
Validates a strategy document as the editor does, field by field: whether it can run, what refuses it and what is only warned. Saves nothing.
| Argument | Type | Required | Default | What it is |
|---|---|---|---|---|
document | any | yes | — | The strategy document, as bentrix://strategy/schema describes it. |
MCP
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "strategy_validate",
"arguments": {
"document": "…"
},
"_meta": {
"io.modelcontextprotocol/protocolVersion": "2026-07-28",
"io.modelcontextprotocol/clientCapabilities": {}
}
}
}Python
client.strategy
def validate(self, document: Any) -> Dict[str, Any]JavaScript
client.strategy
validate(args)C#
client.Strategy
public Task<JsonNode?> Validate(object document, CancellationToken ct = default)Go
client.Strategy
func (a *StrategyAPI) Validate(ctx context.Context, args StrategyValidateArgs) (any, error)Java
client.strategy
public Object validate(ValidateArgs args)C++
client.strategy
Json validate(const ValidateArgs &args)Julia
client.strategy
validate = (document)R
client$strategy
`validate` = function(document)Rust
client.strategy()
pub fn validate(&self, args: StrategyValidateArgs) -> Result<Value, Error>strategy_walkforward#
Walk a strategy forward
Cuts the workbench's days into windows of in_sample_days and the out_of_sample_days after them (anchored: every in-sample stretch starts at the first day; rolling: the in-sample days before), and for each window in turn runs the grid as a batch over its in-sample days, chooses the cell with the highest in-sample net, and runs it as chosen over the out-of-sample days on a bench whose days begin at the in-sample start. Every cell and every out-of-sample run is a trial in the ledger, naming the walk and the window. Answers the walk's uri; walk_get reads its windows and, once ended, its record.
| Argument | Type | Required | Default | What it is |
|---|---|---|---|---|
bench | string | yes | — | The laboratory workbench whose days are walked and whose conditions every bench copies. |
grid | object | yes | — | Each figure the in-sample batches vary, by its path, and its values (strategy_batch's grid; never tick_model). |
in_sample_days | integer | yes | — | Days of each in-sample stretch. |
mode | string | yes | — | Anchored (every in-sample stretch starts at the first day) or rolling (the days before). |
out_of_sample_days | integer | yes | — | Days of each out-of-sample stretch. |
strategy | string | yes | — | The saved strategy's name. |
version | integer | — | — | A version; the latest when absent. |
workers | integer | — | — | How many in-sample cells run at once; the computer's cores less two when absent. |
MCP
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "strategy_walkforward",
"arguments": {
"bench": "…",
"grid": {},
"in_sample_days": 1,
"mode": "…",
"out_of_sample_days": 1,
"strategy": "…"
},
"_meta": {
"io.modelcontextprotocol/protocolVersion": "2026-07-28",
"io.modelcontextprotocol/clientCapabilities": {}
}
}
}Python
client.strategy
def walkforward(self, strategy: str, bench: str, grid: Dict[str, List[Any]], in_sample_days: int, out_of_sample_days: int, mode: str, *, version: Optional[int] = None, workers: Optional[int] = None) -> Dict[str, Any]JavaScript
client.strategy
walkforward(args)C#
client.Strategy
public Task<JsonNode?> Walkforward(string strategy, string bench, object grid, long inSampleDays, long outOfSampleDays, string mode, long? version = null, long? workers = null, CancellationToken ct = default)Go
client.Strategy
func (a *StrategyAPI) Walkforward(ctx context.Context, args StrategyWalkforwardArgs) (any, error)Java
client.strategy
public Object walkforward(WalkforwardArgs args)C++
client.strategy
Json walkforward(const WalkforwardArgs &args)Julia
client.strategy
walkforward = (strategy, bench, grid, in_sample_days, out_of_sample_days, mode; version = nothing, workers = nothing)R
client$strategy
`walkforward` = function(strategy, bench, grid, in_sample_days, out_of_sample_days, mode, version = NULL, workers = NULL)Rust
client.strategy()
pub fn walkforward(&self, args: StrategyWalkforwardArgs) -> Result<Value, Error>walk_get#
Read a walk-forward run
Answers a walk-forward run as it stands: each window's in-sample and out-of-sample stretches, its batch, the figures chosen and their in-sample net, the out-of-sample trades and net, and the efficiency (out-of-sample net a day over in-sample net a day, where the in-sample net is above zero); the out-of-sample total; and once every window settled, where its record was written.
| Argument | Type | Required | Default | What it is |
|---|---|---|---|---|
walk | string | yes | — | The walk's uri (bentrix://walk/<id>). |
MCP
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "walk_get",
"arguments": {
"walk": "…"
},
"_meta": {
"io.modelcontextprotocol/protocolVersion": "2026-07-28",
"io.modelcontextprotocol/clientCapabilities": {}
}
}
}Python
client.strategy
def walk_get(self, walk: str) -> Dict[str, Any]JavaScript
client.strategy
walkGet(args)C#
client.Strategy
public Task<JsonNode?> WalkGet(string walk, CancellationToken ct = default)Go
client.Strategy
func (a *StrategyAPI) WalkGet(ctx context.Context, args StrategyWalkGetArgs) (any, error)Java
client.strategy
public Object walkGet(WalkGetArgs args)C++
client.strategy
Json walk_get(const WalkGetArgs &args)Julia
client.strategy
walk_get = (walk)R
client$strategy
`walk_get` = function(walk)Rust
client.strategy()
pub fn walk_get(&self, args: StrategyWalkGetArgs) -> Result<Value, Error>walk_stop#
Stop a walk-forward run
Stops a walk-forward run as its Stop does: the window's in-sample batch or out-of-sample run stopped, the windows not reached failed as stopped; what settled stays. Answers the walk as walk_get does.
| Argument | Type | Required | Default | What it is |
|---|---|---|---|---|
walk | string | yes | — | The walk's uri (bentrix://walk/<id>). |
MCP
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "walk_stop",
"arguments": {
"walk": "…"
},
"_meta": {
"io.modelcontextprotocol/protocolVersion": "2026-07-28",
"io.modelcontextprotocol/clientCapabilities": {}
}
}
}Python
client.strategy
def walk_stop(self, walk: str) -> Dict[str, Any]JavaScript
client.strategy
walkStop(args)C#
client.Strategy
public Task<JsonNode?> WalkStop(string walk, CancellationToken ct = default)Go
client.Strategy
func (a *StrategyAPI) WalkStop(ctx context.Context, args StrategyWalkStopArgs) (any, error)Java
client.strategy
public Object walkStop(WalkStopArgs args)C++
client.strategy
Json walk_stop(const WalkStopArgs &args)Julia
client.strategy
walk_stop = (walk)R
client$strategy
`walk_stop` = function(walk)Rust
client.strategy()
pub fn walk_stop(&self, args: StrategyWalkStopArgs) -> Result<Value, Error>