Journal of Heuristics

, Volume 18, Issue 4, pp 627–656

A Forex trading system based on a genetic algorithm


DOI: 10.1007/s10732-012-9201-y

Cite this article as:
Mendes, L., Godinho, P. & Dias, J. J Heuristics (2012) 18: 627. doi:10.1007/s10732-012-9201-y


In this paper, a genetic algorithm will be described that aims at optimizing a set of rules that constitute a trading system for the Forex market. Each individual in the population represents a set of ten technical trading rules (five to enter a position and five others to exit). These rules have 31 parameters in total, which correspond to the individuals’ genes. The population will evolve in a given environment, defined by a time series of a specific currency pair. The fitness of a given individual represents how well it has been able to adapt to the environment, and it is calculated by applying the corresponding rules to the time series, and then calculating the ratio between the profit and the maximum drawdown (the Stirling ratio). Two currency pairs have been used: EUR/USD and GBP/USD. Different data was used for the evolution of the population and for testing the best individuals. The results achieved by the system are discussed. The best individuals are able to achieve very good results in the training series. In the test series, the developed strategies show some difficulty in achieving positive results, if you take transaction costs into account. If you ignore transaction costs, the results are mostly positive, showing that the best individuals have some forecasting ability.


Genetic algorithms Finance Technical trading rules Foreign exchange rates 

Copyright information

© Springer Science+Business Media, LLC 2012

Authors and Affiliations

  1. 1.Faculdade de EconomiaUniversidade de CoimbraCoimbraPortugal
  2. 2.Faculdade de Economia and GEMFUniversidade de CoimbraCoimbraPortugal
  3. 3.Faculdade de Economia and Inesc-CoimbraUniversidade de CoimbraCoimbraPortugal

Personalised recommendations