6
430 978-1-4244-1823-7/08/$25.00 c 2008 IEEE

[IEEE 2008 IEEE Congress on Evolutionary Computation (CEC) - Hong Kong, China (2008.06.1-2008.06.6)] 2008 IEEE Congress on Evolutionary Computation (IEEE World Congress on Computational

  • Upload
    chukiat

  • View
    213

  • Download
    1

Embed Size (px)

Citation preview

Page 1: [IEEE 2008 IEEE Congress on Evolutionary Computation (CEC) - Hong Kong, China (2008.06.1-2008.06.6)] 2008 IEEE Congress on Evolutionary Computation (IEEE World Congress on Computational

430

978-1-4244-1823-7/08/$25.00 c©2008 IEEE

Page 2: [IEEE 2008 IEEE Congress on Evolutionary Computation (CEC) - Hong Kong, China (2008.06.1-2008.06.6)] 2008 IEEE Congress on Evolutionary Computation (IEEE World Congress on Computational

Allen and Karjalainen [15] applied GA for a selection of trading rules, but those rules did not outperform the simple B&H strategy after deducting the transaction cost. Jiang and Szeto [16] applied GA with the various moving average indicators to extract a strategy for trading four hi-tech stocks listed in NASDAQ. The results showed that their GA-based strategy was superior to the B&H and random walk methods. Izumi et al. [17] used Genetic Network Programming to create buying and selling model by identifying the Japanese Candlestick chart patterns. Their strategy clearly outperformed the neural network-based methods on ten stocks listed in Tokyo Stock Exchange. However, both [16] and [17] did not take into account the brokerage fees, and their algorithms require a careful setting of many parameters. Ghandar et al. [18] reported a framework in which the evolutionary algorithm managed a portfolio of stocks using the fuzzy trading rules. This framework was successfully tested with data from the stocks listed in Australian Stock Exchange while being simulated with 0.5% transaction costs.

III. THE PROPOSED TRADING STRATEGY FROM PREDICTION

This section formulates a simple trading strategy from prediction of the next-day market index. The required input data are only the daily opening, high, low, and closing prices of the index in consideration. Here are steps of the algorithm: 1. A set of basic technical indicators are built and then

used as independent variables in the prediction model. 2. The next-day closing indices are predicted by the model

that is optimized with an evolutionary algorithm. 3. The prediction results are used in a simple trading rule

for creating the trading signals (buy, sell, or no-change). More details will be elaborated later in Section C.

4. The return of investment, defined as the ratio of money gained or lost from an investment over the amount of money invested at the beginning, is then calculated for a performance comparison.

A. Prediction Model Technical analysis is a class of techniques for predicting

the price trend and reversal based on historical data. These techniques can be divided into 3 groups [9]: 1. Trend Analysis used to indicate whether a new trend has

appeared in the data, or whether an existing trend has finished. Widely used indicators include, e.g., Simple Moving Average (SMA), Exponential Moving Average (EMA), and Directional Movement Index (DMI).

2. Momentum Analysis measures the rate of price changes as opposed to the actual price levels. Relative Strength Index (RSI), Moving Average Convergence-Divergence (MACD), Fast and Slow Stochastic (KD-Line), and Oscillator (OSC) are among those popular indicators.

3. Volatility Analysis measures the rate of random change in market prices. The only indicator used is the Volatility Index (VI).

In this prediction model, the independent variables considered are EMA and OSC, which are two of the most popular and effective indicators. EMA is used to smooth out the short-term fluctuations in an exponential way, thus highlighting the longer-term trends or cycles. Whereas OSC is a momentum indicator that compares the closing price of a financial instrument to its price range over a given time span. The formula for EMA(N) and OSC(N) are as follows:

12 1( ) ( )

1 1t t tNEMA N P EMA N

N N −

−= ⋅ + ⋅

+ +

1 ( 1)

1 ( 1) 1 ( 1)

( , , ..., )( )

( , , ..., ) ( , , ..., )t t t t N

tt t t N t t t N

P Min P P POSC N

Max P P P Min P P P− − −

− − − − − −

−=

In this study, seven independent variables considered are listed in Table I. Generally the historical opening, high, low, and closing indices of a market can be easily obtained from various public sources. The remaining variables are easily calculated. Let Yt be the closing index on day t (Closet). The dependent variable in the model ( t+1) is the predicted closing index on day t+1 (predicted Closet+1), which will be used later in the trading rule.

TABLE IINDEPENDENT VARIABLES IN THE PREDICTION MODEL

Variables Description Close Closing index at day tChange Closet – Closet-1

OSC1, OSC3 OSC(1)t and OSC(3)t

PEma5 = Closet – EMA(5) PEma10 = Closet – EMA(10)

Differences of the closing index and the exponential moving averages (EMA) for 5 and 10 days respectively at day t

E5E20 = EMA(5) – EMA(20) Difference of the 5-day EMA and 20-day EMA at day t

B. Model Formulation and Optimization Let X1, X2, …, X7 be the seven independent variables listed

in sequence in Table I, i.e. [X1,t, X2,t, …, X7,t] = [Closet,Changet, OSC1t, OSC3t, PEma5t, PEma10t, E5E20t]. The following model as given in equation (1) is used to predict the next-day closing index ( t+1):

7

1 ,1

ˆ it i i t

i

bY a X+

=

= (1)

Fourteen variables ai and bi, where i ∈ {1, …, 7}, are to be optimized by the algorithm1. In this experiment, the boundary set for each ai is [-100, 100]. However, the possible values for each exponential term (bi) are limited to [-5, 5] with two decimal places at the most, in order to simplify the resulted model for financial analysts.

The prediction model will be optimized using a self-adaptive differential evolution algorithm. A brief review of the algorithm is given in Section IV. A composite of the root mean square error (RMSE) and the prediction of change in direction (POCID) is used as the objective function value for the algorithm to minimize. Both RMSE and POCID are two

1 Note that each term is a protected one, i.e., if X < 0 then Xb = -|X|b else if X = 0 then Xb = 1.

2008 IEEE Congress on Evolutionary Computation (CEC 2008) 431

Page 3: [IEEE 2008 IEEE Congress on Evolutionary Computation (CEC) - Hong Kong, China (2008.06.1-2008.06.6)] 2008 IEEE Congress on Evolutionary Computation (IEEE World Congress on Computational

+ +

=

= −

=

=

Δ

Δ

Δ

Δ

Δ

Δ

Standard Differential Evolution (DE) algorithm starts with an initial population of vectors that are randomly generated. Successive populations are generated by

[21]

432 2008 IEEE Congress on Evolutionary Computation (CEC 2008)

Page 4: [IEEE 2008 IEEE Congress on Evolutionary Computation (CEC) - Hong Kong, China (2008.06.1-2008.06.6)] 2008 IEEE Congress on Evolutionary Computation (IEEE World Congress on Computational

2008 IEEE Congress on Evolutionary Computation (CEC 2008) 433

Page 5: [IEEE 2008 IEEE Congress on Evolutionary Computation (CEC) - Hong Kong, China (2008.06.1-2008.06.6)] 2008 IEEE Congress on Evolutionary Computation (IEEE World Congress on Computational

434 2008 IEEE Congress on Evolutionary Computation (CEC 2008)

Page 6: [IEEE 2008 IEEE Congress on Evolutionary Computation (CEC) - Hong Kong, China (2008.06.1-2008.06.6)] 2008 IEEE Congress on Evolutionary Computation (IEEE World Congress on Computational

J. R. Koza, , Cambridge, Mass.: MIT Press, 1992.

Adaptation in Natural and Artificial Systems

J. Brest, S. Greiner, , M. Mernik, and , ‘‘Self adapting control parameters in differential evolution: A comparative study on numerical benchmark problems,’’ IEEE Trans. Evol. Comput., vol. 10, no. 6, pp. 646---657, Dec. 2006.

2008 IEEE Congress on Evolutionary Computation (CEC 2008) 435