Applied stochastic models in business and industry. Stock timing using genetic algorithms, страница 3

k

See References [15,16] for a detailed description of these algorithms.

period. As in the preceding price channel rule, many MA can be tested by varying t1 and t2: In our approach, we let the genetic algorithm select the best combination of time windows.

2.3.  Rate of change

This decision rule is based on the ratio Pt=Ptn; if it is greater than 1 þ e with e > 0; then sell because the price will soon drop. If the ratio is lower than 1  e; then buy so as not to miss the next increase in prices. As we can see, this rule is very simple but the complex problem is now to choose n:

2.4.  Ease of movement value

Let PtmnðPtMnÞ;...;Ptm1ðPtM1Þ be the lowest (highest) prices for each of the days t  n;...;t  1 and Vtn;...;Vt1 the volumes of transactions. The ease of movement value index is then defined by

                                                                                Pn        ðPM      Pm Þ

                                                          EMVðnÞ ¼      k¼P1  n tk             tk

k¼1 Vtk

EMVðnÞ is considered as a measure of market volatility; for a fixed threshold s; the decision rule is buying if EMVðnÞ5s and selling if EMVðnÞ > s: There, the intuition is that volatility increases in bear markets, while it decreases in bull markets.

As can be seen, all these rules rely on intuition and on some psychological assumptions about the trading behaviour of investors. At first glance, no theoretical economic justification can be given for these trading techniques; however, they are widely used in the investment world.

3.  GENETIC ALGORITHMS

Genetic algorithms are search and global optimization methods based on the principles of biological evolution. Such evolutionary algorithms begin with a population of solution candidates (chosen at random in most cases), which have been evaluated according to a fitness function and then made to evolve through genetic operators like selection, cross-over, mutation and replacement. What is called a solution in our approach is an N-dimensional binary vector, denoted as e; where N is the number of technical rules involved in the decision process. The value ei is equal to 1 if e actually uses the ith rule to advise buying or selling. The set of solutions at a given stage of the evolutionary process is called a generation of experts.

Starting with the first random generation, the goal of the GA is to improve the fitness of solutions by evolving generations of experts. The intuition is that if two parents are characterized by a high level of fitness, crossing them will lead to a better performing ‘child’, called an offspring. However, as the space solution is large, some randomness is maintained through generations by a mutation operator, applied in some (infrequent) cases, so as not to lose genetic diversity. Roughly speaking, when two solutions are in the neighbourhood of a local optimum, crossing them will not greatly improve the solution and will not lead to the localization of the global optimum.

The main purpose of the GA is then to discover ‘quasi-optimal’ experts who take decisions based on a subset of technical rules selected among a set of rules introduced with no a priori on their relevance.

3.1.  Rules encoding and notations

Let S be the set of rules that can be used to take a trading decision on the market, the cardinality of which is with N: We call an expert (denoted as eÞ a vector belonging to f0;1gN; where ei ¼ 1 if the expert uses the rule i and ei ¼ 0 otherwise. Using the biological terminology, e is a chromosome and the components ei are genes: For example, if N ¼ 6 and e ¼ 001101; then expert e uses rules numbered 3,4 and 6 to take buying, selling or ‘do nothing’ decisions. There are in fact 2N possible experts found at the beginning of the process. It is obvious that an exhaustive exploration of the entire space is impossible and the role of the genetic algorithm is to search efficiently for an optimal expert in this enormous space where solutions might be. When expert e applies the financial rules for which ei ¼ 1; ne potential decisions appear, where ne ¼ PNi¼1 ei: In most cases, all the rules do not give rise to the same decision, so it is necessary to summarize all these results in order to choose just one decision from among the three possibilities. This is done by means of a valuation function denoted by f defined in the following way. Let dik be a variable taking three values depending on the result of rule i for expert k: