Improving technical trading systems by using a new MATLABbased genetic algorithm procedure
Post on: 16 Март, 2015 No Comment
![Improving technical trading systems by using a new MATLABbased genetic algorithm procedure Improving technical trading systems by using a new MATLABbased genetic algorithm procedure](/wp-content/uploads/2015/3/improving-technical-trading-systems-by-using-a-new_2.jpg)
Page 1
Mathematical and Computer Modelling 46 (2007) 189–197
www.elsevier.com/locate/mcm
Improving technical trading systems by using a new
MATLAB-based genetic algorithm procedure
Stephanos Papadamoua,∗, George Stephanidesb
aDepartment of Economics, University of Thessaly, Argonauton and Filelinon, Volos, Greece
bDepartment of Applied Informatics, University of Macedonia Economic and Social Sciences, Egnatias 156, Thessaloniki 54006, Greece
Received 18 May 2006; accepted 15 December 2006
Abstract
Recent studies in financial markets suggest that technical analysis can be a very useful tool in predicting the trend. Trading
systems are widely used for market assessment; however, parameter optimization of these systems has attracted little interest. In
this paper, to explore the potential power of digital trading, we present a new MATLAB tool based on genetic algorithms; the
tool specializes in parameter optimization of technical rules. It uses the power of genetic algorithms to generate fast and efficient
solutions in real trading terms. Our tool was tested extensively on historical data of a UBS fund investing in emerging stock markets
through our specific technical system. Results show that our proposed GATradeTool outperforms commonly used, non-adaptive,
software tools with respect to the stability of return and time saving over the whole sample period. However, we provided evidence
of a possible population size effect in quality of solutions.
c. 2007 Elsevier Ltd. All rights reserved.
Keywords: Financial markets; Prediction; Genetic algorithms; Investment; Technical rules
1. Introduction
Today’s traders and investment analysts require fast and efficient tools in a ruthless financial market. Battles in
trading are now mainly waged at computer speed. The development of new software technology and the appearance
of new software environments (e.g. MATLAB) provide the basis for solving difficult financial problems in real time.
MATLAB’s vast built-in mathematical and financial functionality, the fact that it is both an interpreted and compiled
programming language and its platform independence make it well suited for financial application development.
Evidence on the returns earned by technical rules, including momentum strategies (e.g. [14–16,16,25,20]), moving
average rules and other trading systems [6,2,9,24] can support the importance of technical analysis.
However, the majority of these studies have ignored the issue of parameter optimization, leaving them open to
criticism of data snooping and the possibility of survivorship bias [7,17,8]. Traditionally researchers used ad hoc
specification of trading rules. They use a default popular configuration or randomly try out a few different parameters
and select the best with criteria based on return mainly.
∗Corresponding author.
E-mail addresses: stpapada@econ.uth.gr (S. Papadamou), steph@uom.gr (G. Stephanides).
0895-7177/$ — see front matter c. 2007 Elsevier Ltd. All rights reserved.
doi:10.1016/j.mcm.2006.12.033
Page 2
190
S. Papadamou, G. Stephanides / Mathematical and Computer Modelling 46 (2007) 189–197
Papadamou and Stephanides [23], implemented a new MATLAB-based toolbox for computer aided technical
trading that has included a procedure for parameter optimization problems. However, the weak point of their
optimization procedure is time: the objective function (e.g. profit) isn’t a simple squared error function but a
complicated one (each optimization iteration goes through the data, generates trading signals, calculates profits, etc.).
When the data sets are large and you would like to reoptimize your system often and you need a solution as soon as
possible, then trying out all possible solutions to get the best one would be a very tedious task.
Geneticalgorithms(GAs)arebettersuitedsincetheyperformrandomsearchesinastructuredmannerandconverge
very fast on populations of near optimal solutions. The GA will give you a set (population) of “good” solutions.
Analysts are interested in getting a few good solutions as fast as possible rather than the globally best solution. The
globally best solution does exist, but it is highly unlikely that it will continue to be the best one.
The aim of this study is to show how genetic algorithms, a class of algorithms in evolutionary computation, can be
employed to improve the performance and the efficiency of computerized trading systems. It is not the purpose here
to provide theoretical or empirical justification for the technical analysis. We demonstrate our approach in a particular
forecasting task based on emerging stock markets.
This paper is organized as follows. Previous work is presented in Section 2. The data set and our methodology are
described in Section 3. The empirical results are discussed in Section 4. Conclusions follows Section 5.
2. Previous work
There is a large body of GA work in the computer science and engineering fields but little work has been done
concerning business related areas. Latterly, there has been a growing interest in GA use in financial economics, but so
far there has been little research concerning automated trading.
To our knowledge the first published paper linking genetic algorithms to investments was from Bauer and Liepins
[4]. Bauer [5] in his book “Genetic Algorithms and Investment strategies” offered practical guidance concerning how
GAs might be used to develop attractive trading strategies based on fundamental information. These techniques can
![Improving technical trading systems by using a new MATLABbased genetic algorithm procedure Improving technical trading systems by using a new MATLABbased genetic algorithm procedure](/wp-content/uploads/2015/3/improving-technical-trading-systems-by-using-a-new_1.jpg)
be easily extended to include other types of information such as technical and macroeconomic data as well as past
prices.
According to Allen and Karjalainen [1], genetic algorithm is an appropriate method to discover technical trading
rules. Fern´ andez-Rodr´ ıguez et al. [11] by adopting genetic algorithms optimization in a simple trading rule provide
evidence for successful use of GAs from the Madrid Stock Exchange. Some other interested studies are those by
Mahfoud and Mani [18] that presented a new genetic-algorithm-based system and applied it to the task of predicting
the future performances of individual stocks; by Neely et al. [21] and by Oussaidene et al. [22] that applied genetic
programming to foreign exchange forecasting and reported some success.
One of the complications in GA optimization is that the user must define a set of parameters such as the crossover
rate, population size and mutation rate. According to De Jong [10] who studied genetic algorithms in function
optimization good GA performance requires high crossover probability (inversely proportional to population size)
and a moderate population size. Goldberg [12] and Markellos [19] suggest that a set of parameters that works well
across many problems is a crossover parameter = 0.6, population size = 30 and mutation parameter = 0.0333.
Bauer [4] performed a series of simulations on financial optimization problems and confirmed the validity of
Goldberg’s suggestions. In the present study we will perform a limited simulation study by testing various parameter
configurations for the chosen trading system. We will also provide evidence for the GA proposed by comparing our
tool with other software tools.
3. Methodology
Our methodology is conducted in several steps. First, we have to implement our trading system based on technical
analysis. In developing a trading system, you need to determine when to enter and when to exit the market. If the
trader is in the market the binary variable Ftis equal to one otherwise is zero. As position traders we base the majority
of our entry and exit decisions on daily charts by constructing a trend following indicator (Dimbeta). This indicator
calculates the deviation of current prices from its moving average of θ1length. The indicators used in our trading
system can be formalized as below:
Page 3
S. Papadamou, G. Stephanides / Mathematical and Computer Modelling 46 (2007) 189–197
191
Dimbetat=Closet− MovAvt(Close,θ1)
MovAvt(Close,θ1)
(1)
where Closetis the closing price of the fund at time t and function MovAv calculates the simple moving average of