Skip to content

Testing Expert Advisors

Start with written rules and the exact source that implements them. Compile locally, record inputs and prepare behaviours to inspect. An EA can build while entering on the wrong bar, repeating orders or calculating volume incorrectly, so check behaviour before focusing on profitability.

Xen does not run your local Strategy Tester or reproduce broker execution from a conversation. Perform those tests in MetaTrader, then return concrete results when a code change or report explanation is needed.

Run a small visual test

Select the compiled EA in Strategy Tester and choose symbol, timeframe, dates, inputs and account settings. Begin with a short visual test where individual signals can be inspected. Check the first entry, repeated signals, volume and protective orders against the specification.

Inspect exits and management as carefully as entries. Test session boundaries, opposite signals and position limits. Record expected and actual actions when they differ. MetaQuotes' Strategy Tester guide explains its setup and execution controls.

Choose data and modelling deliberately

The modelling mode changes the events an EA receives. Intrabar logic needs a test representing those events; an open-price test cannot establish every intrabar outcome. Every tick based on real ticks uses available broker tick history and may require downloading data. See the official tick-generation explanation.

Retain modelling choice, data source and costs with results. Spread, commission, execution delay and symbol properties affect the outcome. Match the test account model to the design, particularly for several positions or partial closes. These assumptions can alter results without a source change.

Extend the test and retain evidence

Once basic behaviour works, test longer periods and conditions beyond the sample used to choose parameters. Inspect loss sequences and unusual events rather than only aggregate return. Optimisation follows behaviour checks, and a better fit to one sample needs confirmation elsewhere.

Export the workbook and retain source and inputs beside it. Use Strategy Tester Analysis to review the report in Xen. Observe the EA on a demo account with intended settings, checking logs and orders before deciding whether further changes or testing are needed.