Orometra

Guide

How to export your MT5 optimization results to XML

To analyze an optimization outside MetaTrader 5, in Excel or in Orometra, you need its results as a file. MT5 does it in a few clicks, but a couple of details decide whether the file is any use. This guide walks you through the whole process: setting up the tester, exporting both tables, checking the files and the mistakes that ruin the analysis.

Before optimizing: set up the tester

Open the Strategy Tester with Ctrl+R (or View → Strategy Tester). In the Settings tab you choose the EA, the symbol, the timeframe and the dates. Three settings there decide what you will be able to conclude later:

In the Inputs tab, tick the parameters you want to optimize and give each one a Start, a Step and a Stop. The ones you leave unticked keep their Value during the whole optimization. Before you launch it, multiply the number of values of each parameter: that is how many backtests MT5 will run in a complete search.

Export the optimization results

When the optimization finishes, open the Optimization Results tab and make sure you are looking at the table, not at the optimization graph. Right-click anywhere in the table and choose the option to export to XML (in English, “Export to XML”; the exact wording varies with the MT5 version and language). MT5 asks where to save it: use a name you will recognize later, for example EURUSD-H1-2020-2024-in-sample.xml.

Despite the extension, the file is a spreadsheet in Microsoft’s XML Spreadsheet format: Excel and LibreOffice open it as a table. It has one row per pass and one column per metric and per parameter. In an English terminal the metric columns are usually Pass, Result (the value of the criterion you optimized), Profit, Expected Payoff, Profit Factor, Recovery Factor, Sharpe Ratio, Custom, Equity DD % and Trades, followed by your parameters, one column each.

What it does not contain is the equity curve or the list of trades of each pass: only these totals. That is a limit of the MT5 export, and it is why some analyses that need the curve of every configuration cannot be done from this file.

Export the forward results

If you turned on Forward, there is another tab with a second table: the forward results. Export it the same way, for example as EURUSD-H1-2020-2024-forward.xml. It may have fewer rows than the first one: according to the MT5 help, the forward only re-tests the best passes of the optimization, ranked by your criterion (the top 10% with the complete algorithm and the top 25% with the genetic one, with a minimum number of passes). Some real exports bring every pass instead. Orometra works with both.

Its columns are almost the same, with two that matter: Forward Result, the criterion measured on the forward period, and Back Result, the criterion of that same pass in the optimization period. The other metrics (profit, drawdown, trades…) are those of the forward. That is how Orometra tells the two files apart, whichever order you drop them in, and how it checks that they come from the same optimization: the Back Result of each pass must match its Result in the other file.

Optional: the .set with your ranges

In the Inputs tab, right-click the list of parameters and choose Save to keep the configuration as a .set file. Each line holds one parameter with its value and, for optimization, its start, step and stop and whether it was ticked.

It is not required, but if you drop it together with the XML, Orometra knows exactly which ranges you asked MT5 to test. It can then tell you how much of that space was really covered, which matters above all with the genetic algorithm, and the .set you download at the end carries all the EA’s parameters, not only the ones you optimized.

Check the files before analyzing them

The mistakes that ruin the analysis

Next step

Drop both files, and the .set if you have it, into Orometra. In seconds you see which configuration is stable, how much evidence backs it and a .set ready for MT5. Everything runs in your browser: your files never leave your computer.

Analyze my results How Orometra decides →