Sunteți pe pagina 1din 18

Predicting the IMKB 30 Index

Berkant Barla Cambazo~glu


Dept. of Computer Engineering
Bilkent University, 06533 Ankara, TURKEY

Abstract. Use of machine learning techniques for nancial prediction


is a common interest point for academic, nancial and commercial soci-
eties. In particular, stock markets due to their inherent potential for high
revenues are highly focused in research literature. Unfortunately, most
results obtained so far indicate that, in general, stock markets present
a random-like behavior. The risky, highly-volatile and easily-in uenced
nature of stock markets, when combined with the human factor, prevents
making pro table and generalizable predictions. In this sense, this pa-
per is yet another attempt to predict the unpredictable. This work, as a
case study, considers the IMKB 30 index and investigates the possibility
of making pro t using the past index data. For this purpose, two pre-
diction models have been tried. In the rst model, a back-propagation
neural network has been constructed to simulate the daily market price
changes. It has been observed that, in IMKB 30 index, the closing prices
followed an almost random path, but useful predictions can be made
about the lowest and highest price changes. The neural network model
predicted the sign of change in the highest daily price 77.8% of the time
correctly, where the base-line accuracy was around 51.5%. In the second
model, market returns have been quantized into a number of categorical
values, and a pattern discovery algorithm has been utilized to nd out
the useful patterns. The extracted patterns are used to construct buy
and sell rules. Finally, we investigated the e ect of transaction date on
price movements. Some statistical evidence has been found indicating
the existence of temporal patterns in IMKB.

1 Introduction
1.1 Background
Predictability of stock markets is subject to long debate [1, 2]. No prediction
tool which applies to all stock markets and guarantees high pro ts has been
published yet. Even if such a tool existed, it remained unpublished due to two
obvious reasons: First, the material gain of such a tool is beyond the moral gain
that can be made by the publication of the tool. Second, the public and wide-
spread use of the tool would render the predictions made by the tool almost
useless.
The two well-known hypothesis which foster the pessimism even further are
the ecient market hypothesis and the random walk hypothesis. The ecient
market hypothesis states that at any time, the value of a stock re ects its actual
value, that is, any information that can a ect the stock price must have been
Table 1. Possible outcomes of a transaction made by a prediction tool.
Case Trader has Prediction Price Trading Result
stock made change action
1 No Down Down Wait Nothing lost or gained
2 No Down Up Wait Nothing lost or gained
3 No Up Down Buy Lost money
4 No Up Up Buy Gained money
5 Yes Down Down Sell Avoided the fall
6 Yes Down Up Sell Missed the rise
7 Yes Up Down Hold Lost money
8 Yes Up Up Hold Gained money

already re ected on the stock price. Depending on the availability and type of the
information, three di erent forms of this hypothesis exist. The weak form states
that past price movements have no use. The semi-strong form states that publicly
available information such as company balance sheets and pro t forecasts have no
use. The strong form states that even private information is not useful. Although
the weak and semi-strong forms are widely accepted, there is no consensus on
the validity of the strong form.
The other important hypothesis, namely, the random walk hypothesis is a
variant of the ecient market hypothesis. It claims that the stock prices do
not follow any patterns, and there is no way to predict the future prices using
the past data. According to this hypothesis, a trader investing his money in an
ecient market is no di erent than a gambler playing card games in a casino.
Despite all this pessimism, stock market prediction models are still being pub-
lished showing how to make money in some particular stock markets, within some
speci c time intervals or under some special circumstances [9, 13, 14, 16, 17].
All these prediction models are common in that they develop some buy and sell
strategies depending on the behavior of the past technical and fundamental data.
The technical data includes the previous prices of a stock, total number of trans-
actions, transaction volume, and the values obtained from technical indicators.
Fundamental data includes the general economic parameters and information
about company activities. Economic parameters are such as in ation rate, in-
terest rate and currency exchange rates. Parameters about a company include
data about its sales performance, pro ts, debts and estates. It is also possible
to use combinations of technical and fundamental data for prediction (such as
price/earning rate).
Although most people think that making transactions relying on the predic-
tions of a non-living trader is doubtful and risky, in fact, decisions of a prediction
tool are actually no worse than that of a naive stock trader who has no insider
information. Table 1 displays eight possible scenarios each formed depending on
the current portfolio of the trader and the correctness of the trading system's
decisions. Assuming all scenarios are equally probable, at least half of the time
(cases 1, 2, 5 and 6), the trader can avoid the risk just by staying out of the
market. In the four remaining cases, the trader either looses (cases 3 and 7) or
gains (cases 4 and 8) money. Surely, in a more detailed analysis, current inter-
est rates, amount of transaction fees, the frequency of the transactions and the
prediction accuracy of the system play an important role.

1.2 Previous Work


Application of prediction models to nance is not only limited to stock mar-
kets. Such models have been extensively applied to nance problems where the
forecasting is important. These include bankruptcy prediction, credit approval,
prediction of customer behavior, economic forecasting, portfolio management
and some others.
So far, many machine learning techniques have been tried in nancial fore-
casting. Forecasting systems going beyond statistics used underlying genetic pro-
gramming [7], neural network [6], decision tree, pattern discovery algorithms [8].
Among these techniques, probably, the most frequently tried one is neural net-
works. There exists concrete evidence on superiority of neural networks over
traditional statistics in the literature. For neural network applications in nance
domain, [3] can be referred to. [11] is a good overview of neural networks in
time series forecasting.
For stock market prediction, [5] gives a nice survey and supplies basic infor-
mation on the issue. Predictability of the stock markets and the e ect of noise
is discussed in [12]. In [13], as a case study, a prediction system is proposed for
the S&P 500 index. A similar study is carried out in [14], and quite satisfactory
results are obtained for the KLSE index. In [10], human elicitation is combined
with a neural network model to predict the gold market. In [9], seasonal e ects
in Swedish stock market is investigated. [16], speci cally, examined the pat-
terns observed before high price changes in Paris stock market. In [17], pattern
recognition models have been used over the discretized time series for DAX and
FTSE 100 indices.

1.3 Work Done


In this work, two prediction models have been constructed to forecast the be-
havior of IMKB 30 index. I_stanbul Menkul Kymetler Borsas (IMKB) is a rel-
atively young market and price movements are known to be highly speculative.
Although periods which resemble both bull and bear markets exist, due to its
highly volatile nature and sudden price changes, IMKB can better be classi ed
as a kangaroo market. In IMKB, there exist several IMKB indices (IMKB 30,
IMKB 50, IMKB 100) and some industrial indices. IMKB 30 contains a set of
hand-selected stocks having highest trading volumes and larger trader contribu-
tion. Hence, since it is less prone to speculation, in this study, we preferred to
work on this index.
In the rst model, a back-propagation neural network has been constructed
to approximate the daily price changes. Di erent neural networks with di erent
architectures and parameters have been tried until the best accuracies are ob-
tained. As well as closing prices, experiments were carried out for highest and
lowest daily prices. Experimental results indicate that daily closing prices behave
in an almost random manner. However, rather useful predictions can be made
about the lowest and highest prices. Our neural network model has obtained
77.8% accuracy for predicting the sign of daily highest price change, where the
base-line accuracy was around only 51.5%.
In the second model, a pattern discovery algorithm has been developed and
applied on the data to nd the frequent patterns. In this model, each daily
market session is treated as an instance. Daily price data, and values of tech-
nical indicators formed the attributes. A rise or fall between two consecutive
trading days formed the class values to be predicted. To obtain the patterns,
numeric attributes have been discretized into categorical values, that is, k non-
overlapping intervals have been computed for each attribute and each interval is
assigned to a label. Combinations of labels from di erent attributes have been
used as patterns. For the patterns found, correct classi cation accuracies have
been computed.
Finally, some statistical information about temporal patterns has been col-
lected. The e ect of transaction day, month and weekday has been investigated.
The results indicate existence of some temporal patterns and are encouraging
for further research.
The outline of the paper is as follows. In the next section, a general de-
scription of the stock market data used and some notation common to both
models are given. We present the details of neural network and pattern discov-
ery models developed, in two consecutive sections. Next, we give the frequently
used performance measures which are important for evaluating the quality of
the predictions. We, nally, present our experimental results and conclude with
a discussion section.

2 Data Set and the Notation Used


The IMKB data set is obtained from the Internet [19]. As a whole, it contains 323
stocks, 7 general market indices and 22 industrial indices. Although most stock
data is available starting from Jan 1 1990, the daily IMKB 30 data is available
from Jan 2 1995 to Feb 20 2001. Both daily and two-session-per-day data are
available.
The data set contains 7 time series. The abbreviations we used and their
meanings are given in Table 2. The average price time series, a, is meaningful
and hence available only for individual stocks. For general market indices, the
series have been computed by aggregating the corresponding series of the stock
indices that they are based on. We refer to value of a series at day t by f(t),
where f should be replaced by one of the series (letters) in Table 2.
In this work, instead of working directly on price time series, we prefer to
work on daily price change series, which can be derived using the original price
Table 2. Descriptions of the daily time series used.
Abbr. Description
l The lowest price that the stock traded
h The highest price that the stock traded
a The average price that the stock traded
c The last price that the stock traded
n The total number of transactions made
v The total volume of transactions made
e The currency exchange rate

series. This is basically due to the fact that stock prices vary at large magnitudes
over the time. This makes both application of the models and comparison of
the results between di erent stocks rather dicult. Hence, instead, using price
changes between consecutive sessions as input is more meaningful. Price changes
happen to appear in a more restricted range. For example, in IMKB, due to the
restrictions on price changes, a stock cannot rise or fall more than 25% within
the same day.
As a convention, we use two-letter names to denote price change time series.
We use fg(t) to denote the change between the values of price series f and g,
at days t 1 and t, respectively. Formula for calculating price change series is
shown in Equation 1. With this notation, for example, lc(t) corresponds to the
rate of change between the closing price at day t and the previous day's lowest
price. Surely, combination of e, n and v letters with other letters is not possible,
since these series belong to di erent domains. Hence, there are 19 possible price
change series that can be formed. Note that, although nn and vv series are not
actual price changes, with some abuse of language, we refer to them as price
changes.

fg(t) = g(t)f(t f(t1) 1) (1)


Furthermore, we construct and use intra-day price change series. To denote
these series, capital letters are used. In this notation, FG(t) corresponds to the
rate of change between g(t) and f(t), as shown in Equation 2. For these series,
6 possible combinations are LH, LA, LC, HA, HC, and CA.

FG(t) = g(t)f(t)f(t) (2)


Finally, we have the series for technical indicators. The three technical in-
dicators used are Relative Strength Index (R), Momentum (M), and Stochastic
Oscillator (S). Descriptions and formulas for these and some other indicators
can be found in [15].
3 Back-Propagation Neural Network Model
Arti cial neural network is a mathematical model evolved as a re ection of a
biological model about the internal workings of human brain. Despite the fact
that it appears as a recent research area, neural network theory has a long
historical foundation. There exist many variations on the basic neural network
model. These include perceptron networks, back-propagation networks, Hop eld
networks and Kohonen networks. Neural network applications are abundant in
pattern recognition and function approximation problems.
A neural network is made up of a number of processing units corresponding
to neurons in human nervous system. When an input example is presented to the
network, the processing units adapt and adjust themselves in such a way that
the most appropriate output is produced. After adequate number of training
instances are presented, the network learns the relation between inputs and out-
puts. In other words, it optimizes a global error metric de ned over all training
instances, and between the inputs and the outputs. For background information
and the details of the neural network model, [4] can be referred to.
In our study, a multi-layer neural network structure which can handle any
number of hidden layers is constructed. This structure is used to design a network
composed of one input, one output and one hidden layer. It is well-known that
a single hidden layer is adequate to approximate any continuous function, hence
using higher number of hidden layers has not much use. During the training
phase, back-propagation learning algorithm is used to adjust the weights of the
processing units. Inputs to the network are fg(t) values with corresponding
desired outputs as fg(t + 1) values.
In back-propagation learning algorithm, training proceeds in two phases, a
forward and a backward phase. In the forward phase, at each network layer, using
the inputs and weights of the processing units a sum is calculated. This sum
is passed from a non-linearity (Equation 3 is used in our case) and the output
of the network is produced. The error, E, between this output and the desired
network output is calculated, and in the second phase, the error is propagated
to the previous layers in order to adjust the weights of the units located in
previous layers. The amount of adjustment can be determined using a learning
constant . These two phases are repeated in an interleaved manner, for all
training instances (called as an epoch), and many times until a satisfactory error
value, E <  is obtained.
sum
= 11 + ee sum (3)
Since the use of a non-linearity requires input and output values to be be-
tween 1 and 1, in a preprocessing step, we scale the values of price change
series to this interval using the formula in Equation 4. In this formula, x and
y are the values before and after the normalization, respectively. Max is the
maximum value, Min is the minimum value observed within the training data
for a particular series.
y = 2x Max(Max + Min)
Min (4)
During the test phase, test instances are presented to the network, and using
previously found unit weights predicted outputs, fg0 (t + 1), are computed. As a
post-processing work, these outputs are scaled back to their original range.

4 Pattern-Based Rule Discovery Model


Previously described, neural network model acts as a black box. All the informa-
tion found by the model is hidden in the weights of the network and the reasons
that caused the predictions are not available to the trader. In this sense, the
rule based models are important in that they explicitly present the reasoning
behind the predictions. Our second model is based on generating buy and sell
rules depending on the previously seen price patterns.
Pattern-based rules in stock market analysis are somewhat similar to associ-
ation rules found in market basket data mining. An example rule could be like
this: If the closing price of today is a bit higher than yesterday's closing price,
and the di erence between today's highest and lowest prices is too low, than it is
most likely that tomorrow's closing price will be higher than that of today's. In
this statement the if part forms a previously (and frequently) observed pattern,
and when combined with the then part we obtain a rule which most of the time
happened to be correct in the past. We formally denote a rule R by R : P ! V ,
where P is the observed pattern, and V is the predicted value. In this model,
we only try to predict the sign of future price changes, and hence V can have
values from the set f+f ; 0f ; f g, where f is the predicted series.
The two well-known thresholds, support and con dence found in association
rule mining are also applicable to pattern-based rules. Support of a pattern can
be de ned as its frequency in the whole set of patterns. Predictive power and
reliability of a pattern with low support is highly questionable. Con dence of a
rule is an indication of its consistency over the past data. Both thresholds, in
general, are found empirically.
Although predicted values come from a restricted and prede ned set, since
the price changes are numeric, construction of the patterns is a more complicated
task. Using each price change value as a pattern is not feasible, This results in
a too sparse pattern set containing patterns with low support values. A widely
used approach is quantization of numeric values to categorical values. This way
close values can be treated as representing the same pattern.
In our model, a simple approach is used to discretize the series. First, the val-
ues in a price change series are sorted in increasing order. Then k non-overlapping
intervals whose union form the whole range of the series are created. Each in-
terval contains equal number of price change values, and are assigned to unique
category labels. In the literature, more complicated approaches exist for this
one-dimensional number partitioning problem. In [18], such an algorithm based
on k-means clustering is used.
0
-2.98 -1.51 -0.38 0.63 2.03 3.96

A cc B cc C cc D cc E cc Fcc G cc

(a) 7-way discretization over cc series

0
-2.08 -0.23 0.93 2.69

A ll B ll C ll D ll E ll

(b) 5-way discretization over ll series

Fig. 1. Two examples of discretization over IMKB 30 index.

Figure 1 illustrates working of our approach over cc and ll price change se-
ries. Figure 1-a presents the result of 7-way partitioning over the cc series. We
denote the categories corresponding to intervals by capital letters. In our exam-
ple, Acc indicates a drastic decrease in closing prices. Similarly, in Figure 1-b,
Dll indicates a fair increase in lowest price changes. We denote categorical price
change series by f. In the given example, for cc(t) < 2:98, cc(t) returns Acc.
The disadvantage of this approach is due to uniform discretization. Even if
two values are very close to each other, they can still fall on di erent categories.
For example, whereas a closing price change of 0:383 is classi ed as Ccc, 0:381
is classi ed as Dcc . A more general problem is related with nding the appro-
priate number of categories, k. This number is usually determined empirically.
A pattern P is formed by combining one or more category labels from dif-
ferent series. The example pattern we gave at the beginning of this section can
be stated as Ecc DLH . If when this pattern is observed, the experience is that
the market closing price goes up, we create the rule R : EccDLH ! +cc . During
the training, all past patterns are searched and frequently occurring patterns
are used to construct the predictive rules. Among these rules, the ones with the
highest con dence over the training set are used for prediction over the test set.

5 Performance Measures
For evaluating the performance of the neural network model, the error made over
the training set can be used. However, normalized mean squared error (NMSE) is
a better measure, since it allows comparison between experiments over di erent
neural network architectures and stock data. NMSE can be used to see how
closely the predictions simulate the actual values. Formula for NMSE is given,
for an N-day long test period, in Equation 5. In this formula, f 0 (t) represents
the predicted price for actual price f(t). f^ is the mean of f(t).
Pt=N (f(t) f 0(t))2
NMSE = Pt=1t=N ^2 (5)
t=1 (f(t) f)
From the traders point of view, a more important measure is to correctly
predict the sign of change. Knowing whether the market will rise or fall tomorrow
would be a great help to the trader. Sign accuracy can be calculated using the
following formula,
Pt=N s(t)
SignAccuracy = t=1 (6)
N
where s(t) is calculated as,
8 1; f(t)  f 0 (t) > 0
<
s(t) = : 1; f(t) = f 0 (t) = 0 (7)
0; otherwise
Quality of the rules produced by the second model can be measured in a
similar manner. Among the rules created, only the ones with higher con dence
values are used for predictions. If a low-con dence rule or a low-support pattern
is observed, the prediction tool is assumed to remain silent. Accuracy of the
produced rules can be calculated as shown in Equation 8.
Accuracy = number of correct predictions of s(t)
total number of predictions made (8)
Despite all these measures, we believe that the real value of a stock market
prediction model can be best judged by its ability to earn money. For this pur-
pose, recommended buy and sell orders should be simulated over the test set.
Transaction fees, in ation rate and interest rates are the factors which further
complicate the pro t simulation process. A prediction system, which results in
revenues beyond the interest rates when the transaction fees were subtracted
from the pro t can be considered as successful.

6 Experimental Results
6.1 Experimental Setup
The experiments are carried out over a Pentium III-500 Mhz PC, with 512 MB
of RAM, running a Debian Linux system. The execution time of the neural
network model largely depends of the network parameters. With 10 hidden layer
neurons, it takes around 5 minutes to complete 5000 epochs in the training phase.
Compared to this, the second model runs quite fast. Both pattern discovery and
rule formation phases require around a few seconds to be complete.
The data set we used contains some missing data and requires some cleansing.
While creating the inputs to the neural network, and generating the patterns
used in the second model, we took the gaps existing between consecutive sessions
into consideration. These gaps are due to either the missing session data or the
holidays. If the gap is longer then three days or the closing prices between the
last day before the gap and the rst day after the gap is higher than 25%
then the values of the price change series at the rst day after the gap are not
used for training. Other preprocessing, for the neural network model, includes
normalization of the input price change values.
6.2 Back-Propagation Neural Network Model
Back-propagation learning is a gradient-descent search algorithm which aims to
nd a local minimum over an error surface. Finding the absolute minimum is
known to be an NP-hard problem. The back-propagation algorithm, most of the
time, converges to a sub-optimal local minimum. Execution time of the algo-
rithm depends on the targeted error value, the learning constant used, number
of processing units and the size of the training data. Converging to a local min-
imum may take quite a long time, and hence in our networks, we tried small
number of neurons. Use of higher number of neurons did not improve accuracies
much.
For the learning constant, , we used the xed number 0:5. However, as the
epoch count increases, we gradually decreased this number, In other words, we
used a dynamic learning constant for faster convergence. Also to prevent some
possible oscillations during the search process, and to add some hill climbing
capability, we used a forgetting factor of = 0:1. Training terminated when
epoch count reached 5000 or the change in error between two successive epochs
dropped below  = 10 7.
Results in Table 3 are obtained using a network with 5 hidden layer neurons.
For training, rst 90% of the time series is used. The remaining 10% is used for
testing. The base-line accuracies (BLA) over the test set are 53:53, 52:52 and
51:52 for the predicted series, cc, ll and hh series, respectively. In Table 3, E
represents the error over the training set at the point that the training phase
terminated. NMSE is measured using the test set. Accuracy stands for the sign
accuracy of the predictions made by the neural network.
The results indicate that cc series is hardly predictable. Best sign accuracy
(54:55%) is obtained using ccLHHC combination. Again with the same combi-
nation, (77:78%) accuracy achieved for the hh series. The most easily predictable
series seems to be the hh series. Figure 2 displays the simulated (hh0 ) and actual
(hh) series, for IMKB 30 index, between the dates 2 Oct 2000 and 20 Feb 2001.

6.3 Pattern-Based Rule Discovery Model


In the experiments conducted for this model, N-fold cross-validation is used. In
other words, a single session is left out of the data and the rules produced by
the remaining N 1 sessions are used for predicting this single session's price
changes. The process is repeated for predicting each session. In the experiments,
if not stated otherwise, no support or con dence thresholds have been used. That
is, all generated rules are used for prediction. Experiments were conducted over
all available IMKB 30 index data.
Table 5 displays the accuracies obtained for predicting several time series
using the categorical time series formed. From this table, it is clear that trying
to predict the series lh, hl, cl and ch is not meaningful. This is because for these
series, base-line accuracies are already around 100%. Hence, our concentration
was on predicting series ll, hh and cc. The base-line accuracies of the series can
be found in Table 4.
The results for the cc series seemed to be discouraging. The best accuracy
obtained (with HC) is higher than the base-line accuracy by only 1:84%. LC
performed best in predicting the ll series, and had an accuracy of 72:14%. The
hh series is best predicted by the HC series with an accuracy of 76:69%.
E ect of number of discretized attribute categories, k, on prediction is il-
lustrated on Figures 3, 4 and 5. These gures, for di erent k values, compare
predictive performance of various series over the cc, ll and hh series, respectively.
Figure 3 is a good proof of unpredictability or randomness of the cc series. The
highest accuracy (56:07%) is obtained with the hh series when k = 8. The re-
sults are more promising for the ll and hh series. LC series outperformed all
others for all k values in predicting ll (Figure 4). Similarly, HC performed best
in predicting hh (Figure 5).
In our experiments, we also studied the impact of patterns with larger num-
ber of labels. For this purpose, we tried several di erent combinations of series
for predicting the hh series. Note that not all combinations are useful. For exam-
ple, the LCHCLC combination is not di erent than LCHC. We tried di erent
combinations of cc, HC and LC series to form the multi-label patterns. Use of
multi-label patterns, as can be seen in Figure 6, slightly improved the accuracies.
The highest accuracy is observed in the ccHC combination with 79:51%.
Finally, we tried the model on the highly traded Yap ve Kredi Bankas
(YKBNK) stock. Base-line accuracy for the average price change of the stock is
50:23%. We used 3-way discretization and the ccaa combination to predict the aa
series. Labels are as Acc 2 ( 1:: 1:56], Bcc 2 ( 1:56::1:82], Ccc 2 (1:82::1),
Aaa 2 ( 1:: 1:32], Baa 2 ( 1:32::1:54] and Caa 2 (1:54::1). The support of
the patterns and con dence of the constructed buy and sell rules are as follows:
support(Acc Aaa ) = 0:230 confidence(Acc Aaa ! aa ) = 67:59
support(Acc Baa ) = 0:085 confidence(Acc Baa ! aa ) = 69:91
support(Acc Caa ) = 0:022 confidence(Acc Caa ! aa ) = 77:59
support(Bcc Aaa ) = 0:085 confidence(Bcc Aaa ! +aa ) = 55:51
support(Bcc Baa ) = 0:173 confidence(Bcc Baa ! aa ) = 49:13
support(Bcc Caa ) = 0:072 confidence(Bcc Caa ! aa ) = 63:54
support(CccAaa ) = 0:020 confidence(Ccc Aaa ! +aa ) = 79:25
support(CccBaa ) = 0:075 confidence(Ccc Baa ! +aa ) = 66:16
support(CccCaa ) = 0:237 confidence(Ccc Caa ! +aa ) = 70:48

6.4 Temporal Patterns


Our study on temporal patterns is purely statistical. We extracted month of
year, day of month and day of week from the session dates, and tried to see if
at some particular time points closing price changes behaved similarly. For this
purpose, in the experiments, we used the whole set of individual stocks in IMKB.
For each month of year, day of month and day of week, average of daily closing
price changes for the stocks are shown in Figures 7, 8 and 9, respectively.
According to our experimental results, best months to buy stock from IMKB
are January, June and December. Highest falls are observed in February and
August. Consequently, it may be wise for a trader to join the market at the start
of December and leave before the month February starts.
For days of month, Figure 8 illustrates the existing coherency between closer
days. The intervals [29..6] and [14..20] have higher potential for a rise. The
highest positive change is seen on the 6th day (1.2%), and is followed by the
highest fall (-0.69%). According to this data, a good strategy would be to buy
some stock before the month starts, and sell before the 7th day of the month.
In IMKB, trading days are between Monday and Friday. As the end of the
week approaches, there seems to be an increase in the stock prices (Figure 9).
The highest fall is observed on Tuesday. The highest increase is on Friday. To
start the days Monday and Tuesday having stocks in the portfolio does not seem
to be appropriate. Buying some stock on Wednesday, and selling towards the
end of Friday session may be a better strategy.

7 Discussion
The results from the both models indicate the diculty of predicting closing
prices. However, despite the fact that the other intra-day price change series
behave as if random, there exist useful patterns in these series that can be used
for prediction. In both models, best results are obtained for predicting the daily
highest price change series. As we stated before, results of pro t simulation is an
important measure to evaluate the performance of an automated trading system.
So far, no means of performing pro t simulation over highest and lowest price
change series have been proposed. We leave this and application of the models
to portfolio selection problem as a future work.
Although not reported here, we have conducted experiments to see the e ect
of number of transactions and volume on price movements. Interestingly, no
signi cant correlations have been found. We also tried rules having larger window
sizes (in the reported experiments only the data of the previous day, that is, a
window size of 1 is used). This way more speci c rules have been obtained, but
due to the lack of available data the support for the patterns were too low.
Currently we are working on creating the series for technical indicators. We
plan to combine indicator series with other price change series and to integrate
this into both models. We believe that, use of technical indicators will boost the
prediction accuracy of the forecasting system we developed.
Another interesting issue is trying to make predictions for coarse-grain time
intervals. Currently, our forecasting system produces daily predictions. Weekly,
or monthly predictions could be tried. On the other extreme, each session in a
day could be used as an instance. This approach may be bene cial in that it
doubles the amount of available data.
Our results on temporal e ects are rather interesting. The best days to buy
stock are found as Thursday and Friday. The highest price changes occur in the
rst and third weeks of a month. Also, it is interesting to note the correlation
between these weeks and the days that people receive their salaries (the 1st and
15th days of a month). Furthermore, we observed some seasonal e ects. Prices
seemed to go up towards the start of winter.
References
1. B. G. Malkei, A Random Walk Down Wall Street, 7th ed., New York, 1999.
2. E. Maasoumi and J. Racine, Entropy and Predictability of Stock Market Re-
turns, Journal of Econometrics, March 2002.
3. R. Herbrich, M. Keilbach, T. Graepel, P. Bollmann-Sdorra, and K. Obermayer,
Neural Networks in Economics: Background, Applications and new Develop-
ments, In Advances in Computational Economics: Computational Techniques
for Modelling Learning in Economics, Vol. 11, pp. 169{196, 2000.
4. S. Haykin, Neural Networks: A Comprehensive Foundation, Macmillan College
Publishing Company Inc., 1994.
5. T. Hellstrom and K. Holmstrom, Predicting the Stock Market, Technical Report,
Dept. of Mathematics and Physics, Malardalen University, 1998.
6. F. Castiglione, Forecasting Price Increments using an Arti cial Neural Network,
Advances in Complex Systems, No. 1, pp. 45{56, March, 2001.
7. J. Li and E. P. K. Tsang, Investment Decision Making Using FGP: A Case Study,
Proceeedingsof Congress on Evolutionary Computation, 1999.
8. S. Singh, Noisy Time-Series Prediction using Pattern recognition Techniques,
Computational Intelligence, Vol. 16, No. 1, pp. 114{133, 2000.
9. T. Hellstrom and K. Holmstrom, Predictable Patterns in Stock Returns, Tech-
nical Report, Dept. of Mathematics and Physics, Malardalen University, 1998.
10. P. J. McCann amd B. L. Kalman, A Neural Network Model for Gold Market,
Technical Report, Washington University, 1993.
11. G. Dor ner, Neural Networks for Time Series Processing, Neural Network World,
6(4), 447{468, 1996.
12. M. Magdon-Ismail, A. Nicholson and Y. S. Abu-Mostafa, Financial Markets:
Very Noisy Information Processing, Proceedings of the IEEE, Special Issue on
Information Processing, 1998.
13. T. Chenoweth and Z. Obradovic, A Multi-Component Nonlinear Prediction Sys-
tem for the S&P 500 Index, Neurocomputing, Vol. 10, No. 3, pp. 275{290.
14. J. Yao and H. L. Poh, Equity Forecasting: a Case Studyon the KLSE Index, Neu-
ral Networks in Financial Engineering, Proceedings of 3rd International Confer-
ence on Neural Networks in the Capital Markets, London, 1995.
15. S. B. Achelis, Technical Analysis from A to Z, Irwin Professional Publishing,
Chicago, 2nd Edition, 1995, (available at http://www.equis.com/free/taaz/).
16. F. Hamelink, Systematic Patterns Before and After Large Price Changes: Evi-
dence From High Frequency Data from Paris Bourse, 1999.
17. P. Tino, C. Schittenkopf and G. Dor ner, Volatility Trading via Temporal Pat-
tern Recognition in Quantized Financial Time Series, Pattern Analysis and Ap-
plications, 4(4), pp. 283{299, 2001.
18. M. W. Sholom and N. Indurkhya, Rule-based Machine Learning Methods for
Functional Prediction, Journal of Arti cial Intelligence Research, Vol. 3, pp.
383{403, 1995.
19. http://www.analiz.com/AYADL/ayadl01.html

This article was processed using the LaTEX macro package with LLNCS style
Table 3. Accuracies obtained by the back-propagation neural network.
Predicted Series
(t+1) ll (t+1)
cc hh(t+1)

BLA 53:53 52:52 51:52


Inputs E NMSE Accuracy E NMSE Accuracy E NMSE Accuracy
llcc(t) 0.0203 1.00 51.52 0.0107 0.57 68.69 0.0116 0.78 74.75
hhcc(t) 0.0203 1.01 53.54 0.0267 0.69 69.70 0.0187 0.64 74.74
llhhcc(t) 0.0204 1.01 51.52 0.0236 0.61 69.70 0.0184 0.63 73.74
LC H C (t) 0.0202 1.00 52.53 0.0099 0.57 72.73 0.0095 0.65 75.76
ccLC H C (t) 0.0203 0.99 54.55 0.0104 0.65 71.72 0.0096 0.66 77.78

19000

18000
hh (actual)
17000 hh’ (predicted)

16000
Daily Highest Price

15000

14000

13000

12000

11000

10000

9000
1 9 17 25 33 41 49 57 65 73 81 89 97
Days

Fig.2. Simulating the daily highest price by neural network.

Table 4. Base-line accuracies of several price change series.


Series ll lh lc hl hh hc cl ch cc

Accuracy 56.94 100 76.32 100 53.37 68.94 99.63 99.89 51.07
Table 5. Accuracies obtained by the generated rules (k=5).
Rule Predicted Series
Domain ll(t+1) lh(t+1) lc(t+1) hl(t+1) hh(t+1) hc(t+1) cl(t+1) ch(t+1) cc(t+1)
ll (t) 59.39 100 76.32 100 65.24 68.94 99.63 99.89 47.73
lh (t) 59.29 100 76.32 100 58.69 68.94 99.63 99.89 39.03
lc(t) 66.53 100 76.32 100 70.76 68.94 99.63 99.89 32.21
hl (t) 57.96 100 76.32 100 61.15 68.94 99.63 99.89 51.68
hh (t) 58.16 100 76.32 100 58.59 68.94 99.63 99.89 42.61
hc(t) 64.29 100 76.32 100 68.81 68.94 99.63 99.89 52.7
cl (t) 61.63 100 76.32 100 68.51 68.94 99.63 99.89 52.7
ch(t) 60.51 100 76.32 100 62.68 68.94 99.63 99.89 38.83
cc(t) 68.88 100 76.32 100 75.66 68.94 99.63 99.89 52.09
ee(t) 56.94 100 76.32 100 53.37 68.94 99.63 99.89 51.07
LH (t) 56.94 100 76.32 100 56.44 68.94 99.63 99.89 52.6
LC (t) 72.14 100 76.32 100 70.25 68.94 99.63 99.89 52.7
H C (t) 68.67 100 76.32 100 76.69 71.59 99.63 99.89 52.91

60.0

55.0 ll
lh
lc
50.0 hl
hh
Accuracy

hc
45.0 cl
ch
cc
40.0
ee
LH
35.0 LC
HC

30.0
1 2 3 4 5 6 7 8
k
Fig. 3. Predicting the closing price change by various price change series.
75.0

ll
70.0 lh
lc
hl
hh
65.0 hc
Accuracy

cl
ch
60.0 cc
ee
LH
LC
55.0
HC

50.0
1 2 3 4 5 6 7 8
k
Fig. 4. Predicting the lowest price change by various price change series.

80.0

75.0
ll
lh
70.0 lc
hl
hh
Accuracy

65.0
hc
cl
60.0 ch
cc
55.0 ee
LH
LC
50.0 HC

45.0
1 2 3 4 5 6 7 8
k
Fig. 5. Predicting the highest price change by various price change series.
80.0

78.0
Accuracy

76.0

74.0 ccHC
ccLC
HCLC
ccHCLC
72.0
1 2 3 4 5 6 7 8
k
Fig. 6. Predicting the highest price change by multi-label patterns.

0.6
Average of Daily Closing Price Changes

0.4

0.2

0.0

-0.2

-0.4
Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
Month of the Year
Fig. 7. Impact of the month of the year on closing stock prices.
1.2

Average of Daily Closing Price Changes


1.0
0.8
0.6
0.4
0.2
0.0
-0.2
-0.4
-0.6
-0.8
1 2 3 4 5 6 7 8 9 10111213141516171819202122232425262728293031
Day of the Month

Fig. 8. Impact of the day of the month on closing stock prices.

0.6
Average of Daily Closing Price Changes

0.4

0.2

0.0

-0.2

-0.4
Mon Tue Wed Thu Fri
Day of the Week
Fig. 9. Impact of the day of the week on closing stock prices.

S-ar putea să vă placă și