cTrader

AlgoWay Blog

Guides, manuals and platform references.

Core
JSON & Alerts
MT5 / Expert Advisors
Errors
Integrations
Other Publications
AlgoWay Strategy Lab

MT5 Genetic vs Complete Optimization: Search Coverage

MT5 Genetic vs Complete Optimization: Search Coverage

A completed optimization is not necessarily a completed search of every input combination. In MT5, complete optimization enumerates a parameter grid. Genetic optimization searches selected combinations and uses their results to guide further exploration. Fewer passes can therefore be expected behavior, rather than evidence that the tester skipped work by mistake.

This distinction matters when choosing settings for automated trading: the strongest result found is only the strongest among the combinations actually evaluated under those test conditions. If the eventual workflow uses external alerts, keep parameter research separate from execution checks. The AlgoWay alert-automation guide describes that execution workflow; an MT5 optimization result alone does not validate the full path from an external signal to a broker order.

Count the grid before interpreting the pass count

In the MT5 optimization settings, selected inputs use Start, Step and Stop values to define the values explored. Inputs not selected for optimization remain fixed. For an evenly divisible numeric interval, the number of choices is (Stop − Start) / Step + 1. Multiply the choice counts to obtain the full Cartesian grid.

Here is a hypothetical EA with three independent inputs. These are arithmetic choices, not recommended trading settings:

InputStartStepStopChoices
Fast average length105305
Slow average length4010805
Stop distance, in the EA's defined units100503005

The full grid contains 5 × 5 × 5 = 125 combinations. Add a fourth input with 20 possible values and it becomes 2,500. That extra setting did not add twenty tests; it multiplied the existing workload by twenty. Parameter grids have the table manners of rabbits.

The count describes the proposed grid, not a guarantee that every run produces a valid result. Some input combinations may be invalid for the EA, and a stopped or failed run is not a completed evaluation. Check the tester's recorded status before interpreting a results-table row count as search coverage.

What genetic optimization leaves unexplored

MetaQuotes describes the two search methods: complete optimization runs all selected combinations, while genetic optimization starts from sampled parameter sets, selects stronger results according to the optimization criterion, and creates further candidates through recombination and mutation. It stops after its convergence rules find insufficient improvement. Its displayed run count is an estimate, not the full grid size.

Imagine a grid with 2,500 combinations. If a hypothetical search evaluates only 800 distinct valid combinations, then 1,700 remain unevaluated. They are not automatically worse; their results are unknown. A top result of 120 in your chosen score means “best observed score is 120,” not “no possible setting scores above 120.” Those numbers illustrate the distinction and are not a measurement of MT5's genetic algorithm.

Complete search removes that particular uncertainty only within the selected grid. With fast lengths of 10, 15, 20, 25 and 30, it never tests 17. “Complete” describes coverage of the chosen choices, not all conceivable settings or future market conditions.

The criterion changes the search question

The genetic method uses the optimization criterion to decide which candidates are preferable. MetaQuotes lists choices including balance, profit factor, drawdown and Sharpe ratio. A search guided by one criterion need not explore the same promising regions as a search guided by another.

Before running, translate the criterion into a plain question. “Which setting produced the greatest ending balance in this sample?” is different from “Which setting kept drawdown smallest?” Neither question on its own asks whether the trade count is informative, whether costs are realistic or whether nearby settings behave similarly.

For example, suppose candidate A earns a hypothetical 1,000 units with a 400-unit drawdown, while B earns 800 with a 100-unit drawdown. Choosing A solely by profit is understandable. Calling A universally better conceals the risk preference. Retain both quantities in the review instead of letting the selected score erase the rest of the report.

Use a smaller complete search to answer a narrower question

A practical research sequence is to define a plausible broad range, explore it, then inspect a smaller neighborhood around a candidate using a manageable complete grid. This is a suggested workflow, not a claim that a particular search method improves returns.

Suppose the first exploration points to fast length 20, slow length 60 and stop distance 200. A follow-up grid might test fast lengths 18 through 22 in steps of 1, slow lengths 50 through 70 in steps of 5, and stop distances 150 through 250 in steps of 25. That is another 125 combinations. It answers whether the chosen neighborhood has similar results or a sharp isolated peak. It does not prove that no better region exists elsewhere.

Keep history, symbol, timeframe, modeling assumptions, costs and the EA version fixed for that comparison. Save the original ranges as well as the narrowed ones. Otherwise, two reports with the same winning settings can conceal very different searches.

Both stages still use fitting data. Checking nearby settings on those same observations is useful sensitivity analysis, but it does not create independent evidence. Reserve a later period before selecting settings; the separate guide to MT5 historical forward testing explains that distinction.

When handing off a candidate for a demo execution trial, retain its exact inputs, the explored grid, the search method, the criterion and the test dates. “Best settings” is an incomplete label. “Best observed settings under these recorded conditions” gives the next person something they can actually check.

Last updated: October 18, 2026