Bentrix Docs
HomePricingDashboard

The trial ledger

Every run, batch cell, re-run and walk-forward window is written down before its result is shown, in a file nothing can remove a line from — so the number of things you tried is part of every result.

Why count trials

A result means less the more things were tried to find it. A Sharpe ratio of 1.5 from the first idea you tested is evidence. The same 1.5 from the best of 400 settings is roughly what 400 settings of no skill would produce. The statistics that tell these apart, the deflated Sharpe ratio, the probability of overfitting and the minimum backtest length, need one number above all: how many trials there were.

That count is easy to lose: a run deleted, a strategy renamed, a batch thrown away, a notebook closed. It undercounts exactly when it matters. So Bentrix keeps the count in a file of its own, and that file has no door that removes a line.

01What is written

Every trial is written before its result exists, and its result is written after it:

  • a run of a strategy;
  • each cell of a batch;
  • a re-run;
  • each window of a walk-forward, its in-sample cells and its out-of-sample run;
  • each pass of a MetaTrader optimisation you import;
  • a family of candidates you tried in your own code, when you record it (below).

A trial's line names the strategy, its version and digest, the tick model, the start of its span, and its batch and figures. A result's line names the trial it answers, its trades and its net.

The Strategies panel shows each strategy's count, 26 trials. The count is never reset. A new version of a strategy is still that strategy, so its trials keep counting.

02A chain, so a gap shows

The ledger is one file, strategies/ledger.jsonl in your workspace, only ever appended to. Each line carries the hash of the line before it, so a line edited, removed or put back in another order is found. The ledger then says where its chain stops following: The trial ledger stops following at its line 412. No run starts until it is whole again.

Nothing in it is signed. Someone who rewrites the whole file and every hash can fool it, and the ledger says so of itself. It guards against a count lost by accident or by a door, not against the person whose file it is.

03Trials made outside Bentrix

A grid you searched in your own notebook, or an event study's hundred cells, is trials too. Record it as one family with its count, before you look at its result: its name, how many candidates, what was tried, and if you like a digest of your pre-registration. It joins the ledger's union, the count of everything ever tried, and never leaves it. When you know what came of it, write that as the family's result.

A strategy run's own trials are Bentrix's to write. They cannot be recorded by hand.

04Reading it

The ledger answers its lines in order, each strategy's trials and their results, every family's count, and the union. A correction across everything you have ever tried takes the union. A correction for one strategy takes its own count.

05From a program

ledger_query (with strategy for one strategy's trials and their count) and ledger_record (a family, kind: "trial", written before its result; and later kind: "result"). See the SDK guide on testing honestly.

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