AMMDocumentationWebsite ↗
how to · 5 min read

Configure and run a backtest

Test an algorithm against a complete historical instrument and account configuration, then retain the evidence needed to repeat it.

Reviewed 2026-10-24 · Windows & macOS

On this page

Start with a reproducible question#

A backtest runs an algorithm through historical observations using simulated accounts inside AMM. It never connects those execution accounts to a broker. A market-data account can still be required to obtain history. Choose the instrument, exact provider, dates, fixed trade size and execution assumptions before comparing results.

For example, test an index CFD strategy on the selected broker's exact symbol, a gold strategy on its own contract, or an equity strategy on adjusted share data. Reusing an index's multiplier or lot size for a currency pair changes the meaning of the result. Symbol text alone does not establish matching contract economics.

AMM completed backtest report with equity, drawdown, daily P&L and trade results in dark modeView full-size screenshot ↗
A completed AAPL strategy backtest with 325 trades and 650 orders, showing equity, drawdown, daily P&L, performance metrics and individual trade results.

Build the run#

  1. Add a New Backtest workspace item. Its default arrangement contains Configure, Runs, Report and Output.
  2. In Strategy, choose the algorithm. The picker shows its plugin folder and parameters. Use the exact folder/name identity; another plugin with a similar name is a different selection. The picker shortcut is ⌘⇧P on macOS or Ctrl+Shift+P on Windows while the form has focus.
  3. Review every parameter. Group headings distinguish strategy logic, position sizing and execution policy. Changed values have a reset action. Set sizing appropriate to this instrument; a historical test does not establish a suitable live risk budget.
  4. Configure Simulated accounts. Give each account the name used by algorithm code, its currency, starting cash, netting or hedging mode, margin rules, optional stop-out and swap settings. The first account commonly uses the alias primary.
  5. Configure Instruments. Select the exact symbol, data feed and feed account, bind an execution account, and review source and strategy resolutions. Use Advanced to inspect costs, multiplier, leverage, tick/pip sizes, units per lot and quantity limits. Simple and Advanced edit the same contract.
  6. Set the UTC period, reporting currency, warmup, indicator history and execution destination. Supply historical FX routes when account, profit, commission or reporting currencies require conversion.
  7. Review the run bar. A blocked run names the missing fields; Go to first takes you to the next problem. Read the estimate before choosing Run backtest or ⌘/Ctrl+Enter.

An instrument's default values are starting points. After symbol edits, Instrument Manager can resolve economics; explicitly edited values are retained. Review the resulting contract rather than assuming every default is the broker's current rule.

Understand additional instruments#

An algorithm can declare instruments from code. Declared by <algorithm> lists the preview with a code marker and Open code when source is available. These rows are read-only dependencies. The run bar includes them in the instrument count.

The algorithm can also add instruments during execution. A preview cannot predict every callback-time addition. The finished Contract view records configured, declared and added-during-run instruments, including the original addition time. Loading the run puts configured inputs back into the editable form without duplicating code-owned instruments.

For historical equity universes, use Daily index constituents. Select an imported Nasdaq-100 or S&P 500 dataset and an explicit equity contract template, then Check range and preview day. Missing historical membership coverage is an error. Today's members are not a substitute for historical membership.

Choose execution assumptions deliberately#

Each instrument uses Standard or cTrader-style simulated fills. Asset-class defaults, explicit request settings and algorithm declarations can affect the effective choice; the report records which was used. This changes simulated execution behaviour, not the historical data provider.

Tick-source tests require valid chronological quotes. Invalid recorded quotes defaults to Reject the run. Choosing Skip quotes and affected bars explicitly abstains during affected intervals; exposure during those intervals can leave drawdown unobserved. A successful run with that policy is not equivalent to complete executable quote coverage.

Stress recorded spreads widens supported raw recorded tick quotes with a fixed recipe. It requires compatible source and grid settings. For Alpaca equities, Use recorded bid/ask for execution offers distinct quote-window modes with strict restrictions. The default bar-triggered mode can miss quote-only crossings in skipped minutes; read its disclosure before interpreting stop or limit behaviour.

Futures feeds offer contract selection, and continuous series add Auto roll and Prices. Spot crypto uses native base units and exact venue quantity rules. Replay recorded depth appears only for supported feeds and requires actual recordings. Data coverage and algorithm depth-consumer warnings remain relevant even when the checkbox is enabled.

Monitor, preserve and recover#

The server streams progress into Report and Output. Cancel run is a separate action. Closing or moving the workspace item stops showing progress there; the server run continues. Reopen it from Runs. Keep a run ID and request JSON with important research decisions.

The ordinary Backtest Configure form does not preserve every unsaved widget edit when its panel is hidden behind another panel. Keep it visible while preparing a run, or copy the request before rearranging it. Saved results are the durable research record.

An offline banner offers Retry now and Change server. For missing history, review the exact feed/account/date and use Open Downloads when offered. For invalid contracts, fix the named grid, currency or margin field. Do not weaken validation merely to make a test start. Inspect the resulting report before using it in optimisation or a portfolio.

Application screenshotOpen original ↗