Grammatical Evolution-based ensembles for algorithmic trading
Introduction
Stock market is highly dynamic and subject to structural changes. Trading rules might be very profitable during specific periods of time and progressively lose their effectiveness as market dynamics evolve over time. This requires developing approaches capable of detecting and adapting to these structural changes.
Since Allen and Karjalainen [1] published their seminal piece on evolution of trading rules using Genetic Programming (GP), many authors have made related contributions either based on the same technique, or Grammatical Evolution (GE). Among them, [2], [3], [4], [5], [6], [7], [8], [9].
Most of these contributions generate investment rules based on a combination of raw market data and technical indicators and, unlike related approaches that use genetic algorithms or evolution strategies to optimize predefined rules, these have the advantage of creating flexible structures automatically. Other algorithms within the evolutionary computation framework, like the ones discussed in [10], [11], would be readily applicable to related financial problems like mean–variance portfolio optimization, but would require significant adaptations and domain expertise to evolve the functional trees that GP and GE generate.
A common limitation is that it is often the case that the methods are static, and do not take into account structural changes. Given that this phenomenon is very prevalent in financial time series, decision rules are commonly derived from market environments that do not hold for long periods.
The problem of adjusting to structural changes is that we must choose between two opposite extremes: keeping the same model over time, or updating it constantly. Even though the second might seem, at least in principle, more appropriate, there is a possibility that the constant change in the model will have undesirable consequences due to transaction costs. The evolutionary process of GP/GE considers commissions within the fitness function, and that makes it select rules that generate a limited number of signals. However, it is possible that constant model updates might interfere with that endogenous control mechanism of the number of purchase and sale orders.
This paper introduces a dynamic trading system based on the use of ensembles and GE. The approach combines the possibility of changing the model, as a reaction to changes in the price generation mechanism, with an inertia component that mitigates the consequences of overtrading.
An ensemble in this context can be compared to a collegiate decision committee in which the votes of several judges are combined to arrive at a final decision [12]. The idea behind this method is to take advantage of the good local behavior of each of the judges, in order to increase the accuracy and reliability in the environment of a global scenario [13]. In Statistics and Automatic Learning, ensemble methods use multiple learning algorithms to obtain a better predictive performance than that which could be obtained from any of the constituent learning algorithms separately [14], [15], [16]. Unlike a statistical set, which is generally infinite, an automatic learning set consists of only a finite set of alternative models but typically allows a much more flexible structure to exist by combining those alternatives.
It is worth noting that the solution that we introduce integrates the output of several trading rules to generate a combined recommendation that makes financial sense in dynamic environments. This differs from other algorithmic solutions that rely on ensembles of models to tackle more standard classification or regression tasks, such as [17], [18]. The aim of trading algorithms is obtaining profitable rules, and one might consider that this task implicitly requires solving two problems. The first one would involve predicting market movements based on past information, for instance, it might predict whether the market is expected to go up, down, or remain stable, while the second one would be exploiting the previous information to obtain investment recommendations. Algorithms like the ones that we just mentioned might well excel at the first task, but lack the second layer.
Joint solutions are widely used in Artificial Intelligence, especially in neural networks (Hansen and Salamon [19]; Perrone and Cooper [20]; Opitz and Shavlik [21]). In these cases, several classifiers, usually neural networks with different topologies and/or parameters, are used to classify the same input pattern and their votes are combined using a specific rule such as majority, arithmetic mean, weighted average, etc. However, there are other works related to GP, such as Grosan et al. [22], that use the technique of ensembles in the context of obtaining investment models in financial markets. In this work, as we will discuss, the decisions committees are formed by different trading rules obtained using GE as the basic optimization algorithm and a sliding window.
The structure of the rest of the document is as follows: the next section describes the main references on GE for algorithmic trading and Evolutionary Computation (EC) based on adaptive approaches. Then, Section 3 describes the proposed approach. That will be followed by Section 4, focused on the experimental analysis. Finally, Section 5 will be devoted to summary and conclusions.
Section snippets
Previous work
The academic literature on GE for algorithmic trading is not as ample as the one based on GP. However, there are a number of relevant contributions that deserve to be mentioned.
One of the first works, in which evolutionary grammars are used to discover trading rules based on technical indicators, is that of Brabazon and O’Neill [23]. These authors explored the possibility of using this technique to generate investment rules for the money market. In their study, they combined a small set of
Proposed approach
This section starts with an introduction to the standard approach to evolve trading rules with flexible representation using GE. As it was mentioned before, the standard method suffers from some limitations in a domain where structural change is prevalent. For this reason, we then introduce an adaptive ensemble approach designed to overcome them and improve performance.
Experimental analysis
In this section we describe the experimental setup, including elements like the dataset, the experimental protocol and the parametrization, followed by the presentation and discussion of the results.
Summary and conclusions
The evolution of trading rules with flexible representation using Grammatical Evolution in its standard version involves obtaining a single rule based on a training period that is subsequently used to generate recommendations over time. Given the prevalence of structural change in financial series, this poses a problem.
In this paper we suggested using an ensemble of trading rules obtained using Grammatical Evolution on a sliding window. The system has a critical component, the voting mechanism,
Declaration of Competing Interest
No author associated with this paper has disclosed any potential or pertinent conflicts which may be perceived to have impending conflict with this work. For full disclosure statements refer to https://doi.org/10.1016/j.asoc.2019.105713.
Acknowledgment
The authors would like to acknowledge the financial support of the Spanish Ministry of Science, Innovation and Universities under project PGC2018-096849-B-I00 (MCFin).
References (36)
- 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.
A genetic programming model to generate risk-adjusted technical trading rules in stock markets
Expert Syst. Appl.
(2011) - 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) - C. Setzkorn, L. Dipietro, R. Purshouse, Evolving rule-based trading systems, in: 36th Annual Meeting of the CEA,...
- et al.
On predictability and profitability: Would GP induced trading rules be sensitive to the observed entropy of time series?
Stud. Comput. Intell.
(2008) - D. Lohpetch, D. Corne, Discovering effective technical trading rules with genetic programming: Towards robustly...
- et al.
Outperforming buy-and-hold with evolved technical trading rules: Daily, weekly and monthly trading
- et al.
Does size matter? A genetic programming approach to technical trading
Quant. Finance
(2010) - et al.
Multi-objective evolutionary approach to select security solutions
CAAI Trans. Intell. Technol.
(2017)
Second-order DE algorithm
CAAI Trans. Intell. Technol.
Ensemble Methods: Foundations and Algorithms
An automated investing method for stock market based on multiobjective genetic grogramming
Comput. Econ.
Popular ensemble methods: An empirical study
J. Artif. Intell. Res.
Ensemble based systems in decision making
IEEE Circuits Syst. Mag.
Ensemble-based classifiers
Artif. Intell. Rev.
Diverse classifier ensemble creation based on heuristic dataset modification
J. Appl. Stat.
Forest type identification by random forest classification combined with spot and multitemporal SAR data
J. Forestry Res.
Cited by (4)
Developing a smart stock trading system equipped with a novel risk control mechanism for investors with different risk appetites
2022, Expert Systems with ApplicationsCitation Excerpt :When such an approach is used, the efficiency of a trading system is shown only on a single stock or a market index. In this approach, since several shares or the whole stock market are not simultaneously taken into account, the system may generate fewer opportunities to achieve returns (Briza & Naval, 2011; Chakole et al., 2021; Cheng et al., 2018; Göçken et al., 2016; Hung et al., 2021; Kara et al., 2011; Lei et al., 2020; Luo et al., 2017; Martín et al., 2019; Roondiwala et al., 2015; Singh & Srivastava, 2017). Furthermore, as stated in the financial literature, diversification or the use of several stocks instead of one share reduces the risks involved.
FLF-LSTM: A novel prediction system using Forex Loss Function
2020, Applied Soft Computing JournalCitation Excerpt :When the prices depreciate, a quote currency is bought against the base currency, which leads to profit, and when the prices elevate, the base currency is bought against the quote currency. On average, the forex market has a 3 to 5 trillion-dollar business exchange, which fascinates the researchers to predict the trend in order to generate more profit [4,5]. Unlike stocks, the forex market is one of the utmost intricate markets because of its characteristics of high volatility, nonlinearity, and irregularity.
Financial Time Series Forecasting: A Data Stream Mining-Based System
2023, Electronics (Switzerland)Dynamic generation of investment recommendations using grammatical evolution
2021, International Journal of Interactive Multimedia and Artificial Intelligence