Skip to main content

Advertisement

Log in

Generating trading rules on US Stock Market using strongly typed genetic programming

  • Methodologies and Application
  • Published:
Soft Computing Aims and scope Submit manuscript

Abstract

Extracting rules from stock market data is an important and exciting problem, where investment decisions should be as clear and intuitive as possible in order for investors to choose the composition of their portfolios. Thus, it is important to guarantee that this process is done with a good framework and reliable techniques. In this context, portfolio composition is a puzzle with respect to selecting the appropriate assets and the optimal timing to invest. There are several models and algorithms to make these decisions, and in recent years, machine learning applications have been used to solve this puzzle with exceptional results. This technique allows a large amount of data to be processed, resulting in more informed recommendations on which asset to choose. Our study uses strongly typed genetic programming to generate rules to buy, hold and sell stocks in the US stock market, considering a rolling windows approach. We propose a different training approach, focusing the fitness function on a ternary decision based on the return prediction of each stock analyzed. The ternary rule matches perfectly with the three decisions: buy, hold and sell. Therefore, the rules are simple, intuitive, and easy for investors to understand. The results show that the proposed algorithm generates higher profits than the classical optimization approach. Moreover, the profits obtained are higher than the buy-and-hold strategy and the return of the indexes representative of the US stock market.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Institutional subscriptions

Fig. 1
Fig. 2
Fig. 3

Similar content being viewed by others

Notes

  1. https://www.jpmorgan.com/global/research/machine-learning.

  2. https://fred.stlouisfed.org/series/DFF.

References

  • Abraham A, Nedjah N, Mourelle LM (2006) Evolutionary computation: from genetic algorithms to genetic programming. In: Nedjah N, Mourelle LM, Abraham A (eds) Genetic systems programming. Springer, Berlin, pp 1–30

    MATH  Google Scholar 

  • Allen F, Karjalainen R (1999) Using genetic algorithms to find technical trading rules. J Financ Econ 51(2):245–271

    Google Scholar 

  • Arévalo R, García J, Guijarro F, Peris A (2017) A dynamic trading rule based on filtered flag pattern recognition for stock market price forecasting. Expert Syst Appl 81:177–192

    Google Scholar 

  • Ashlock W (2006) Using very small population sizes in genetic programming. In: IEEE congress on evolutionary computation (2006) CEC 2006. IEEE, pp 319–326

  • Baareh AK (2018) Evolutionary design of a carbon dioxide emission prediction model using genetic programming. CARBON 9(3):298–303

  • Bauer RJ (1994) Genetic algorithms and investment strategies, vol 19. Wiley, Hoboken

    Google Scholar 

  • Berutich JM, López F, Luna F, Quintana D (2016) Robust technical trading strategies using GP for algorithmic portfolio selection. Expert Syst Appl 46:307–315

    Google Scholar 

  • Boyacioglu MA, Avci D (2010) An adaptive network-based fuzzy inference system (anfis) for the prediction of stock market return: the case of the Istanbul stock exchange. Expert Syst Appl 37(12):7908–7912

    Google Scholar 

  • Chen T, Tang K, Chen G, Yao X (2012) A large population size can be unhelpful in evolutionary algorithms. Theor Comput Sci 436:54–70

    MathSciNet  MATH  Google Scholar 

  • Chen Y, Wang X (2015) A hybrid stock trading system using genetic network programming and mean conditional value-at-risk. Eur J Oper Res 240(3):861–871

    MathSciNet  MATH  Google Scholar 

  • Chernick MR, González-Manteiga W, Crujeiras RM, Barrios EB (2011) Bootstrap methods. In: Lovric M (ed) International encyclopedia of statistical science. Springer, Berlin, pp 169–174

    Google Scholar 

  • ScT Chou, Hj Hsu, Cc Yang, Lai F (1997) A stock selection dss combining AI and technical analysis. Ann Oper Res 75:335–353

    Google Scholar 

  • Costantino F, Di Gravio G, Nonino F (2015) Project selection in project portfolio management: an artificial neural network model based on critical success factors. Int J Proj Manag 33(8):1744–1754

    Google Scholar 

  • Dehghanpour S, Esfahanipour A (2017) A robust genetic programming model for a dynamic portfolio insurance strategy. In: 2017 IEEE international conference on innovations in intelligent systems and applications (INISTA), IEEE, pp 201–206

  • Deng Y, Bao F, Kong Y, Ren Z, Dai Q (2017) Deep direct reinforcement learning for financial signal representation and trading. IEEE Trans Neural Netw Learn Syst 28(3):653–664

    Google Scholar 

  • Engelbrecht A, Rouwhorst S, Schoeman L (2001) A building block approach to genetic programming for rule discovery. In: Abbass HA (ed) Data mining: a heuristic approach. IGI Global, Hershey, pp 174–189

    Google Scholar 

  • Fama EF (1970) Efficient capital markets: a review of theory and empirical work. J Finance 25(2):383–417

    Google Scholar 

  • Fama EF, Blume ME (1966) Filter rules and stock-market trading. J Bus 39(1):226–241

    Google Scholar 

  • Faradonbeh RS, Monjezi M, Armaghani DJ (2016) Genetic programing and non-linear multiple regression techniques to predict backbreak in blasting operation. Eng Comput 32(1):123–133

    Google Scholar 

  • Ferreira C (2006) Gene expression programming: mathematical modelling by an artificial intelligence, 2nd edn. Springer, San Francisco

    MATH  Google Scholar 

  • Ha S, Moon BR (2018) Finding attractive technical patterns in cryptocurrency markets. Memetic Comput 10:1–6

    Google Scholar 

  • Haynes TD, Schoenefeld DA, Wainwright RL (1996) Type inheritance in strongly typed genetic programming. Adv Genet Program 2(2):359–376

    Google Scholar 

  • Holland JH (1975) Adaptation in natural and artificial systems: an introductory analysis with applications to biology, control, and artificial intelligence. University of Michigan, Ann Arbor

    MATH  Google Scholar 

  • Kac M (1947) Random walk and the theory of Brownian motion. Am Math Monthly 54(7):369–391

    MathSciNet  MATH  Google Scholar 

  • Kang W, Ratti RA, Yoon KH (2015) The impact of oil price shocks on the stock market return and volatility relationship. J Int Financ Mark Inst Money 34:41–54

    Google Scholar 

  • Karatahansopoulos A, Sermpinis G, Laws J, Dunis C (2014) Modelling and trading the greek stock market with gene expression and genetic programing algorithms. J Forecast 33(8):596–610

    MathSciNet  MATH  Google Scholar 

  • Katagiri H, Hirasama K, Hu J (2000) Genetic network programming-application to intelligent agents. In: 2000 IEEE international conference on systems, man, and cybernetics, IEEE, vol 5, pp 3829–3834

  • Khandelwal M, Faradonbeh RS, Monjezi M, Armaghani DJ, Majid MZBA, Yagiz S (2017) Function development for appraising brittleness of intact rocks using genetic programming and non-linear multiple regression models. Eng Comput 33(1):13–21

    Google Scholar 

  • Koza JR (1992) Genetic programming: on the programming of computers by means of natural selection, vol 1. MIT Press, Cambridge

    MATH  Google Scholar 

  • Krauss C (2017) Statistical arbitrage pairs trading strategies: review and outlook. J Econ Surv 31(2):513–545

    Google Scholar 

  • Luengo S, Winkler S, Barrero DF, Castaño B (2015) Optimization of trading rules for the Spanish stock market by genetic programming. In: International conference on industrial, engineering and other applications of applied intelligent systems, pp 623–634. Springer

  • Mabu S, Hirasawa K, Obayashi M, Kuremoto T (2013) Enhanced decision making mechanism of rule-based genetic network programming for creating stock trading signals. Expert Syst Appl 40(16):6311–6320

    Google Scholar 

  • Manahov V (2018) The rise of the machines in commodities markets: new evidence obtained using strongly typed genetic programming. Ann Oper Res 260(1–2):321–352

    MathSciNet  MATH  Google Scholar 

  • Manahov V, Hudson R, Linsley P (2014) New evidence about the profitability of small and large stocks and the role of volume obtained using strongly typed genetic programming. J Int Financ Mark Inst Money 33:299–316

    Google Scholar 

  • Markowitz H (1952) Portfolio selection. J Finance 7(1):77–91

    Google Scholar 

  • Metawa N, Hassan MK, Elhoseny M (2017) Genetic algorithm based model for optimizing bank lending decisions. Expert Syst Appl 80:75–82

    Google Scholar 

  • Montana DJ (1995) Strongly typed genetic programming. Evol Comput 3(2):199–230

    Google Scholar 

  • Mousavi S, Esfahanipour A, Zarandi MHF (2014) A novel approach to dynamic portfolio trading system using multitree genetic programming. Knowl Based Syst 66:68–81

    Google Scholar 

  • Muni DP, Pal NR, Das J (2004) A novel approach to design classifiers using genetic programming. IEEE Trans Evol Comput 8(2):183–196

    Google Scholar 

  • Murphy JJ (1999) Technical analysis of the financial markets: a comprehensive guide to trading methods and applications. Penguin, London

    Google Scholar 

  • Pimenta A, Nametala CA, Guimarães FG, Carrano EG (2018) An automated investing method for stock market based on multiobjective genetic programming. Comput Econ 52(1):125–144

    Google Scholar 

  • Poli R, Langdon WB, McPhee NF, Koza JR (2008) A field guide to genetic programming. Lulu, Morrisville

    Google Scholar 

  • Shahzad SJH, Naifar N, Hammoudeh S, Roubaud D (2017) Directional predictability from oil market uncertainty to sovereign credit spreads of oil-exporting countries: evidence from rolling windows and crossquantilogram analysis. Energy Econ 68:327–339

    Google Scholar 

  • Sheta AF, Ahmed SEM, Faris H (2015) Evolving stock market prediction models using multi-gene symbolic regression genetic programming. Artif Intell Mach Learn J 15:11–20

    Google Scholar 

  • Tsai HC, Lin YH (2011) Predicting high-strength concrete parameters using weighted genetic programming. Eng Comput 27(4):347–355

    Google Scholar 

  • Tsyurmasto P, Zabarankin M, Uryasev S (2014) Value-at-risk support vector machine: stability to outliers. J Comb Optim 28(1):218–232

    MathSciNet  MATH  Google Scholar 

  • Yang SY, Mo SYK, Liu A, Kirilenko AA (2017) Genetic programming optimization for a sentiment feedback strength based trading strategy. Neurocomputing 264:29–41

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Werner Kristjanpoller.

Ethics declarations

Conflict of interest

The authors declare that they have no conflict of interest.

Human and animal rights

This article does not contain any studies with human participants or animals performed by any of the authors.

Additional information

Communicated by V. Loia.

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Appendix: Stock characteristics

Appendix: Stock characteristics

See Tables 11, 12 and 13.

Table 11 Description of Stocks 1–30 for test period
Table 12 Description of Stocks 31–60 for test period
Table 13 Description of Stocks 61–90 for test period

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Michell, K., Kristjanpoller, W. Generating trading rules on US Stock Market using strongly typed genetic programming. Soft Comput 24, 3257–3274 (2020). https://doi.org/10.1007/s00500-019-04085-1

Download citation

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00500-019-04085-1

Keywords

Navigation