Every method of client.Forecast in the C# SDK.
ChartSetForecast#
Set how a chart draws forecasts · tool chart_set_forecast
Sets how a chart draws a model's forecast: show, the ghost's opacity, uncertainty (fan, band, paths, off), the bands' opacity, the room on the right (forecast, shift_only, or N slots), how long a realized forecast stays (until_replaced, off, {horizons}, {bars}), a coarser interval spanned or by time, a finer one folded or by time, an element forecast on a time chart (auto, strip, by_expected_time, panel), a time forecast and another rule on a chart built by price (derived, strip, both), a profile (forecast_session, strip, off), true equivolume's widths (by_volume, median), the time past the newest bar (clock_time, session_time), the sampled paths drawn, and the models hidden on it (the legend's eye); models_per_market applies to every workbench. A field not named keeps its value. Answers the chart's forecast settings.
Declaration
client.Forecast
public Task<JsonNode?> ChartSetForecast(string chart, bool? arrivalMarks = null, double? bandOpacity = null, string? coarser = null, object? diff = null, string? elementOnTime = null, string? equivolumeWidth = null, string? finer = null, IReadOnlyList<string>? hidden = null, string? journal = null, object? keepAfterRealized = null, long? modelsPerMarket = null, string? onProfile = null, double? opacity = null, string? otherRule = null, string? pastNewest = null, object? readAtAnchor = null, bool? readout = null, object? room = null, long? samplesDrawn = null, bool? show = null, string? timeOnElements = null, long? trail = null, string? uncertainty = null, CancellationToken ct = default)Parameters
| Name | Type | What it is | |
|---|---|---|---|
chart | string | required | The chart's uri. |
arrivalMarks | bool? | optional | A tick on the time axis at each forecast's arrival. |
bandOpacity | double? | optional | The bands' opacity, 0.05 to 0.6. |
coarser | string? | optional | A coarser interval: "spanned" or "by_time". |
diff | object? | optional | **The diff view**{"a": model, "b": model} shades the gap between their closes step by step; "off" takes it away. |
elementOnTime | string? | optional | An element forecast (renko, kagi, …) on a time chart: "auto" (by expected time where every step says when it closes, else the strip), "strip", "by_expected_time" or "panel". |
equivolumeWidth | string? | optional | A step's width on true equivolume: "by_volume" (its own volume, else the window's median) or "median". |
finer | string? | optional | A finer interval: "folded" or "by_time". |
hidden | IReadOnlyList<string>? | optional | Models hidden on this chart, as the legend's eye hides them: the whole set. |
journal | string? | optional | The journal, for every workbench: laboratory_and_paper (the default), also_real, or off. |
keepAfterRealized | object? | optional | Keep after realized: "until_replaced", "off", {"horizons": n} or {"bars": n}. |
modelsPerMarket | long? | optional | Models per market, for every workbench: 1 to 64. |
onProfile | string? | optional | On a profile: "forecast_session" (letters over the rows one session after the last), "strip" or "off". |
opacity | double? | optional | The ghost's opacity, 0.2 to 1. |
otherRule | string? | optional | An element forecast of another type or rule on a chart built by price: "derived", "strip" or "both". |
pastNewest | string? | optional | Past the newest bar: "clock_time", or "session_time" (only the hours the market prints bars in). |
readAtAnchor | object? | optional | Read a forecast at its anchor, for every workbench: {"laboratory": bool, "paper_and_real": bool}; both off by default. A look-ahead: marked wherever it reads; on a live bench never the newest close. |
readout | bool? | optional | A step's figures beside the pointer and in the data window. |
room | object? | optional | Room on the right: "forecast" (as wide as the widest forecast), "shift_only", or a number of slots. |
samplesDrawn | long? | optional | Sampled paths drawn per step, 1 to 256. |
show | bool? | optional | Draw forecasts on this chart. |
timeOnElements | string? | optional | A time forecast on a chart built by price: "derived" (through the chart's own rule), "strip" or "both". |
trail | long? | optional | The trail: the forecasts each model put before the one standing, drawn faint - 0 (off) to 64. |
uncertainty | string? | optional | Fan, band, paths or off. |
Returns
Task<JsonNode?> — the tool’s answer as a JsonNode.
What it answers
Answers the chart's forecast settings.
Example
await client.Forecast.ChartSetForecast(chart)Clear#
Remove forecasts from a workbench · tool forecast_clear
Removes the forecasts of one model, one market, or all of them from the workbench, every arrival kept for them included, as the × on a forecast's legend row does. Answers how many (market, model) pairs were cleared.
Declaration
client.Forecast
public Task<JsonNode?> Clear(string bench, string? model = null, string? symbol = null, CancellationToken ct = default)Parameters
| Name | Type | What it is | |
|---|---|---|---|
bench | string | required | The workbench's uri. |
model | string? | optional | One model; omitted, every model. |
symbol | string? | optional | One market; omitted, every market. |
Returns
Task<JsonNode?> — the tool’s answer as a JsonNode.
What it answers
Answers how many (market, model) pairs were cleared.
Example
await client.Forecast.Clear(bench)Compare#
Set models' reports side by side · tool forecast_compare
Forecast_report for several models on one market, a row each, over the same journal and the same bars. Unordered (by name) unless metric_order names a measure, then best first. A comparison is a laboratory's instrument: nothing here is published or ranked anywhere else.
Declaration
client.Forecast
public Task<JsonNode?> Compare(string bench, string symbol, long? last = null, string? metricOrder = null, IReadOnlyList<string>? models = null, CancellationToken ct = default)Parameters
| Name | Type | What it is | |
|---|---|---|---|
bench | string | required | |
symbol | string | required | |
last | long? | optional | |
metricOrder | string? | optional | Order the rows by this measure, best first (mae_close, rmse_close, mape_close, pinball_loss, crps ascending; direction_hit_rate descending). Omitted, by the model's name: no ranking is drawn unless asked. |
models | IReadOnlyList<string>? | optional | The models; omitted, every model the journal holds on the market. |
Returns
Task<JsonNode?> — the tool’s answer as a JsonNode.
What it answers
What the tool's description says.
Example
await client.Forecast.Compare(bench, "SYN-DOCS")Diff#
Set two models' forecasts step by step · tool forecast_diff
The two models' forecasts a reader at the workbench's clock sees on one market, step by step where their steps open at the same instant: each one's close and the difference (b minus a), and where their outermost bands overlap.
Declaration
client.Forecast
public Task<JsonNode?> Diff(string bench, string symbol, string a, string b, CancellationToken ct = default)Parameters
| Name | Type | What it is | |
|---|---|---|---|
bench | string | required | |
symbol | string | required | |
a | string | required | |
b | string | required |
Returns
Task<JsonNode?> — the tool’s answer as a JsonNode.
What it answers
What the tool's description says.
Example
await client.Forecast.Diff(bench, "SYN-DOCS", "…", "…")EnsembleDefine#
Declare an ensemble of forecasts · tool forecast_ensemble_define
Declares an ensemble on a workbench's market: its label, its members (models' labels), the rule its closes are combined by (mean, median, weighted with one weight a member) and the NAMED rule its bands are combined by - quantiles_averaged (each level's lo and hi averaged; the band claims no coverage of its own), members_pooled (the mixture of the members' samples, quantiles or band edges, its quantiles at each level; partly pooled where a member gave only a band), or none. Bentrix computes only what is declared: whenever a member's newest forecast arrives and every member stands at one anchor, the ensemble's forecast is put, authored ensemble:<id>, so its arrival is the latest of its members'; a member cleared takes it off with a sentence. Declaring an id again replaces it. Answers the ensemble.
Declaration
client.Forecast
public Task<JsonNode?> EnsembleDefine(string bench, string symbol, string id, IReadOnlyList<string> members, string rule, string? bands = null, IReadOnlyList<double>? weights = null, CancellationToken ct = default)Parameters
| Name | Type | What it is | |
|---|---|---|---|
bench | string | required | |
symbol | string | required | |
id | string | required | The ensemble's label, as a model's: [a-z0-9_]{1,32}, none of its members. |
members | IReadOnlyList<string> | required | The members' model labels, at least two. |
rule | string | required | Mean, median or weighted. |
bands | string? | optional | Quantiles_averaged (each level's edges averaged; the band claims no p), members_pooled (the mixture's quantiles) or none. Omitted: quantiles_averaged. |
weights | IReadOnlyList<double>? | optional | For weighted: one weight a member, in the members' order. |
Returns
Task<JsonNode?> — the tool’s answer as a JsonNode.
What it answers
Answers the ensemble.
Example
await client.Forecast.EnsembleDefine(bench, "SYN-DOCS", "…", "…", "…")EnsembleList#
List a workbench's ensembles · tool forecast_ensemble_list
Answers the ensembles declared on a workbench: each one's label, market, members, rules, the latest member arrival its forecast was made from, and what it last said where none stands.
Declaration
client.Forecast
public Task<JsonNode?> EnsembleList(string bench, CancellationToken ct = default)Parameters
| Name | Type | What it is | |
|---|---|---|---|
bench | string | required |
Returns
Task<JsonNode?> — the tool’s answer as a JsonNode.
What it answers
Answers the ensembles declared on a workbench: each one's label, market, members, rules, the latest member arrival its forecast was made from, and what it last said where none stands.
Example
await client.Forecast.EnsembleList(bench)EnsembleRemove#
Remove an ensemble · tool forecast_ensemble_remove
Removes an ensemble from a workbench's market, and its forecast with it. Answers whether one was there.
Declaration
client.Forecast
public Task<JsonNode?> EnsembleRemove(string bench, string symbol, string id, CancellationToken ct = default)Parameters
| Name | Type | What it is | |
|---|---|---|---|
bench | string | required | |
symbol | string | required | |
id | string | required |
Returns
Task<JsonNode?> — the tool’s answer as a JsonNode.
What it answers
Answers whether one was there.
Example
await client.Forecast.EnsembleRemove(bench, "SYN-DOCS", "…")EvalBatch#
Run a batch of evaluation runs with ONNX models · tool forecast_eval_batch
Runs one evaluation run per cell over the workbench's own history, each with an ONNX model from the models folder asked INSIDE the loop by Bentrix's built-in engine: at each close the window its manifest describes is cut there, the model run, its output put as that close's forecast, stamped close + latency, and scored as forecast_eval_close scores. The workbench's clock does not move. Answers each cell's report, or why it did not run, in the cells' order.
Declaration
client.Forecast
public Task<JsonNode?> EvalBatch(string bench, object cells, CancellationToken ct = default)Parameters
| Name | Type | What it is | |
|---|---|---|---|
bench | string | required | |
cells | object | required | One evaluation run each. |
Returns
Task<JsonNode?> — the tool’s answer as a JsonNode.
What it answers
Answers each cell's report, or why it did not run, in the cells' order.
Example
await client.Forecast.EvalBatch(bench, "…")EvalClose#
End an evaluation run and report it · tool forecast_eval_close
Ends an evaluation run: its report (forecast_report's measures over the run's forecasts against the workbench's history, each step only if it had not closed at its stamped arrival, the latency said) and its journal written as one JSON-lines file in the export folder under this agent's name. The bench's own journal is not touched.
Declaration
client.Forecast
public Task<JsonNode?> EvalClose(long eval, CancellationToken ct = default)Parameters
| Name | Type | What it is | |
|---|---|---|---|
eval | long | required |
Returns
Task<JsonNode?> — the tool’s answer as a JsonNode.
What it answers
What the tool's description says.
Example
await client.Forecast.EvalClose(1)EvalMake#
Start an evaluation run over history · tool forecast_eval_make
Starts an evaluation run over the workbench's own history between from_ms and to_ms (its clock at most; the clock does not move): the closes of forecast_tf on the first market, one in stride. Forecast_eval_next hands the window cut at each close and scores the forecast handed back for the close before; forecast_eval_close answers the report. Each forecast's arrival is stamped close + latency (none, measured - this model's mean live latency on the bench's journal, 0 and said when it has none - or N ms), and a step it could already see is late and unscored, exactly as live. Over a span the workbench's laboratory does not hold nothing is made or fetched: the answer is an ask - which laboratory, the span, the days and markets downloaded, what MetaTrader will be asked - and a watch uri, and the person answers on one sheet in Bentrix's window (Make it and run, or No); forecast_eval_state and the event bentrix://forecasts/eval say what came of it. Answers the eval's id, the closes and what it runs on.
Declaration
client.Forecast
public Task<JsonNode?> EvalMake(string bench, IReadOnlyList<string> symbols, IReadOnlyList<string> frames, string forecastTf, long fromMs, string model, object? latency = null, long? limit = null, string? retrain = null, string? runModel = null, long? stride = null, long? toMs = null, CancellationToken ct = default)Parameters
| Name | Type | What it is | |
|---|---|---|---|
bench | string | required | The workbench whose history the run walks; its clock does not move. |
symbols | IReadOnlyList<string> | required | The markets of each window, the first the forecast's. |
frames | IReadOnlyList<string> | required | The frames of each window: intervals' labels. |
forecastTf | string | required | The interval whose closes the run walks, and the forecast's. |
fromMs | long | required | |
model | string | required | The model label the run's forecasts carry. |
latency | object? | optional | The latency each forecast is stamped with: "none", "measured" (this model's mean live latency on the bench's journal, the default), or a number of ms. |
limit | long? | optional | Closed bars per frame in each window (200 when omitted). |
retrain | string? | optional | When a retrain is due: "session" (each new day), "week", or a count of closes. |
runModel | string? | optional | **A model of the models folder Bentrix runs at each close itself**the run is driven by Bentrix to its end, the model handed each window and its answer scored, its label the model's own; omitted, the caller drives the run with forecast_eval_next. |
stride | long? | optional | One close in N. |
toMs | long? | optional | At most the workbench's clock; omitted, the clock. |
Returns
Task<JsonNode?> — the tool’s answer as a JsonNode.
What it answers
Answers the eval's id, the closes and what it runs on.
Example
await client.Forecast.EvalMake(bench, "…", "…", "…", 1, "…")EvalNext#
The next window of an evaluation run · tool forecast_eval_next
Scores the forecast handed for the last window - checked as forecast_put checks it, its arrival stamped at that window's close plus the run's latency - and hands the window cut at the next close: close_ms, the window (bars_window's answer at that instant, nothing later), done once the closes are walked, scored (the forecasts recorded so far), and retrain_due where the run's retrain rule falls.
Declaration
client.Forecast
public Task<JsonNode?> EvalNext(long eval, object? forecast = null, CancellationToken ct = default)Parameters
| Name | Type | What it is | |
|---|---|---|---|
eval | long | required | |
forecast | object? | optional | The forecast for the window handed last, as forecast_spec (its model and market the run's; its anchor the last closed bar of that window's close). Omitted for the first window, or to pass a close. |
Returns
Task<JsonNode?> — the tool’s answer as a JsonNode.
What it answers
What the tool's description says.
Example
await client.Forecast.EvalNext(1)EvalState#
Where an evaluation run or its ask stands · tool forecast_eval_state
A run's closes walked and left, its forecasts recorded, its latency rule and retrain rule; or where an ask forecast_eval_make answered stands: asked (the sheet stands in Bentrix's window), confirmed (Make it and run pressed), made_laboratory (the workbench over the span is made and its days are downloading), started (with the eval to drive), declined (by the person - never a failure), or failed (with why). The person's press on the sheet is the one answer; no tool answers it. The event bentrix://forecasts/eval carries each move of an ask.
Declaration
client.Forecast
public Task<JsonNode?> EvalState(string? ask = null, long? eval = null, CancellationToken ct = default)Parameters
| Name | Type | What it is | |
|---|---|---|---|
ask | string? | optional | Or an ask it answered (bentrix://ask/N), over days the workbench's laboratory did not hold. |
eval | long? | optional | A run forecast_eval_make started. |
Returns
Task<JsonNode?> — the tool’s answer as a JsonNode.
What it answers
What the tool's description says.
Example
await client.Forecast.EvalState()Get#
Read the forecasts on a workbench · tool forecast_get
Answers the forecasts a reader at at_ms (the workbench's clock when omitted) sees on the workbench, by arrival - never one that arrived after that instant - each with its model, market, epoch, form, anchor, put_ms, steps' count, state (current, partly realized, realized), how many steps have closed, who put it and its colours; steps true hands the steps. Arrivals lists every arrival the workbench keeps per model.
Declaration
client.Forecast
public Task<JsonNode?> Get(string bench, long? atMs = null, string? model = null, bool? steps = null, string? symbol = null, CancellationToken ct = default)Parameters
| Name | Type | What it is | |
|---|---|---|---|
bench | string | required | The workbench's uri. |
atMs | long? | optional | The instant to read at, UTC ms: what a reader at that instant saw. Omitted, the workbench's clock. |
model | string? | optional | One model; omitted, every model. |
steps | bool? | optional | True hands each forecast's steps too. |
symbol | string? | optional | One market; omitted, every market. |
Returns
Task<JsonNode?> — the tool’s answer as a JsonNode.
What it answers
Answers the forecasts a reader at at_ms (the workbench's clock when omitted) sees on the workbench, by arrival - never one that arrived after that instant - each with its model, market, epoch, form, anchor, put_ms, steps' count, state (current, partly realized, realized), how many steps have closed, who put it and its colours; steps true hands the steps.
Example
await client.Forecast.Get(bench)PresetApply#
Apply a forecast preset · tool forecast_preset_apply
Applies a preset's look to a chart, or with all true to every chart of that chart's workbench, as the card's Preset row does; each chart keeps its Show and the models its legend hid. Answers the charts it was applied to.
Declaration
client.Forecast
public Task<JsonNode?> PresetApply(string name, string chart, bool? all = null, CancellationToken ct = default)Parameters
| Name | Type | What it is | |
|---|---|---|---|
name | string | required | The preset: bentrix, quiet, or a name it was saved under. |
chart | string | required | The chart it is applied to; omitted with all true, every chart of the workbench the chart is on. |
all | bool? | optional |
Returns
Task<JsonNode?> — the tool’s answer as a JsonNode.
What it answers
Answers the charts it was applied to.
Example
await client.Forecast.PresetApply("…", chart)PresetDelete#
Delete a saved forecast preset · tool forecast_preset_delete
Deletes a preset the person saved; Bentrix's own (bentrix, quiet) cannot be. Answers every preset's name left.
Declaration
client.Forecast
public Task<JsonNode?> PresetDelete(string name, CancellationToken ct = default)Parameters
| Name | Type | What it is | |
|---|---|---|---|
name | string | required |
Returns
Task<JsonNode?> — the tool’s answer as a JsonNode.
What it answers
Answers every preset's name left.
Example
await client.Forecast.PresetDelete("…")PresetSave#
Save a chart's forecast look as a preset · tool forecast_preset_save
Saves a chart's forecast look - every row of its Forecast tab but Show and the models its legend hid - under a name, kept on this machine; the card's Preset row offers it beside Bentrix's own presets (bentrix, quiet). Saving a name again replaces it. Answers every preset's name.
Declaration
client.Forecast
public Task<JsonNode?> PresetSave(string chart, string name, CancellationToken ct = default)Parameters
| Name | Type | What it is | |
|---|---|---|---|
chart | string | required | The chart whose look is saved. |
name | string | required | The preset's name, [a-z0-9_]{1,32}, not a built-in's (bentrix, quiet). |
Returns
Task<JsonNode?> — the tool’s answer as a JsonNode.
What it answers
Answers every preset's name.
Example
await client.Forecast.PresetSave(chart, "…")Put#
Put a model's forecast on a workbench · tool forecast_put
Hands over a forecast_spec: drawn on every chart of its market on the workbench from the instant it arrives, which Bentrix stamps as put_ms on the workbench's own clock (a laboratory's replay instant, a live bench's market clock) - no reader sees it before. Refused by name where it cannot be true (a high under its body, a band upside down, falling quantiles, an anchor that is not a closed bar of the form's interval, an element form naming an interval) with what is offered instead; a lower epoch than the model's standing forecast is refused; past Models per market the answer names the setting. Answers the arrival, the state, where the steps end, the replaced epoch, and each chart of the market with where the forecast stands on it.
Declaration
client.Forecast
public Task<JsonNode?> Put(string bench, object forecast, long? stepsTotal = null, CancellationToken ct = default)Parameters
| Name | Type | What it is | |
|---|---|---|---|
bench | string | required | The workbench's uri. |
forecast | object | required | The forecast, as forecast_spec describes it. |
stepsTotal | long? | optional | **A long forecast in chunks**the steps the whole forecast will hold. Its steps here are the first chunk; the rest come by forecast_put_chunk, and it arrives - for every reader - when the last one lands. |
Returns
Task<JsonNode?> — the tool’s answer as a JsonNode.
What it answers
Answers the arrival, the state, where the steps end, the replaced epoch, and each chart of the market with where the forecast stands on it.
Example
await client.Forecast.Put(bench, "…")PutChunk#
Send the next chunk of a long forecast · tool forecast_put_chunk
Appends steps to a forecast opened with forecast_put and steps_total, from_step being the count already sent. Until the last chunk lands the forecast exists for no reader (the legend says receiving N of M); at the last one the whole forecast is checked as forecast_put checks it and arrives then, stamped put_ms. A chunk out of order, of another epoch or past the total is refused by name. Answers have and of, and at the last chunk forecast_put's answer.
Declaration
client.Forecast
public Task<JsonNode?> PutChunk(string bench, string symbol, string model, long epoch, long fromStep, object steps, CancellationToken ct = default)Parameters
| Name | Type | What it is | |
|---|---|---|---|
bench | string | required | The workbench's uri. |
symbol | string | required | |
model | string | required | |
epoch | long | required | The epoch the forecast was opened with. |
fromStep | long | required | The index (0-based) of this chunk's first step: the count of steps already sent. |
steps | object | required | The steps, as forecast_spec's steps. |
Returns
Task<JsonNode?> — the tool’s answer as a JsonNode.
What it answers
Answers have and of, and at the last chunk forecast_put's answer.
Example
await client.Forecast.PutChunk(bench, "SYN-DOCS", "…", 1, 1, "…")PutMany#
Put several forecasts at once · tool forecast_put_many
Hands over up to 256 forecast_specs to one workbench in one call, every one arriving at the same instant of its clock: several markets and several models. Each refused one is named by its index with why; all_or_nothing lands none when one is refused. Answers put (each landed forecast as forecast_put answers it) and refused [{index, why}].
Declaration
client.Forecast
public Task<JsonNode?> PutMany(string bench, object forecasts, bool? allOrNothing = null, CancellationToken ct = default)Parameters
| Name | Type | What it is | |
|---|---|---|---|
bench | string | required | The workbench's uri. |
forecasts | object | required | The forecasts, each a forecast_spec: several markets, several models, at most 256. |
allOrNothing | bool? | optional | True lands none when one is refused; false (the default) lands every one that can be, and names the rest. |
Returns
Task<JsonNode?> — the tool’s answer as a JsonNode.
What it answers
Answers put (each landed forecast as forecast_put answers it) and refused [{index, why}].
Example
await client.Forecast.PutMany(bench, "…")Report#
Report how a model's forecasts did · tool forecast_report
Scores a model's journalled forecasts on one market against the bars the workbench's history holds, up to its clock - each step only if it had not closed when its forecast arrived: per step and overall, the count, the close's mean absolute error, its percentage, the root mean square error, the mean signed error, the direction hit rate (the close's move from the anchor's own close), each band's coverage against its nominal p, the quantiles' pinball loss, the samples' CRPS, and the mean latency (put_ms after the anchor's close). Steps still to close are pending; steps a late arrival could already see are late and unscored.
Declaration
client.Forecast
public Task<JsonNode?> Report(string bench, string symbol, string model, long? last = null, long? sinceMs = null, string? source = null, CancellationToken ct = default)Parameters
| Name | Type | What it is | |
|---|---|---|---|
bench | string | required | |
symbol | string | required | |
model | string | required | |
last | long? | optional | Only the newest N forecasts. |
sinceMs | long? | optional | Only forecasts that arrived at or after this instant, UTC ms. |
source | string? | optional | Live or eval; omitted, both. |
Returns
Task<JsonNode?> — the tool’s answer as a JsonNode.
What it answers
What the tool's description says.
Example
await client.Forecast.Report(bench, "SYN-DOCS", "…")