Evolution of trading strategies with flexible structures: A configuration comparison
Introduction
Recent advances in Information Technology and Communications have favored the progressive automation of trading. The ability of algorithmic trading systems to process data at high speed and to identify regularities within or across markets, has led to their popularization since the 1990s [1]. While they offer advantages in terms of speed; accuracy; reduced costs or lack of human emotions, to mention a few, their impact on the financial markets as a whole is still controversial. Researchers have identified both positive elements, like higher efficiency in the price discovery process, and negative ones like excess volatility and higher adverse selection costs [2], [3].
According to Nuti et al. [4], these systems can cover either specific stages of the process, including pre-trade analysis; trading signal generation; trade execution or post-trade analysis, or the whole cycle. In this work will be focused on trading signal generation, more specifically on market timing strategy generation.
The range of alternatives that can be used in this context is very wide, but most of them fall under one of two categories, fundamental analysis or technical analysis. The former is focused on fair value and uses financial statements as the main source of information, while the latter relies mostly on features of the price and volume data of securities called technical indicators. Among them, the most well known are moving averages and support lines. Besides these, other classic indicators are the opening, closing, maximum and minimum prices, volume and volatility [5]. These, together with a number of operators and thresholds, are used to define technical investment rules. Once these rules are specified, investors can use them to make decisions on the purchase and sale of securities in financial markets.
The matter of whether it is possible at all to find profitable trading strategies for publicly traded assets is still under debate. According to Fama [6] and his followers, stocks trade at fair value. This would make beating the overall market through traded asset selection or market timing on a risk-adjusted basis impossible. This, so called, Efficient Market Hypothesis (EMH) has three variants “weak”, “semi-strong”, and “strong” that differ on the strength of the claim. However, other authors disagree [7] and there is a whole industry based on the argument that active investing is profitable.
The search for profitable trading strategies has been driving research efforts for decades. Among the many different approaches that can be used to design trading rules (such as Particle Swarm Optimization, Genetic Algorithms, Artificial Neural Networks and Fuzzy Methods), there are some based on evolutionary computation that are especially interesting due to three key features: the process of rule generation is automatic, the resulting rules are interpretable, and their structure is flexible.
Evolutionary Computation (EC) belongs to a family of problem solvers, based on trial and error strategies, that is widely used in finance [8]. This framework includes a number of optimization algorithms inspired by the principles of natural selection. These are based on populations of candidate solutions that are improved over a number of iterations. These include, among others, Genetic Algorithms (GA), Evolution Strategies (ES); Genetic Programming (GP) and Grammatical Evolution (GE). This work will we based on the last two.
GP is a type of Evolutionary Algorithm (EA) that uses a guided random search technique (GRST) for search optimization. GP is a refinement of GAs popularized by Koza [9], who considers that the problem solving process is equivalent to the search (within the space of possible computer programs) of a particular computer program, or highly adapted individual, that solves it.
Over time, researchers have developed a number of variations on the canonical algorithm. Among them, we could mention:
- •
Tree-based Genetic Programming (TGP)
- •
Stack-based Genetic Programming (SGP)
- •
Linear Genetic Programming (LGP)
- •
Extended Compact Genetic Programming (ECGP)
- •
Multi-Tree based Genetic Programming (MTGP)
- •
Multiobjective Genetic Programming (MOGP)
- •
Cartesian Genetic Programming (CGP)
- •
Probabilistic Incremental Program Evolution (PIPE)
- •
Strongly Typed Genetic Programming (STGP)
Grammatical Evolution is an evolutionary computation technique that is closely related to GP. They share the common objective of finding an executable program or a program fragment that will achieve a good fitness value for the given objective function. In GE, Ryan et al. [10] make use of variable length genomes, represented as integer vectors, to elaborate definitions of grammars to generate a large range of programs, of arbitrary complexity, by applying genetic operators.
The body of literature on trading rule generation using either GP or GE is large. However, it is also very heterogeneous. Most of the papers differ in the choice of core algorithms, technical indicators or data samples. The latter is specially relevant as GP/GE-based strategies tend to perform better in some settings (bear markets/sideways trends) and worse in others (upper trends), making performance comparisons over different samples rather problematic. That means that the evidence supporting the superiority of any of these two competing approaches over the other in this domain is very limited. In addition to this, even basic discussion on whether using basic extension like ADFs or mechanisms aimed to promote parsimony makes sense, are still pending. This work intends to fill that gap in the literature presenting a comprehensive set of experiments using STGP and GE with similar variations.
The goal of this work is to compare the two most popular approaches used to generate trading rules from tree-based flexible structures based on evolutionary computation. In addition to that, the study will analyze the importance of ADFs and the impact of the addition of a complexity control mechanism to both GP and GE. The analysis of the results will be based on financial returns and the complexity of the investment rules generated under different configurations.
In order to make the results comparable, both algorithms will use the same set of functions and indicators. In a first approximation, we will consider the set defined by Lohpetch and Corne [11] and a standard population size. This initial work will be subsequently expanded to assess the sensitivity of both algorithms, together with their variations, when we increase the population size and the number of technical indicators used.
The work is organized as follows: Section 2 presents a short overview of the relevant literature. Then, Section 3 will provide a description of the aspects of GP and GE evaluated and used in this work. That will be followed by a description of the experimental setup in Section 4, and the presentation of the main results in Section 5. Finally, Section 6 will be devoted to summary and conclusions.
Section snippets
State of the art
Academic research on automatic trading rule generation using GP, GE and their variations has a two-decade tradition that started with a seminal paper by Allen and Karjalainen [12]. This section will be devoted to present a number of key papers that will be classified according to the core underlying algorithm.
Genetic programming
GP is an stochastic optimization metaheuristic where a population of programs (individuals) is iteratively improved according to an objective function also known as fitness function.
Even though the algorithm has a number of limitations, like its computational cost, or the fact that it cannot guarantee global optima, it has very important advantages. Among these, we could mention the fact that it is easily paralleled; works with large solution spaces and complex fitness landscapes; it is easy to
Experimental design
As we mentioned in the introduction, the aim of this work is doing a comprehensive benchmarking exercise of the two most popular algorithms for trading rule generation based on evolutionary computation. This exercise will cover, not only the core algorithms, GE and GP, but also the impact of adding ADFs and complexity control mechanisms. Finally, we will study the sensitivity of the different configurations to population size and the function set.
In this section we describe the experimental
Baseline
The first set of experiments of this benchmarking exercise will set the baseline for the two core algorithms and their variations. We will compare the performance of both GP and EG vs. B&H strategy using populations of 500 individuals and the function set introduced in the previous section. The reported compounded returns have been computed according to Eqs. (2) and (4) discussed in 4.2. In addition to returns, we will consider other aspects such as complexity or reliability.
Table 3 summarizes
Summary and conclusions
The use of evolutionary computation in the domain of trading strategy generation and optimization has a long history. One of the most popular lines of research is the use of GP and GE to evolve investment rules based on technical indicators. Among the main advantages of this approach, we can highlight the possibility of obtaining rules that are flexible, as the structure is not completely predefined in advance, and interpretable.
The literature on this topic is based on studies with very
Acknowledgements
The authors acknowledge financial support granted by the Spanish Ministry of Science and Innovation under grant ENE2014-56126-C2-2-R.
Carlos Martín is a Graduate in Computer Science from UNED and M.S. in Computer Science and Technology from Universidad Carlos III de Madrid, where he is currently a Ph.D. student. His main interests in the field of Artificial Intelligence are focused on optimization techniques based on Evolutionary Computation. He is an engineer at the Security Operations Center of Cyberdefense in The Spanish Ministry of Defense, Officer in charge of the Forensics, Intrusion Detection, Malware Analysis and
References (57)
- et al.
Using genetic algorithms to find technical trading rules
J. Financ. Econ.
(1999) Risk-adjusted, ex ante, optimal technical trading rules in equity markets
Int. Rev. Econ. Finance
(2003)- et al.
Generating trading rules on the stock markets with genetic programming
Comput. Oper. Res.
(2004) - et al.
A genetic programming model to generate risk-adjusted technical trading rules in stock markets
Expert Syst. Appl.
(2011) - et al.
Genetic programming optimization for a sentiment feedback strength based trading strategy
Neurocomputing
(2017) - et al.
A novel approach to dynamic portfolio trading system using multitree genetic programming
Knowl.-Based Syst.
(2014) - et al.
Return predictability and the ’wisdom of crowds’: Genetic Programming trading algorithms, the Marginal Trader Hypothesis and the Hayek Hypothesis
J. Int. Financ. Mark. Inst. Money
(2015) - et al.
Robust technical trading strategies using GP for algorithmic portfolio selection
Expert Syst. Appl.
(2016) - et al.
Using genetic programming to learn and improve control knowledge
Artif. Intell.
(2002) - et al.
Rise of the machines: algorithmic trading in the foreign exchange market
J. Finance
(2014)
High Frequency Trading
News trading and speed
J. Finance
Algorithmic trading
Computer
The Dow Jones-Irwin Guide to Trading Systems
Efficient capital markets: a review of theory and empirical work
J. Finance
Foundations of technical analysis: computational algorithms, statistical inference, and empirical implementation
J. Finance
Biologically Inspired Algorithms for Financial Modelling
Genetic Programming: on the Programming of Computers by Means of Natural Selection
Grammatical Evolution: Evolving Programs for an Arbitrary Language
Springer Berlin Heidelberg
Outperforming buy-and-hold with evolved technical trading rules: Daily, weekly and monthly trading
Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics)
Gp and the predictive power of internet message fraffic
Genetic Algorithms and Genetic Programming in Computational Finance
GP-evolved technical trading rules can outperform buy and hold
Proceedings of the Sixth International Conference on Computational Intelligence and Natural Computing, Embassy Suites Hotel and Conference Center, Cary, North Carolina USA
Risk adjusted returns from technical trading: a genetic programming approach
Appl. Financ. Econ.
On predictability and profitability: Would GP induced trading rules be sensitive to the observed entropy of time series?
Stud. Comput. Intell.
Discovering effective technical trading rules with genetic programming: towards robustly outperforming buy-and-hold
Proceedings of the 2009 World Congress on Nature and Biologically Inspired Computing, NABIC 2009 - Proceedings
Comprehensibility and overfitting avoidance in genetic programming for technical trading rules
Technical Report
Testing market imperfections via genetic programming
Cited by (2)
Artificial intelligence applied to investment in variable income through the MACD (moving average convergence/divergence) indicator
2021, Journal of Economics, Finance and Administrative ScienceDynamic generation of investment recommendations using grammatical evolution
2021, International Journal of Interactive Multimedia and Artificial Intelligence
Carlos Martín is a Graduate in Computer Science from UNED and M.S. in Computer Science and Technology from Universidad Carlos III de Madrid, where he is currently a Ph.D. student. His main interests in the field of Artificial Intelligence are focused on optimization techniques based on Evolutionary Computation. He is an engineer at the Security Operations Center of Cyberdefense in The Spanish Ministry of Defense, Officer in charge of the Forensics, Intrusion Detection, Malware Analysis and Mitigation and Recovery sections.
David Quintana is an Interim Associate Professor with the Department of Computer Science at Universidad Carlos III de Madrid, Spain. There, he is part the bio-inspired algorithms group EVANNAI. He holds a Bachelor in Business Administration and a Ph.D. in Finance from Universidad Pontificia Comillas (ICADE), a Bachelor in Computer Science from UNED and an M.S. in Intelligent Systems from Universidad Carlos III de Madrid. His current research interests are mainly focused on applications of evolutionary computation and artificial neural networks in finance and economics. David is the current Chair of the Computational Finance and Economics Technical Committee of the IEEE Computational Intelligence Society.
Pedro Isasi Graduate and Doctor in Computer Science by the Polytechnic University of Madrid since 1994. Currently he is University professor and head of the Evolutionary Computation and Neural Networks Laboratory in the Carlos III of Madrid University. Dr. Isasi has been Chair of the Computational Finance and Economics Technical Committee (CFETC) of the IEEE Computational Intelligence Society (CIS), Head of the Computer Science Department and Vice-chancellor in the Carlos III University among others. His research is centered in the field of the artificial intelligence, focusing on problems of Classification, Optimization and Machine Learning, fundamentally in Evolutionary Systems, Metaheuristics and Artificial Neural Networks.