Write a strategy's document, validate it, save it as a version, and run it on a replay — step by step.
01Step by step
- In the laboratory, open the Strategies panel and press +. The editor opens with a starting document.
- Fill in its name, its markets and its interval, the indicators its rules read, and its rules: when to buy, when to sell, when to close. The editor holds the strategy as a JSON document; the strategy document, field by field explains every field, its values and what refuses it, with examples to copy — the editor's Every field explained opens it.
- Press Validate. Each problem is named by its field — no markets, nothing opens a position — and what is only a warning is said as such.
- Press Save as the next version.
- Select a laboratory workbench holding the strategy's markets, and press Run….
- On the Run sheet choose the pace and whether the workbench is armed. Unarmed, the run decides and records every intention without sending an order — a safe first look.
- Press Run. The Run window opens.
02The Run window
- The counts as it runs: candles read, intentions emitted, orders sent, refused, held back, and not sent because the workbench was not armed.
- Report — once the run ends, MetaTrader's tester report: net profit, gross profit and loss, profit factor, expected payoff, drawdowns, the share of winning trades, the largest and average trades, consecutive wins and losses. It stays on your computer; it is never published.
- Equity — the balance and the equity, candle by candle, with the largest drop as a figure.
- Trace — for every candle and every market, what each rule decided and what each intention became.
On the chart, each intention is a small triangle under the candle it was taken on — up for a buy, down for a sell, hollow for a close; hover it to see what it became (buy · sent #41).
A running or paused strategy shows as a pill on its workbench's row in the rail; press it to open the Run window. Each run's row in the panel can be paused, resumed, switched between paces, or stopped.
03Rules are read at the close
A strategy reads its rules at each candle's close, with only the candles that have closed. It cannot see the candle still forming, let alone a later one. An indicator that needs future candles to be drawn — Fractals, ZigZag, Ichimoku's lagging line — is refused in a strategy for that reason.