Skip to content
All library documents

Genetic Algorithms for Optimizing Neural Trading Models

Article MQL5 articles

Summary

The article explains genetic algorithms as gradient-free methods for optimizing parametric models, including neural trading models that are not differentiable or are difficult to train with gradient descent. It describes evolving a population of agents across finite sessions: score them by reward or loss, select stronger candidates as parents, inherit individual model weights, and introduce random mutations to preserve exploration.

The implementation discussion uses MQL5 and a population-oriented neural-network class. The article says a model was optimized and evaluated in the Strategy Tester, with results characterized as quite good, but the provided text does not include the underlying metrics or enough detail to assess robustness. Population size, parent selection, and mutation probability are key design choices. The method avoids gradient calculations, but its stochastic search still requires careful evaluation; the author recommends extensive testing before any live use.

Key ideas

  • Genetic algorithms can optimize models without differentiable objectives or gradient calculations.
  • A population explores multiple model policies under the same environment during each finite session.
  • Selection chooses higher-reward or lower-loss agents to produce the next generation.
  • Weights are inherited from parents, while random mutations introduce new parameter values.
  • Population size, parent share, and mutation probability are important optimization settings.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.