36,99 €
Diploma Thesis from the year 2007 in the subject Computer Science - Programming, grade: 1.7, University of Hamburg, language: English, abstract: In this thesis Genetic Progrmming is used to create trading systems for the EUR/USD foreign exchange market using intraday data. In addition to the exchange rates several moving averages are used as inputs. The developed evolutionary algorithm extends the framework ECJ. The created trading systems are being evaluated by a fitness function that consists of a trading simulation. Genetic operators have been adapted to support "node weights". By using these on the one hand macromutaion is tried to be reduced on the other hand the interpretability of the created trading systems is tried to be improved. Results of experiments show that created trading systems are apparently successfull in profitably using informations contained within the exchange rates. Profits of the created trading systems are maximized by using the optimal position size. It is shown that if the minimum investment period is met the achieved results are optimal even when taking into account the used risk adjusted performance figure.
Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:
Veröffentlichungsjahr: 2012
Impressum:
Copyright (c) 2015 GRIN Verlag / Open Publishing GmbH, alle Inhalte urheberrechtlich geschützt. Kopieren und verbreiten nur mit Genehmigung des Verlags.
Bei GRIN macht sich Ihr Wissen bezahlt! Wir veröffentlichen kostenlos Ihre Haus-, Bachelor- und Masterarbeiten.
Jetzt bei www.grin.com
Contents
Chapter 1 Introduction
1.1 Motivation
1.2 Objective and structure
Chapter 2 Basic principles and state of the art
2.1 Genetic Programming
2.1.1 Program Structure
2.1.2 Initialization of the GP Population
2.1.3 The Genetic Operators
2.1.4 Fitness Function
2.1.5 Selection
2.1.6 Process of the algorithm
2.1.7 Crossover, building blocks and schemata
2.1.8 Approaches against macromutation
2.1.9 Modularization
2.1.10 Further approaches for improvement
2.2 Artificial Neural Networks
2.2.1 Components of neural networks
2.2.2 Network topologies
2.2.3 Learning methods
2.3 Trading Systems
2.3.1 Tape Reader
2.3.2 Market timing
2.3.3 Position sizing
2.3.4 Comparison of trading systems
2.3.5 Fundamental versus technical analysis
2.3.6 The Currency Market
2.3.7 Approaches for the development of trading systems
Chapter 3 Draft
3.1 Overview
3.2 Requirements on the software
3.3 Conception of software
3.3.1 The Evolutionary Algorithm
3.3.2 The fitness function
Chapter 4 Implementation
4.1 Components of the developed software
4.2 Classes of the exchange rate data server
4.3 Classes of the Evolutionary Algorithm
4.4 Overview over the framework ECJ
4.5 Problems during experiments
Chapter 5 Experiment results
5.1 Results with node weights
5.1.1 Results of the training time period
5.1.2 Results of the validation time period
5.1.3 Results of the test time period
5.1.4 Results as monthly turnovers
5.1.5 Created trading rules
5.2 Results without node weights
5.2.1 Results of the training period
5.2.2 Results of the validation time periods
5.2.3 Results of the test period
5.2.4 Results as monthly returns
5.2.5 Created trading rules
5.3 Identification and application of optimal f
Chapter 6 Discussion and evaluation
6.1 Outlook
Chapter 7 Summary
List of Figures
Bibliography
Glossary
The natural evolution has turned out to be a most successful mechanism for the engenderment and adaptation of creatures to the environment. Without receiving any particular instructions or even precise objective definitions, it has succeeded in finding sophisticated solutions for problems existing in the real world.
Genetic Programming (GP) is an approach for using the creative power within the natural evolution for the automatic development of computer programs (cf. (Koz92, Chapter 1-6)). It is used to try to simulate mechanisms of the natural evolution in order to generate automatic programs solving a given problem. In a series of applications, GP has been used for solving mathematical problems as well as for solving real-world problems successfully. Among them are counted such problems as symbolic regression, (cf. (Koz92, cf. Chapter 10)), classification (cf. (Koz92, Chapter 17)), the synthesis of artificial neural networks (cf. (Gru94, Chapter 2 following)), pattern recognition ((Tac93, pages 2 to 10)), robot control (cf. (BNO97, pages 2 to 10)) and the generation of images (cf. (GH97, pages 2 to 7)) are counted among these problems.
Automated learning by means of GP can be interpreted as heuristic search algorithm finding out of the set of all possible programs those offering the best solution for the given problem. Dependent on the given problem, the search range is very large and oftentimes neither continuous nor differentiable and thus the search range of all possible programs is ill-fitting for classical search algorithms (cf. (LP02, page 2 following)).
In this thesis, the GP is applied in the scope of the generation of trading systems for the financial market, especially for the currency market. In the financial markets, successful speculative dealers use to act on the basis of a certain set of rules. However, these rules are subject to a relatively broad interpretation. After a careful review it becomes evident that, in decisive situations, the dealers deviate from the regulations they believe to determine their action and act according to their "gut feeling" as it were. It is possible that this portion of intuitive action distinguishes an experienced and profitable dealer from an inexperienced and unprofitable dealer, even if both of them believe that they are working on the basis of the same set of regulations. The definition of a trading system by a human being is subject to some difficulties, for he cannot reproduce all of the rules unequivocally. This is why the transfer of action defining sets of rules to the computer has turned out to be unsuccessful.
There is another approach to have the computer learn the rules for action automatically. To do so, e.g. Artificial Neural Networks (NN) are applied successfully (cf. (Ska01, pages 2 to 5), (MK, pages 2 to 7)). However, it is not possible to extract the several rules from the network in a way that allows an easy interpretation without difficulties. Users criticize this "black box" property of NN. GP is proposing itself as alternative to NN, for it can generate rules directly and they can be interpreted in a better way despite a certain complexity (cf. (YCK05, page 23 following)). As far as the solution of difficult problems is concerned, both approaches are comparable (cf. (BB98, page 13)).
It is the objective of this thesis to apply GP, in order to generate trading systems and to analyze their profitability in the framework of a historical simulation. A software system, that solves this task, is designed and interesting implementation aspects are presented.
To be able to develop trading systems with GP, the software, that is to be developed, has to meet a number of requirements. The development of the trading systems is to be made on the basis of historical time series of exchange rates and prices. The market is supposed to change in the course of time and so trading systems, that have been profitable before, are going to lose their profitability. For that reason, the development system of the trading system has to be conceived in a way to allow the generation of new trading systems adapted to the changed market conditions. To guarantee the provision of current price data, the relevant market data have to be collected continuously and provided to the development system. The development of profitable trading systems is supported by preprocessed data of the price data, that are securities dealers known and used, are provided to the system. To enable a visual verification, the preprocessed data as well as the transactions of the trading systems should be represented graphically. An over-optimization at the development of the trading systems is to be avoided by subdividing the available price history in a training, validation and test period. In order to get a trading system for the test period, the best trading systems of the training period are applied to the validation period. The best trading system during the validation is chosen for the trade in the test period. It should be possible to reproduce the development process and it should be transparent by means of log-files of the intermediate results. Trading systems of a too high complexity make users sceptical, as it is difficult to retrace the decisions of the system. Even if more complex trading systems would provide a higher return, a certain degree of traceability of the trading systems is to be targeted. In addition to the limitation of the size of the trading systems, the standard GP is expanded by means of node weights. This is how one tries, on the one hand, to reduce the macromutation by means of the crossover operator and, on the other hand, to simplify the capability of interpretation of the generated trading systems (cf. 3.3.1 on page 41).
Structure of this thesis To begin with, the basic principles and the state of the art of the Genetic Programming and the Artificial Neural Networks will be presented in Chapter 2.1 on page 5. The design and the function of NN will be analyzed, for this approach is widely spread in the context of the development of trading systems. After that the basic principles of technical trading systems will be presented from Chapter 2.3 on page 18 onwards. On the one hand, the technical analysis is presented as an instrument for finding favourable moments for trading, on the other hand, an approach is shown for defining the optimum trade position size. About both of these presented approaches for the automated learning, different authors have reported successful applications. Some of these successful applications are described in Chapter 2.3.7 on page 33.
From Chapter 3 on page 37 onwards, one will find the design of a system for generating, optimizing and testing trading systems by means of GP on the basis of historical price and exchange rate data. After an overview of the system, the requirements will be presented and a concept for the software is developed. The properties of the evolutionary algorithm relevant for the Genetic Programming will be defined. The implementation details are described from Chapter 4 on page 47 onwards. The results of the experiments made with the system are shown from Chapter 5 on page 55 onwards.
After that there is a discussion and evaluation of the results as well as an outlook on possible further developments of the system in Chapter 6 on page 73.
In this Chapter, the basic principles of Evolutionary Algorithms and artificial neural networks are presented and the current state of the art is described. After that the relevant principles of the application area, the technical trading systems, are discussed.
Genetic Programming (GP) is an algorithm out of the family of the evolutionary algorithms. In the nature, the evolution has turned out to be a very successful system for the further development and optimization of all creatures. Evolutionary algorithms are simulating the essential and successful features of the natural evolutionary process by means of simple models. In this way, they make it possible to find good solutions with little effort, even if there are problems with a great search range. Data structures and algorithms are generated and optimized by the Evolutionary Algorithms, in order to solve given problems. This introduction follows the studies of Banzhaf et al. (BNKF98, Chapter 1-8) as well as Koza, who has described GP in (Koz92) for the first time. In the following passages there is a brief description of how a program is structured in the GP and how the evolution works. After that existing problems of the procedure as well as the approaches to a solution for them are discussed.
The individuals evolutionarily developed during the GP are programs. These programs are made up of functions and terminals (cf. (BNKF98, pages 109 to 118)).
The selection of the used functions within a genetic program is dependent on the specific application area. An essential requirement for the selection of the functions, provided to the genetic program, is that it should be possible to make up a solution for the application problem out of them. To avoid an unnecessary enlargement of the search range, however, there should not be provided too many functions. According to Banzhaf et al. in (BNKF98, page 111 following) as well, it does not make sense to develop functions that are specially-tailored to the given problem from the very outset of an application. Since GP is very creative as far as the combination of functions is concerned, it may be sufficient to provide simple functions such as the Boolean and arithmetical functions to achieve amazing results.
The arguments of the applied functions are terminals. On the one hand, they are made up of the input data used by the system for training and, on the other hand, of constants changed in the course of the evolution. These constants are called "ephemeral random constants" (ERC) (cf. (Koz92, page 242 following)). The closure of the functions with respect to the terminals is an essential requirement for the error-free function of the generated programs. The applied functions must be designed in a way that enables them to process all types of input values: for example, the division often is adjusted in order to keep the program from aborting in case there are divisions by zero.
To determine the sequence of the evaluation of the program functions, the functions and terminals of a program are stored in a corresponding data structure. Most often, tree structures are used to do so. However, also linear structures as well as general graphs are used as organization forms.
In the case of tree structures, the usual sequence of the evaluation is from left to right: the furthermost left node furthermost within the tree structure, for which all entries are available, is executed. The most prominent representative of a linear structuring of the functions and terminals is the simulation of a register machine. It disposes of several registers, a linear memory for the allocation of terminals to the registers as well as functions that use the registers for the input/output.
A relatively new variant of the structuring are directional graphs that may include cycles (cf. (BNKF98, page 116 following)). What makes this structure interesting is the fact that loops and recursion are resulting in the course of the evolution and do not have to be provided by special functions beforehand. However, superfluous cycles could become problematic for they are extending the program run unnecessarily.
Since the tree structure is the most wide-spread data structure for individuals and is used for the application example as well, only this data structure will be considered in the following.