For quants›Strategies

Rules that run, on a clock they cannot cheat.

Write a strategy as rules — conditions, entries, exits, sizing, sessions, limits — or as an Assay script. Test it in the laboratory, across a grid of settings and on windows it never chose from; then load it onto paper or your real account.

4
rule slots
4
entry kinds
grid
batch and walk-forward
Strategiesillustration
A strategy: its rules are read at each candle's close, and each decision is drawn on the chart as an intention.

Strategies

What it does, part by part.

The document

Every rule, in one file you can read

Buy, sell and close slots built from conditions an indicator declares and comparisons of values; market, limit, stop and stop-limit entries; stops and targets in points, ATR or R; partial targets, breakeven, trailing; sessions and daily limits.

  • Validated field by field before it runs
  • Each save a new version, named by its contents
  • Every field explained in the Docs
In the Docs
A strategy document checked field by field, and its saved versions.

A batch Plus

One strategy, a grid of settings

Choose the settings to vary and their values; each cell is a replay of its own, with its record, its trades and its sensitivity to the tick model and to the spread.

  • Up to a hundred cells
  • Each cell's own record, kept
  • Sensitivity to costs, said
In the Docs
A grid of replays filling.

Walk-forward Plus

Choose on one window, test on the next

Settings chosen on one stretch of history are tested on the stretch after it, then the windows slide — so a result is judged on candles the choice never saw.

  • Anchored or rolling windows
  • Every test window out of sample
  • The tests that tell luck from method
In the Docs
Walk-forward windows sliding.

A model's output

Let a model decide, under your rules

A rule reads any output of your model by its arrival — the probability, its act under your meaning, a level's price. Or let a model's target position or portfolio weights drive the run, ordering only the difference; or let a second model size each trade, holding back the ones it doubts.

  • output:<model>.<name> in any condition
  • A target slot: hold what the model says
  • A size gate for each entry
  • Plus in the Laboratory and on paper
In the Docs
A strategy following a model's target position.

Paper and Real

From the laboratory to the market

A strategy is written and tested in the laboratory and loaded onto a paper or a real workbench. On a real account its orders follow your Automations mode — proposed for your Send by default.

  • Every intention recorded
  • MetaTrader's tester report for each run
  • Positions left alone when it stops, unless you choose
  • Plus a strategy on a real account
In the Docs
An order waiting for Send.

In code

A strategy document

The rules of a moving-average cross with an ATR stop and a target of twice the stop — checked by strategy_validate on every build of the Docs.

{
  "markets": ["EURUSD"], "interval": "H1",
  "studies": {
    "fast": {"kind": "ema", "settings": {"shape": "period", "period": 20}},
    "slow": {"kind": "ema", "settings": {"shape": "period", "period": 50}},
    "atr":  {"kind": "atr", "settings": {"shape": "period", "period": 14}}
  },
  "rules": {
    "buy":  {"compare": {"cross_up":   ["fast", "slow"]}},
    "sell": {"compare": {"cross_down": ["fast", "slow"]}}
  },
  "exits":  {"stop": {"atr": {"study": "atr", "times": 1.5}}, "target": {"r": 2}},
  "sizing": {"mode": "risk_pct", "value": 1}
}

How it works

Four steps, in order.

  1. Write itIn the editor: rules as JSON, or an Assay script.
  2. ValidateEach problem named by its field.
  3. TestA run, a batch, a walk-forward — in the laboratory.
  4. Load itOnto paper or your real account.

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.

On this pageFreePlusPro
Strategies running at once1∞∞
Cells in a batch—100∞
The validation layer—✓✓
A strategy that reads a model—✓✓
A strategy that reads a model, on a real account——✓
Strategies on a real account at once—1∞

∞ is no limit. What exceeds a package is locked, never deleted.Every package side by side

Good to know

What to expect, plainly.

Closed candles only

Rules are read at the last closed candle, never the forming one.

Not a result machine

A test shows what rules did on that history under those costs. It is not a forecast of what they will do.

Your orders

On a real account nothing is sent without your Send unless you choose One-click.

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.