• 沒有找到結果。

Chapter 5. Simulation and Comparison of XCS, R-R XCS, and E&R-R XCS

5.1 Simulation on Finance Prediction

Global overnight effect is a well-known problem originated, which from trading time restriction each economic market [59], [60]. This designed simulation is just for the financial phenomenon that applied each prediction model, which is XCS, R-R XCS, or E&R-R XCS, to predict the stock trend of advance-decline ratio. Based on the complex finance issue, we developed three knowledge models to forecast the local stock market respectively. In the experiments, Dow Jones index (DJi) and Taiwan weight index (Twi) are chosen as reference and predicted markets respectively, and all models are trained by the historical data from markets.

5.1.1 Prediction on Global Overnight Effect

For development of the prediction model, some researches were almost successfully proven that their models were practicable for predicting the trend, but few of them were considered to the relative factors that was exactly affected the results. According to that, we

concerned the relative factors from global economic market much more. In the following sections, the relative factors would be firstly mentioned, and then the foundation of prediction flow would be detailed.

5.1.2 Input Factors and Overnight Effect Theory

For the model development and simulation, we choose the Taiwan weighted index (Twi) as an observed market and Dow-Jones index (DJi) as the overnight information reference market. First, the overnight effect theory is figured out in part I, shown as Figure 12. As the concern of the phenomenon, the time series data of stock becomes non-continuous and some trading behaviors maybe exist [61], [62]. Owing to the restriction on trading time, the opening price of the observed market would be affected not only by the overnight effect and the closing price of the previous day, but also by the opening or the closing price of the referent market. As regards the time θ, it is the proposed model starting to predict the trend of the next trading day by the current stock price and the following overnight information (roit) of non-trading period. As for part II, it is an inference from part I by DJi substituting for roit, and the following equations are the deduced steps.

Figure 12. Overnight Effect Phenomenon

1. As part I shown and only one observed market considered, the overnight effect could

affect the next day opening price, which is exhibited by eq.1, while P_Returnto+1 and Returntco are respectively denoted as the opening price of the next trading day and the trading return of the current day at the closing time.

2. In this step, the referent market, DJi, is additionally involved. Because the trading time of DJi is just during the time between the closing time and the opening time of Twi next day, the trading return of DJi (DJi_Returntco) is utilized to substitute the local overnight information (roit). In the meanwhile, eq. 1 would represent to eq. 2. P_TwiReturnto+1 is denoted the prediction return of the t+1 day opening of Twi. TwiReturntco is the Twi return of the current day.

o co co

t 1 t t

P_TwiReturn+ =TwiReturn +DJiReturn (2)

5.1.3 Prediction Model

Due to the overnight theory and the different time zone between Taiwan and US, the trading time of the DJi between PM 22:30 and AM 05:00 (Taiwan time), which crosses two days, the previous model we proposed contains two stages[63]. The first stage is to generate the predicted return of DJi. Second, the prediction trend of Twi is the final output. Based on this research, we simplify the prediction issue, which been only applied well-known DJi first to predict the trend of Twi.

As regards the input variables, the historical moving average data of price and volume are required based on stock prediction. Therefore, the price-volume moving average data and the moving average convergence-divergence (MACD) extended by the price moving average are both utilized as the input variables which would be translated into bit-string type. Predicting the Twi, about the price, the daily, weekly, monthly, and quarterly moving averages (1, 5, 20 and 60 days) are separately adopted as input variables (4 bits), down-trend (0) or up-trend (1), and their trend-permutation (4!=24 kinds) which would be

encoded by 5 bits. As for the volume, its daily, weekly and monthly (1, 5 and 20 days) moving averages are utilized as the input variables (3 bits), down-trend (0) or up-trend (1), and their trend-permutation (3!=6 kinds) which would be encoded by 3 bits. We have already considered the quarterly moving averages (60 days) of volume as input, but it is insensitive. Also, 8 kinds of statuses that encoded by 3 bits are presented by 12 and 26 MACD patterns. Additionally, DJi_Returni (3 bits) should be considered, and total input bits becomes to 21 bits. After the prediction flow, P_TwiReturnto+1(3 bits) would be obtained.

Figure 13. Distribution of Historical Return of (a) DJi and (b) Twi.

In Figure 13, it shows the distribution of the historical return data of DJi and Twi. In order to analyze, this research separates the data into 8 groups equally, 4 up-trends and 4

down-trends. These 8 groups are encoded by c1, c2, and c3, detailed as Table 4

In this simulation, we assume that the critical time for making prediction is several minutes before the day t+1 opening of Twi, when depends on the model performance.

Predicting the day t+1 opening return of Twi is the purpose of proposed model. Once day t+1 opening, the accuracy of predication would be calculated that means investors will

balance its investments at opening time to win the profit from the gap price because of overnight.

Table 4. Encoding Rule to the Fluctuation of DJi and Twi

Upswing (%) Downswing (%)

DJi Twi c1~c3

DJi Twi c1~c3

(0, 0.26] (0, 0.33] 000 (-0.23, 0] (-0.19, 0] 100 (0.26, 0.57] (0.33, 0.62] 001 (-0.53, -0.23] (-0.5, -0.19] 101 (0.57,1.03] (0.62, 0.97] 010 (-1.01, 0.53] (-1.06, -0.5] 110 (1.03, ∞] (0.97, ∞] 011 (-∞, -1.01] (-∞, -1.06] 111

相關文件