How to Evaluate an EA or Trading Bot: Keep, Rework or Rebuild

To evaluate an existing Expert Advisor or trading bot, work through five steps in a fixed order: code and build, data and tests, operations and monitoring, documentation and rights, and finally backtest versus live results. Each step comes with a few concrete questions, and together the answers lead to one of three outcomes: keep the system and fix small issues, rework specific parts, or rebuild it from a written specification. The order matters. Without source code that compiles, nothing else can be verified, and a comparison of live and backtest results only means something once the test setup can be reproduced. The examples use MetaTrader 5 and MQL5 as of November 2026; the questions apply to Python bots as well.

Keep, rework or rebuild: what the evaluation decides

An evaluation answers one question: is the existing system a sound base for the coming months of operation? There are three possible outcomes.

OutcomeTypical findingsNext step
KeepSource complete and building, tests reproducible, operations monitored, documentation current, live results explainableFix the small findings, keep monitoring
ReworkCore logic sound, but gaps in failure handling, tests, monitoring or documentationFix the listed parts, then repeat steps 2 and 5
RebuildNo source or no build, logic that cannot be traced to rules, structural risks such as uncapped position increasesWrite a specification from the observed behavior, then build and test anew

Work through the five steps in order, because each depends on the one before. The same steps apply to an EA bought on the MQL5 Market, code taken over from a previous developer and a bot written with an AI coding assistant. Record every finding with a severity and an estimate of the effort to fix it; the outcome follows from the list, not from a general impression. A fourth outcome is always possible: retiring the system, if the evaluation shows that it cannot be operated safely and a rebuild is not worth it.

Step 1: code and build

  • Do you have the complete source: the MQ5 file, all include files (MQH), libraries and resources?
  • Does it compile in the current MetaEditor without errors? From the command line, metaeditor64.exe with /compile builds a file or all files of a folder, and /log writes a compilation log next to the source. According to the help, files that already have a compiled version are not recompiled, so run the check on a clean copy and keep the log with the evaluation.
  • Is the source the version that runs live? Compile it and compare its behavior with the running EX5 file on the same test period and inputs.
  • Is there a version history? MetaEditor offers Git-based version control through MQL5 Algo Forge, where repositories are private by default; any Git repository will do.
  • Does the EA import DLLs? The platform marks the setting “Allow DLL imports” as potentially dangerous and recommends disabling it for unknown Expert Advisors; MQL5 Market products must not call DLLs at all.
  • Are broker-specific values hard-coded: symbol names with suffixes, filling modes, stop distances, time offsets?

If you only have the EX5 file, the evaluation is limited to behavior. MetaEditor protects compiled programs against decompilation, and the Market rules forbid buyers to decompile products. You can test what the EA does, but not review or change how it does it. For a Python bot, the questions are the same; a pinned list of dependencies and a clean install replace the MetaEditor build.

Keep if the source is complete, builds without errors, matches the live version and has a history. Rework if it builds with warnings, contains hard-coded broker values or has no version control yet. Rebuild if there is no source, the source does not build or does not match the live version, or the EA depends on a DLL nobody can maintain.

Step 2: data and tests

  • Can you reproduce the reference backtest? The tester saves inputs as set files, which can be moved between computers, and test settings in ini files. With both, a second person can run the same test.
  • Which data and tick generation mode were used, on which broker server, with which execution delay and costs?
  • Was part of the history held back from optimization, and how did the EA do there?
  • Are there tests for the failure cases: rejected orders, requotes, partial fills, a lost connection, a restart with open positions?
  • What can the tester not cover? Alert(), MessageBox(), SendMail(), SendNotification() and WebRequest() are not executed in the Strategy Tester, and Print() output is suppressed during optimization except in OnInit(). Alerts and external connections need a test on a demo account.

Tests answer whether the code does what the rules say. They do not answer whether the rules make money. Keep the two questions apart: an evaluation can answer the first; for the second, step 5 only shows whether live trading matches the test.

Keep if the reference test can be reproduced, results on a held-back period exist and the failure cases are tested. Rework if the test can be reproduced but failure cases or demo tests are missing. Rebuild if the reference results cannot be reproduced at all and the rules behind them cannot be reconstructed from the code.

Step 3: operations and monitoring

  • Where does the EA run: a home PC, a rented server or MetaQuotes’ virtual hosting? Who has access?
  • What happens after a restart of the terminal or the server? Does the EA find its open positions and orders again by magic number and symbol, or does it lose track of them?
  • Which protective settings are active? MetaTrader 5 can disable automated trading when the account, the profile or a chart’s symbol or period is switched.
  • Who receives alerts, through which channel, and who reacts? An alert that nobody reads is not monitoring.
  • Where are the logs, and how long are they kept?
  • How are updates handled: new terminal builds, broker changes to symbols or trading hours, new EA versions?

The virtual hosting has rules of its own. DLL calls are forbidden there, automated trading is always allowed, synchronization only runs from the local platform to the virtual one, and accounts with one-time password authentication cannot be used. Its platform and Expert Advisor logs have to be requested from the local terminal. If an EA stops trading for no visible reason, work through the MT5 diagnostic checklist before changing code.

Keep if the EA recovers its state after a restart, alerts reach someone who reacts and logs are kept. Rework if alerting, reconciliation after a restart or a runbook are missing but can be added. Rebuild if the EA keeps its state only in memory and that design runs through all of its trading logic.

Step 4: documentation and rights

Documentation decides whether someone other than the author can operate and change the system. Ask for:

  • a description of the rules the code implements, precise enough to write tests against;
  • a list of inputs with meaning, unit and the values used live;
  • a change log that links versions to dates and reasons;
  • a runbook: start, stop, restart, and what to do after each kind of alert.

Then the rights: whether you may change the code, or have someone else change it, depends on the agreement with its author, and the source code handover checklist covers ownership, licenses and what a takeover should include. For an EA bought on the MQL5 Market, the rules are fixed: the seller sets between 5 and 20 activations, purchased products cannot be returned, new activations always install the latest version, and buyers who want to keep an older version have to save it themselves before updating.

Keep if rules, inputs, change log and runbook exist, match the code and the rights are clear. Rework if documentation is missing but can be written from the code. Rebuild if your rights do not cover changes, for example a license to use a compiled file only, so that any change requires a new system.

Step 5: backtest versus live results

Only now compare results. Re-run the backtest over exactly the live period, on the live broker server, with “Every tick based on real ticks”, a realistic delay and the live set file. Then pair each live trade with its counterpart in the test:

  • Match rate: how many live trades have a counterpart in the test, and the other way round.
  • Price differences of matched trades at entry and exit, in points.
  • Costs per trade: commission, swap and fees, live against test.

A high match rate with worse prices points to execution and costs. Many unmatched trades point to data, time zone handling or code that behaves differently live. The full procedure, with a metric for each cause, is in backtest vs live results: how to diagnose the gap.

Keep if most trades match and the price and cost differences are within what you expected. Rework if the differences trace back to a specific cause, such as test settings, a time zone error or costs. Rebuild if the differences cannot be explained, or come from logic that only runs live and cannot be separated from the rest.

Limits and risks of an evaluation

  • An evaluation describes the state on the day it is done. A new terminal build, a broker change or a new EA version can change it.
  • A code review finds many errors, but not necessarily all of them.
  • Black-box tests of an EX5 file only cover the situations that occurred in the test.
  • An evaluation says nothing about whether the strategy will be profitable; nobody can seriously promise that.
  • Automated trading with leverage can lose money fast, even when the software works exactly as specified.

The result is therefore a list of findings with severity and effort, plus the recommendation to keep, rework or rebuild. It is not a forecast of results.

Next steps: what to collect before an evaluation

  1. The source code with all include files, or the EX5 file and its license if no source exists.
  2. A build log from the current MetaEditor.
  3. The set files and tester settings of the reference backtest, and its report.
  4. The live account statement for the comparison period and the EA’s logs.
  5. Specification, input list, change log and runbook, as far as they exist.
  6. Any agreement that covers the rights to the code.

With this package, the five steps can be worked through in order. For an independent evaluation, the page on trading system code review describes the packages, including a takeover audit. I work with a copy of the code and need no account credentials.

Frequently asked questions

Can you evaluate an EA without the source code?

Partly. Without the MQ5 source you can test the EA in the Strategy Tester and on a demo account and compare live with backtest results, but you cannot review or fix its logic. MetaEditor protects compiled EX5 files against decompilation, and the MQL5 Market rules forbid decompiling bought products. If the EA needs changes, a rebuild from a written specification is usually the only route.

When should a trading bot be rebuilt rather than fixed?

When the source is missing or does not build, when the logic cannot be traced to written rules, when risk handling is structurally unsafe, for example with uncapped position increases, or when the necessary fixes would touch most of the code. A rebuild then starts from a specification derived from the old system’s documented behavior and is tested against it.

Can an EA that uses DLLs run on MetaQuotes’ virtual hosting?

No. DLL calls are forbidden on MetaQuotes’ virtual hosting, and products in the MQL5 Market must not call DLLs at all. The platform also marks the setting that allows DLL imports as potentially dangerous and recommends disabling it for unknown Expert Advisors. An EA that depends on a DLL therefore has to run on a terminal you control, or be rebuilt without the DLL.

How long should an EA run on a demo account before you trust it?

There is no fixed duration. Define the exit criteria in advance: enough trades to compare with a backtest of the same period, and every operational event at least once, such as a restart with open positions, a lost connection, a weekend and a swap rollover. Until these have occurred and been explained, the demo run is not finished.

Does an evaluation tell you whether the EA will be profitable?

No. An evaluation checks software and methodology: whether the code builds, does what the rules say, handles failures, is operated safely and documented, and whether live trading matches the test. Whether the rules will make money in the future is something no review can promise.

Sources and status

As of November 2026. Third-party rules, prices and APIs may have changed since; the providers' current documentation and the official texts are authoritative.

This article is also available in German: EA oder Trading-Bot bewerten: Bestandsaufnahme in 5 Schritten.

Taking over an Expert Advisor or trading bot and unsure whether to keep, rework or rebuild it? Get in touch — a free intro call clarifies which package fits, from a takeover audit to a full system audit. More: Trading system code review and audit.