Skip to main content

Stock selection heuristics for performing frequent intraday trading with genetic programming


Intraday trading attempts to obtain a profit from the microstructure implicit in price data. Intraday trading implies many more transactions per stock compared to long term buy-and-hold strategies. As a consequence, transaction costs will have a more significant impact on the profitability. Furthermore, the application of existing long term portfolio selection algorithms for intraday trading cannot guarantee optimal stock selection. This implies that intraday trading strategies may require a different approach to stock selection for daily portfolios. In this work, we assume a symbiotic genetic programming framework that simultaneously coevolves the decision trees and technical indicators to generate trading signals. We generalize this approach to identify specific stocks for intraday trading using stock ranking heuristics: Moving Sharpe ratio and a Moving Average of Daily Returns. Specifically, the trading scenario adopted by this work assumes that a bag of available stocks exist. Our agent then has to both identify which subset of stocks to trade in the next trading day, and the specific buy-hold-sell decisions for each selected stock during real-time trading for the duration of the intraday period. A benchmarking comparison of the proposed ranking heuristics with stock selection performed using the well known Kelly Criterion is conducted and a strong preference for the proposed Moving Sharpe ratio demonstrated. Moreover, portfolios ranked by both the Moving Sharpe ratio and a Moving Average of Daily Returns perform significantly better than any of the comparator methods (buy-and-hold strategy, investment in the full set of 86 stocks, portfolios built from random stock selection and Kelly Criterion).

This is a preview of subscription content, access via your institution.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12
Fig. 13
Fig. 14
Fig. 15
Fig. 16
Fig. 17
Fig. 18
Fig. 19


  1. ‘Fundamental analysis’ performs a macro or strategic assessment of where a stock should be trading on any criteria except the behavior of price itself. The criteria often include the economic condition of the country in which the stock conducts business, monetary policy, and other “fundamental” elements [12].

  2. ‘Technical analysis’ is that which is applied to the price behavior of the stock to develop a trading decision, irrespective of fundamental factors [12].

  3. ‘Technical indicators’ are any class of metrics whose value is derived from generic price activity in a stock or asset. Technical indicators look to predict the future price levels, or simply the general price direction, of a security by looking at past patterns [12].

  4. ‘Candlestick’ is a type of price chart that displays the high, low, open, and closing prices of a trading asset (currency pair, stock, etc.) for a specific period of time (e.g., 1 min, 5 min, etc.). [12]

  5. A stop loss is an order to buy or sell when the market moves to a specific price. A stop-loss order is designed to limit a loss when the price is moving in the opposite direction to the most recent buy or sell [12].

  6. A take profit is an order to buy or sell when the market reaches a target price to fix the profit [12].

  7. S is a number of stocks that can be traded in the daily portfolio (Fig. 1).

  8. All stocks from the portfolio are held, as there is no basis for selecting a subset of specific stock.

  9. Implies that each stock is invested in equally each day, subject to the 10% account balance and flat rate rules from Sect. 4.2.

  10. Naturally, the recommended stock is free to change each day.


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

    Article  Google Scholar 

  2. F.M. Bandi, J.R. Russell, Microstructure noise, realized variance, and optimal sampling. Rev. Financ. Stud. 75, 339–369 (2008)

    MathSciNet  MATH  Google Scholar 

  3. J. Baz, H. Guo, An asset allocation primer: connecting Markowitz, Kelly and Risk Parity. Quantative Research, pp. 1–16 (2017)

  4. E.P. Chan, Quantitative Trading: How to Build Your Own Algorithmic Trading Business (Wiley, London, 2009)

    Google Scholar 

  5. S. Chen, C. Yeh, Toward a computable approach to the efficient market hypothesis: an application of genetic programming. J. Econ. Dyn. Control 21, (1996)

  6. I. Contreras, J.I. Hidalgo, L. Nuñez-Letamendía, J.M. Velasco, A meta-grammatical evolutionary process for portfolio selection and trading. Genet. Program Evolvable Mach. 18(4), 411–431 (2017)

    Article  Google Scholar 

  7. V. DeMiguel, L. Garlappi, R. Uppal, Optimal versus naive diversification: How inefficient is the 1/n portfolio strategy? Rev. Financ. Stud. 22, 1915–1953 (2009)

    Article  Google Scholar 

  8. N. Goumatianos, I. Christou, P. Lindgren, Stock selection system: building long/short portfolios using intraday patterns. Procedia Econ. Finance 5, 298–307 (2013)

    Article  Google Scholar 

  9. G.N. Gregoriou, Handbook of High Frequency Trading (Academic Press, London, 2015)

    Google Scholar 

  10. Y. Ha, Algorithmic trading in limit order books for online portfolio selection. SSRN Electron. J. (2017)

  11. M.I. Heywood, P. Lichodzijewski, Symbiogenesis as a mechanism for building complex adaptive systems: a review. In: Applications of Evolutionary Computation: Part I, LNCS, vol. 6024, pp. 51–60. Springer, Berlin (2010)




  15. H. Iba, C.C. Aranha, Practical Applications of Evolutionary Computation to Financial Engineering, Adaptation, Learning, and Optimization, vol. 11 (Springer, Berlin, 2012)

    Google Scholar 

  16. R. Jagannathan, T. Ma, Risk reduction in large portfolios: why imposing the wrong constraints helps. J. Finance 58, 1651–1684 (2003)

    Article  Google Scholar 

  17. G. Kim, S. Jung, The construction of the optimal investment portfolio using the Kelly Criterion. World J. Soc. Sci. 3(6), 15–26 (2013)

    Google Scholar 

  18. P.N. Kolm, R. Tütüncü, F.J. Fabozzi, 60 years of portfolio optimization: practical challenges and current trends. Eur. J. Oper. Res. 234, 356–371 (2014)

    Article  MathSciNet  Google Scholar 

  19. M. Kritzman, S. Page, D. Turkington, In defense of optimization: the fallacy of 1/n. Financ. Anal. 66, 1–9 (2010)

    Google Scholar 

  20. J. Kuepper, Money Management Using the Kelly Criterion (Investopedia, 2004)

  21. P. Laureti, M. Medo, Y.C. Zhang, Analysis of Kelly-optimal portfolios. Quant. Finance 10, 689–697 (2010)

    Article  MathSciNet  Google Scholar 

  22. N.K. Lioudis, Sharpe ratio (Investopedia, 2017)

  23. Q. Liu, On portfolio optimization: How and when do we benefit from high-frequency data? J. Appl. Econom. 24, 560–582 (2009)

    Article  MathSciNet  Google Scholar 

  24. A. Loginov, M. Heywood, On the impact of streaming interface heuristics on GP trading agents: an FX benchmarking study, in ACM Genetic and Evolutionary Computation Conference, pp. 1341–1348 (2013)

  25. A. Loginov, M. Heywood, On the utility of trading criteria based retraining in forex markets, in Applications of Evolutionary Computation (EvoFIN), LNCS, 7835, 192–202 (2013)

  26. A. Loginov, G. Wilson, M. Heywood, Better trade exits for foreign exchange currency trading using FXGP, in IEEE Congress on Evolutionary Computation, pp. 2510–2517 (2015)

  27. L.C. MacLean, E.O. Thorp, Y. Zhao, W.T. Ziemba, How does the fortune’s formula-kelly capital growth model perform? J. Portf. Manag. 37, 96–111 (2011)

    Article  Google Scholar 

  28. J. Malek, T.V. Quang, Investing in high frequency data. Bus. Trends 6(3), 21–27 (2016)

    Google Scholar 

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

    Article  MathSciNet  Google Scholar 

  30. H. Markowitz, Portfolio selection. J. Finance 7, 77–91 (1952)

    Google Scholar 

  31. B. Matthew, B. Jonathan, H. Björn, A. KirilenkoRisk, Return in high frequency trading. J. Financ. Quant. Anal. 82, (2018)

  32. V. Nekrasov, Kelly criterion for multivariate portfolios: a model-free approach. SSRN Electron. J. 10(2139), 1–14 (2013)

    Google Scholar 

  33. M.E.H. Pedersen, Portfolio optimization and Monte Carlo simulation. Hvass Laboratories Report HL-1401, pp. 1–96 (2014)

  34. J. Potvin, P. Soriano, M. Vallee, Generating trading rules on the stock markets with genetic programming. Comput. Oper. Res. 31, 1030–1047 (2004)

    Article  Google Scholar 

  35. W. Poundstone, Fortune’s Formula (Hill and Wang, 2005)

  36. R.T. Rockafellar, S. Uryasev, Optimization of conditional value-at-risk. J. Risk 2, 493–517 (2000)

    Article  Google Scholar 

  37. F. Turcas, F. Dumiter, P. Brezeanu, P. Farcas, S. Coroiu, Practical aspects of portfolio selection and optimization on the capital market. Econ. Res.-Ekonomska Istrazivanja 30, 14–30 (2017)

    Article  Google Scholar 

  38. Z. Yin, A. Brabazon, C. O’Sullivan, P.A. Hamill, A genetic programming approach for delta hedging. Genet. Program Evolvable Mach. 20(1), 67–92 (2018)

    Article  Google Scholar 

  39. F.A. Ziegelmann, B. Borges, J.F. Caldeira, Selection of minimum variance portfolio using intraday data: an empirical comparison among different realized measures for bm&fbovespa data. Braz. Rev. Econom. 35 (2014)

Download references


Alexander Loginov gratefully acknowledges support from the MITACS Accelerate Scholarship program.

Author information

Authors and Affiliations


Corresponding author

Correspondence to Malcolm Heywood.

Additional information

Publisher's Note

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

Area Editor: U.-M. O’Reilly.

Rights and permissions

Reprints and Permissions

About this article

Verify currency and authenticity via CrossMark

Cite this article

Loginov, A., Heywood, M. & Wilson, G. Stock selection heuristics for performing frequent intraday trading with genetic programming. Genet Program Evolvable Mach 22, 35–72 (2021).

Download citation

  • Received:

  • Revised:

  • Published:

  • Issue Date:

  • DOI:


  • Stock
  • Trading
  • Intraday
  • Portfolio