Find out a strategy does not work before money does.
Every trial counted in a ledger nothing can erase. The best result judged against the best that luck alone would give. Settings chosen on one stretch and tested on the next. One run reshuffled, thinned and filled worse. Your broker's real slippage. Another engine's trades beside Bentrix's. And Bentrix's own engine proving itself on your data.
The best of forty trials, against the best that forty trials of no skill would show by luck.
Validation
What it does, part by part.
Statistics against chance Plus
The best of many is not the same as good
Every run, batch cell and walk-forward window is written to a trial ledger before its result exists, and no door removes a line. A batch's best cell is then judged over every trial ever counted: its deflated Sharpe ratio, the probability of backtest overfitting, the minimum backtest length and the haircut. Hansen's and Romano–Wolf's tests judge a family of candidates at once.
A chained ledger of trials showing a missing line, and searches counted as families.
Robustness Plus
One run, a thousand ways it could have gone
The same trades in another order, a tenth of them missing, every fill made worse, and as many random entries held as long: each answered as its 5th, 50th and 95th percentile, from one fixed seed. And on which kind of day — quiet, middle or busy — the money was made.
Bentrix reads your real account's deals off MetaTrader, re-prices each on the recording of that account's own history, and measures the shortfall per market and the delay from order to fill. Then it makes a laboratory workbench that fills like your broker, and you run the strategy again.
Compare a run's trades with MetaTrader's tester or another backtester, line by line, hashed, and see the first trade where they part. Import a MetaTrader optimisation and its best pass is judged over every pass. And sixteen checks prove Bentrix's own fills, costs, clock and determinism on your own recording.
Run a grid of a saved strategy, wait for every cell, and read the best cell against chance — in each of the nine languages.
state = client.workspace.get_state(depth="benches")
bench = state["selected"]
made = client.strategy.batch("rsi pullback", bench, {"studies.rsi.settings.period": [10, 14, 20], "exits.stop.atr.times": [1.0, 1.5, 2.0]})
batch = made["uri"]
b = client.strategy.batch_get(batch)
for _ inrange(1200):
b = client.strategy.batch_get(batch)
if b["record"] is notNone:
break
time.sleep(0.5)
print("deflated Sharpe:", b["statistics"]["dsr"])
print("overfitting:", b["statistics"]["pbo"])
print("trials:", b["statistics"]["trials"]["in_ledger"])
const state = await client.workspace.getState({ depth: "benches" });
const bench = state.selected;
const made = await client.strategy.batch({ strategy: "rsi pullback", bench, grid: { "studies.rsi.settings.period": [10, 14, 20], "exits.stop.atr.times": [1.0, 1.5, 2.0] } });
const batch = made.uri;
let b = await client.strategy.batchGet({ batch });
for (let w = 0; w < 1200; w++) {
b = await client.strategy.batchGet({ batch });
if (b.record != null) break;
awaitnewPromise((r) => setTimeout(r, 500));
}
console.log("deflated Sharpe:", b.statistics.dsr);
console.log("overfitting:", b.statistics.pbo);
console.log("trials:", b.statistics.trials.in_ledger);
var state = await client.Workspace.GetState(depth: "benches");
var bench = state!["selected"]?.GetValue<string>() ?? "";
var made = await client.Strategy.Batch("rsi pullback", bench, new Dictionary<string, object?> { ["studies.rsi.settings.period"] = new object?[] { 10, 14, 20 }, ["exits.stop.atr.times"] = new object?[] { 1.0, 1.5, 2.0 } });
var batch = made!["uri"]?.GetValue<string>() ?? "";
var b = await client.Strategy.BatchGet(batch);
for (var w = 0; w < 1200; w++)
{
b = await client.Strategy.BatchGet(batch);
if (b!["record"]! is not null) break;
await Task.Delay(500);
}
Console.WriteLine($"deflated Sharpe: {b!["statistics"]!["dsr"]!}");
Console.WriteLine($"overfitting: {b!["statistics"]!["pbo"]!}");
Console.WriteLine($"trials: {b!["statistics"]!["trials"]!["in_ledger"]!}");
state := must(client.Workspace.GetState(ctx, mcp.WorkspaceGetStateArgs{Depth: mcp.Ptr[string]("benches")}))
bench := text(at(state, "selected"))
made := must(client.Strategy.Batch(ctx, mcp.StrategyBatchArgs{Strategy: "rsi pullback", Bench: bench, Grid: map[string]any{"studies.rsi.settings.period": []any{10, 14, 20}, "exits.stop.atr.times": []any{1.0, 1.5, 2.0}}}))
batch := text(at(made, "uri"))
var b any = must(client.Strategy.BatchGet(ctx, mcp.StrategyBatchGetArgs{Batch: batch}))
for w := 0; w < 1200; w++ {
b = must(client.Strategy.BatchGet(ctx, mcp.StrategyBatchGetArgs{Batch: batch}))
ifat(b, "record") != nil {
break
}
time.Sleep(500 * time.Millisecond)
}
fmt.Println("deflated Sharpe:", at(b, "statistics", "dsr"))
fmt.Println("overfitting:", at(b, "statistics", "pbo"))
fmt.Println("trials:", at(b, "statistics", "trials", "in_ledger"))
auto state = client.workspace.get_state(WorkspaceApi::GetStateArgs().depth("benches"));
auto bench = (state["selected"].is_string() ? state["selected"].str() : std::string());
auto made = client.strategy.batch(StrategyApi::BatchArgs("rsi pullback", bench, Json::Object{{"studies.rsi.settings.period", Json::Array{10, 14, 20}}, {"exits.stop.atr.times", Json::Array{1.0, 1.5, 2.0}}}));
auto batch = (made["uri"].is_string() ? made["uri"].str() : std::string());
Json b = client.strategy.batch_get(StrategyApi::BatchGetArgs(batch));
for (int w = 0; w < 1200; w++) {
b = client.strategy.batch_get(StrategyApi::BatchGetArgs(batch));
if (!b["record"].is_null()) break;
std::this_thread::sleep_for(std::chrono::milliseconds(500));
}
std::cout << "deflated Sharpe:" << " " << b["statistics"]["dsr"].dump() << std::endl;
std::cout << "overfitting:" << " " << b["statistics"]["pbo"].dump() << std::endl;
std::cout << "trials:" << " " << b["statistics"]["trials"]["in_ledger"].dump() << std::endl;
state = client.workspace.get_state(; depth = "benches")
bench = state["selected"]
made = client.strategy.batch("rsi pullback", bench, Dict{String,Any}("studies.rsi.settings.period" => Any[10, 14, 20], "exits.stop.atr.times" => Any[1.0, 1.5, 2.0]))
batch = made["uri"]
b = client.strategy.batch_get(batch)
for _ in1:1200
global b = client.strategy.batch_get(batch)
b["record"] !== nothing && break
sleep(0.5)
endprintln("deflated Sharpe:", " ", b["statistics"]["dsr"])
println("overfitting:", " ", b["statistics"]["pbo"])
println("trials:", " ", b["statistics"]["trials"]["in_ledger"])
state <- client$workspace$get_state(depth = "benches")
bench <- state$selected
made <- client$strategy$batch("rsi pullback", bench, list(studies.rsi.settings.period = list(10, 14, 20), exits.stop.atr.times = list(1.0, 1.5, 2.0)))
batch <- made$uri
b <- client$strategy$batch_get(batch)
for (w in1:1200) {
b <- client$strategy$batch_get(batch)
if (!is.null(b$record)) break
Sys.sleep(0.5)
}
cat("deflated Sharpe:", format(b$statistics$dsr), "\n")
cat("overfitting:", format(b$statistics$pbo), "\n")
cat("trials:", format(b$statistics$trials$in_ledger), "\n")
let state = client.workspace().get_state(mcp::WorkspaceGetStateArgs::new().depth("benches"))?;
let bench = state["selected"].as_str().unwrap_or_default().to_string();
let made = client.strategy().batch(mcp::StrategyBatchArgs::new("rsi pullback", bench.clone(), serde_json::json!({"studies.rsi.settings.period": [10, 14, 20], "exits.stop.atr.times": [1.0, 1.5, 2.0]})))?;
let batch = made["uri"].as_str().unwrap_or_default().to_string();
letmut b = client.strategy().batch_get(mcp::StrategyBatchGetArgs::new(batch.clone()))?;
for _ in0..1200 {
b = client.strategy().batch_get(mcp::StrategyBatchGetArgs::new(batch.clone()))?;
if !b["record"].is_null() {
break;
}
std::thread::sleep(std::time::Duration::from_millis(500));
}
println!("deflated Sharpe: {}", b["statistics"]["dsr"]);
println!("overfitting: {}", b["statistics"]["pbo"]);
println!("trials: {}", b["statistics"]["trials"]["in_ledger"]);
How it works
Four steps, in order.
CountEvery trial, in a ledger nothing erases.
Choose and test apartA batch, then a walk-forward.
Shake itReshuffle, thin, fill worse, random entries.
Check the groundYour own fills, another engine, the battery.
Packages
Learn on Free. Trade on Plus. Build on Pro.
What each package holds of this page. While the beta lasts, Plus and Pro are free to take: you choose your package on your account page, with no payment.
Bentrix is in beta. Plus and Pro are free to take.
One download for Windows. Choose your package on your account page, with no payment, while the beta lasts; a feature of Plus or Pro carries its badge in the application, so nothing changes by surprise.