Validation

Genetic Algorithms in Trading: How Strategies Are Generated and How Not to Fool Yourself

Published November 28, 2026 · By the AUREUM team · 8 min read

A genetic algorithm knows nothing about markets: it combines rules at random, keeps the ones that work best on historical data and breeds them, generation after generation. It can test millions of strategies in days. The problem is that, with so many tests, some come out well by pure chance. Here you will see how it works and what it takes to separate what is useful from luck.

What a genetic algorithm is

A genetic algorithm is a search method inspired by natural evolution. John Holland formalised it in the 1970s, and it is used for problems with so many possible combinations that they cannot all be tested. It works in cycles:

  1. Population: a group of random solutions is created.
  2. Evaluation: each one gets a score based on how well it solves the problem (the fitness function).
  3. Selection: the best ones are more likely to pass to the next generation.
  4. Crossover and mutation: parts of the good ones are combined and random changes are introduced.
  5. Repetition: back to step 2, for many generations.

When what evolves is not numbers but rules or whole programs, it is called genetic programming, an idea popularised by John Koza in the 1990s.

How it is used to build strategies

In trading, each "individual" is a strategy: entry rules (for example, "if price closes above its 50-period average and the ATR is rising"), exit rules and risk management. The algorithm:

The advantage is that it explores ideas a person would not try, with no prior preferences. The risk is exactly the same thing: it has no way to tell a rule that makes sense from a coincidence.

Genetic optimisation in MT5 vs strategy generation

MetaTrader 5 also uses a genetic algorithm: in the Strategy Tester, the "Fast genetic based algorithm" optimisation mode searches for the best parameters of an Expert Advisor that already exists (moving-average periods, stop distances and so on) without testing every combination. But someone wrote the rules beforehand.

Strategy generation software such as StrategyQuant X goes a step further: the algorithm creates the rules themselves. The search space is vastly larger, and so is the risk of finding strategies that only work in the past.

The big problem: millions of tests, many false positives

If you toss a coin ten times, getting eight heads is unlikely. If a million people toss ten coins each, thousands will manage it, and none of them has a special coin. Strategies work the same way: among millions of combinations tested on the same history, some will have excellent curves by chance alone. This is called data-mining bias or selection bias.

The key idea

The more strategies you test, the better the chosen one's result has to be to mean anything, and the tougher the later tests have to be. A good backtest of the best out of a million says very little on its own.

The filters that separate useful from lucky

A real example of the funnel

This is how it was done at AUREUM, as described in the methodology:

From the genetic algorithm to AUREUM's two strategies
StageStrategiesWhat was done
GenerationMore than 6 millionGenetic evolution in StrategyQuant on gold, 1-hour candles.
Filters143Return, drawdown and robustness; more than 99.99% were discarded.
Finalists15Tested one by one in MetaTrader 5, each with its own report.
Selection2One trend and one momentum strategy: two that make money in different ways, not the two that made the most.

Both then passed Monte Carlo analysis and ten years of market data they did not see while being built. That funnel guarantees nothing about the future, but it is the difference between picking the best curve out of a million and picking what survives tests that played no part in creating it.

Limits

Frequently asked questions

What is a genetic algorithm in trading?

A method that builds strategies by combining rules at random, evaluates them with a backtest, keeps the best ones and breeds and mutates them over many generations. It makes it possible to explore millions of combinations no one could test by hand.

How does it differ from MetaTrader 5 genetic optimisation?

The Strategy Tester's fast genetic algorithm mode searches for the best parameters of an Expert Advisor whose rules already exist. Strategy generation software uses the algorithm to create the rules themselves, with a much larger search space.

Why do many generated strategies fail live?

Because among millions of tests on the same history, some come out well by chance. That is data-mining bias: without out-of-sample and robustness tests, you pick the one that was luckiest in the past.

Which filters are used to validate a generated strategy?

The most common are out-of-sample testing, Monte Carlo analysis, limiting the number of rules, requiring a minimum number of trades and repeating the test on the real platform with tick data and realistic costs.

Will a strategy that passes every filter work in the future?

Not necessarily. Filters reduce the chance of having picked a fluke, but markets can change. Past or simulated results do not guarantee future results.

Risk warning

The figures on AUREUM's process come from the methodology published on the site. Tests on past data, including out-of-sample and Monte Carlo tests, are simulations: passing them does not guarantee what a strategy will do next. Leveraged gold trading, which on MetaTrader 5 brokers is usually done with CFDs, carries a high level of risk and you can lose some or all of your capital. Past or simulated results do not guarantee future results. This content is educational and is not financial advice.

AUREUM: automated rules on gold, with its backtest published

Software that runs two strategies on XAU/USD in your own MetaTrader 5 account, where every trade opens with its loss and profit limits already calculated. Its 2024–2026 backtest, with both strategies together, is published with its drawdowns: a maximum drawdown of 22.35% across 345 trades. It’s a simulation, not a live account, and trading leveraged CFDs can lose you money.

See the full report →