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

tl the beginning date of a learning period,

dl the duration of this learning period,

dm the longest period entering the technical trading rules (for example, moving averages need 50 days before the time of computing), and * dt is the length of the test period.

The variable tl then has to verify:

dm5tl5T  dt  dl

In fact, we cannot start the learning period before dm because we need at least dm trading days to calculate some of the indicators; on the other hand, if we start after T  dt  dl; then the test period will end after T; which is not possible.

Adjustment of endowments. We consider here a specific expert ek obtained for security k; at date tl; it is assumed that ek is endowed with a sure wealth wk0 and nk0 stocks. Let p0k be the initial opening price of the stock; the total wealth of the expert at the beginning of the process is then

W0k ¼ wk0 þ nk0p0k

At the end of the first date, the closing price P1k is observed; as mentioned earlier, three decisions are possible, buying, selling or doing nothing. Assume for example that the signal is ‘sell’. If the expert sells all his stocks, he then possesses only cash. Consequently, he cannot continue to sell on the next day because he has already sold all his portfolio. The problem is symmetric if the signal is ‘buy’.

We arbitrarily decided to allow a fixed percentage of adjustment (50% in the empirical test); that is to say that the expert can only buy an amount equal to wk0=2; rounded to obtain an entire number of stocks. In the same manner, only half of the portfolio of stocks can be sold when a selling signal appears. Obviously, the parameter defining the adjustable part of the portfolio can be fixed by the user.

Consider, for example, a buying order at the end of date 0. The trade will be executed at the opening price of the next day, that is p1k: If we denote by c the rate of transaction costs, then the number of stocks to be bought is equal to

                                                                                  wk         

                                                Dnk1 ¼ Ent Pkð1 0þ cÞ ¼ nk1  nk0

0

The evolution of wealth is then

wk1 ¼ wk0  nk1  nk0p1kð1 þ cÞ

nk1 ¼ nk0 þ Dnk1

It is worth noticing that we take into account the real market conditions in defining the number of stocks to be bought by considering P0k; which is observed at the end of the first day, while the variation of wealth is calculated with respect to the actual transaction price p1k; that is the next opening price:

When posting an order at the end of a period t; one cannot know the future wealth Wtþk 1; because the transaction price is not known with certainty. It means that our strategy, allowing only a part of the portfolio to be traded, is prudent and ensures that the expert will possess enough cash to trade.

Measurement of performance. The learning period extends from tl to tl þ dl; the benchmark we considered is an optimal expert, in this time frame, who is assumed to know the entire sequence of prices. He then always takes the right decision and obtains an optimal wealth at the end of the period. Obviously, the experts cannot attain such a performance but can be ranked according to the difference of final wealths. This benchmark is also used to fix the stopping criteria of the genetic algorithm. There are two ways to stop it;

Table I. Dates of the experiments.

Experiment

Beginning date

Start of the test(opening)

End of the test(close)

1

08=07=98

08=11=99

08=19=99

2

01=29=98

02=08=99

02=16=99

3

09=28=98

09=30=99

08=10=99

4

09=07=98

09=09=99

09=17=99

5

05=05=98

05=13=99

05=20=99

6

07=09=98

07=15=99

07=23=99

7

09=26=98

09=23=99

10=01=99

8

02=13=98

02=23=99

03=03=99

9

06=17=98

06=22=99

06=30=99

10

10=28=98

11=02=99

11=10=99