Genetic Programming and Evolvable Machines

, Volume 18, Issue 4, pp 411–431 | Cite as

A meta-grammatical evolutionary process for portfolio selection and trading

  • Iván Contreras
  • J. Ignacio HidalgoEmail author
  • Laura Nuñez-Letamendía
  • J. Manuel Velasco


This study presents the implementation of an automated trading system that uses three critical analyses to determine time-decisions and portfolios for investment. The approach is based on a meta-grammatical evolution methodology that combines technical, fundamental and macroeconomic analysis on a hybrid top-down paradigm. First, the method provides a low-risk portfolio by analyzing countries and industries. Next, aiming to focus on the most robust companies, the system filters the portfolio by analyzing their economic variables. Finally, the system analyzes prices and volumes to optimize investment decisions during a given period. System validation involves a series of experiments in the European financial markets, which are reflected with a data set of over nine hundred companies. The final solutions have been compared with static strategies and other evolutionary implementations and the results show the effectiveness of the proposal.


Grammatical evolution Automated trading systems Meta-GE Technical analysis Fundamental analysis Macroeconomic analysis 



This work was partially supported by the Spanish Government Minister of Science and Innovation under Grant TIN2014-54806-R and the People program (Marie Curie Actions) of the European Union Seventh Framework Programme (FP7/2007–2013) with the Agreement No. 600388 of the REA and the Agencia per a la Competitivitat de L’Empresa (ACCIÓ). J. I. Hidalgo also acknowledges the support of the Spanish Ministry of Education mobility Grant PRX16/00216.


  1. 1.
    G.P. Dwyer, R.W. Hafer, The Stock Market: Bubbles, Volatility, and Chaos (Springer, Berlin, 2010)Google Scholar
  2. 2.
    J.R. Koza, Genetic Programming: On the Programming of Computers by Means of Natural Selection, vol. 1 (MIT Press, Cambridge, 1992)zbMATHGoogle Scholar
  3. 3.
    M. O’Neill, C. Ryan, Grammatical Evolution: Evolutionary Automatic Programming in an Arbitrary Language (Kluwer Academic Publishers, Dordrecht, 2003)CrossRefzbMATHGoogle Scholar
  4. 4.
    I. Dempsey, M. O’Neill, A. Brabazon, Live trading with grammatical evolution, in GECCO 2004 Workshop Proceedings, (Seattle, Washington, 2004), pp. 311–327Google Scholar
  5. 5.
    A. Brabazon, M. O’Neill, Evolving technical trading rules for spot foreign-exchange markets using grammatical evolution. Comput. Manag. Sci. 1(3), 311–327 (2004)CrossRefzbMATHGoogle Scholar
  6. 6.
    I. Dempsey, M. O’Neill, A. Brabazon, Adaptive trading with grammatical evolution, in Proceedings of the 2006 IEEE Congress on Evolutionary Computation (IEEE Press, Vancouver, 2006), pp. 9137–9142Google Scholar
  7. 7.
    I. Dempsey, M. O’Neill, A. Brabazon, Foundations in Grammatical Evolution for Dynamic Environments (Springer, Berlin, 2009)CrossRefGoogle Scholar
  8. 8.
    A. Brabazon, M. O’Neill, Biologically Inspired Algorithms for Financial Modelling (Natural Computing Series) (Springer, New York, 2006)zbMATHGoogle Scholar
  9. 9.
    M. O’Neill, C. Ryan, Grammatical Evolution by Grammatical Evolution: The Evolution of Grammar and Genetic Code (Springer, Berlin, 2004)Google Scholar
  10. 10.
    K. Adamu, S. Phelps, Modelling financial time series using grammatical evolution, in Proceedings of the Workshop on Advances in Machine Learning for Computational Finance, London, (2009)Google Scholar
  11. 11.
    K. Adamu, S. Phelps, Coevolution of technical trading rules for high frequency trading, in Proceedings of the World Congress on Engineering 2010, WCE’10, London vol I, June 30–July 2, 2010, Lecture Notes in Engineering and Computer Science, eds. by S.I. Ao, L. Gelman, D.W.L. Hukins, A. Hunter, A.M. Korsunsky (International Association of Engineers, Newswood Limited 2010), pp. 96–101Google Scholar
  12. 12.
    I. Contreras, Y. Jiang, J.I. Hidalgo, L. Núñez, Using a GPU–CPU architecture to speed up a GA-based real-time system for trading the stock market. Soft Comput. 16(2), 203–215 (2012)CrossRefGoogle Scholar
  13. 13.
    I. Contreras, JI. Hidalgo, L. Núñez, Time series of stock prices and randomness: Undercover patterns. In Proceedings of The 2015 Northeast Decision Sciences Institute (NEDSI) conference , March 20 - 22, 2015, Boston, MA, USA, (2015)Google Scholar
  14. 14.
    I. Arnaldo, I. Contreras, D. Millán-Ruiz, J.I. Hidalgo, N. Krasnogor, Matching island topologies to problem structure in parallel evolutionary algorithms. Soft Computing 17(7), 1209–1225 (2013)CrossRefGoogle Scholar
  15. 15.
    A.W. Lo, Reconciling efficient markets with behavioral finance: the adaptive markets hypothesis. J. Invest. Consult. 7(2), 21–44 (2005)Google Scholar
  16. 16.
    S. Hao, Q. Jin, G. Zhang, Relative firm profitability and stock return sensitivity to industry-level news. Account. Rev. 86(4), 1321–1347 (2011)CrossRefGoogle Scholar
  17. 17.
    J.L. Bettman, S.J. Sault, E.L. Schultz, Fundamental and technical analysis: substitutes or complements? Account. Finance 49(1), 21–36 (2009)CrossRefGoogle Scholar
  18. 18.
    P.M. Menaje Jr., Impact of selected accounting and economic variables on share price of publicly listed banks in the Philippines from 2002–2008. DLSU Bus. Econ. Rev. 22(1), 35–62 (2012)Google Scholar
  19. 19.
    A. Hull, Active Investing: How to Manage Your Portfolio Like a Professional in Less than One Hour a Week, Revised Edition (Wiley, Wrightbooks, 2013), p. 232Google Scholar
  20. 20.
    A.W. Lo, J. Hasanhodzic, CMT Level I 2016: An Introduction to Technical Analysis (Wiley, Hoboken, 2015)Google Scholar
  21. 21.
    G. Appel, Technical Analysis: Power Tools for Active Investors (Financial Times - Prentice Hall, Upper Saddle River, 2005)Google Scholar
  22. 22.
    I. Contreras, J.I. Hidalgo, L. Núñez-Letamendia, Combining technical analysis and grammatical evolution in a trading system, in Applications of Evolutionary Computation—16th European Conference, EvoApplications 2013, Vienna, April 3–5, 2013. Proceedings, (2013), pp. 244–253Google Scholar
  23. 23.
    W.F. Sharpe, Mutual fund performance. J. Bus. 39(1), 119–138 (1966)CrossRefGoogle Scholar
  24. 24.
    C. Israelsen, A refinement to the sharpe ratio and information ratio. J. Asset Manag. 5(6), 423–427 (2005)CrossRefGoogle Scholar

Copyright information

© Springer Science+Business Media New York 2017

Authors and Affiliations

  1. 1.Adaptive and Bioinspired Systems Research GroupUniversidad Complutense de MadridMadridSpain
  2. 2.Institut d’Informática i AplicacionsUniversitat de GironaGironaSpain
  3. 3.IE Business SchoolMadridSpain

Personalised recommendations