You are on page 1of 35

Quantitative Finance

ISSN: 1469-7688 (Print) 1469-7696 (Online) Journal homepage: https://www.tandfonline.com/loi/rquf20

Prediction of stock price movement based on daily


high prices

Marija Gorenc Novak & Dejan Velušček

To cite this article: Marija Gorenc Novak & Dejan Velušček (2016) Prediction of stock price
movement based on daily high prices, Quantitative Finance, 16:5, 793-826

To link to this article: https://doi.org/10.1080/14697688.2015.1070960

Published online: 15 Sep 2015.

Submit your article to this journal

Article views: 975

View Crossmark data

Citing articles: 8 View citing articles

Full Terms & Conditions of access and use can be found at


https://www.tandfonline.com/action/journalInformation?journalCode=rquf20
Quantitative Finance, 2016
Vol. 16, No. 5, 793–826, http://dx.doi.org/10.1080/14697688.2015.1070960

Prediction of stock price movement based on daily


high prices
MARIJA GORENC NOVAK∗ †‡ and DEJAN VELUŠČEK‡§¶
†XLAB d.o.o., Pot za Brdom 100, 1000 Ljubljana, Slovenia
‡Faculty of Mathematics and Physics, University of Ljubljana, Jadranska 19, 1000 Ljubljana, Slovenia
§Institute of Mathematics, Physics and Mechanics, University of Ljubljana, Jadranska 19, 1000 Ljubljana, Slovenia

(Received 13 January 2014; accepted 26 June 2015)

Prediction of stock close price movements has attracted a lot of research interest. Using machine
learning techniques, especially statistical classifiers, for day ahead forecasting of the movement of
daily close prices of a broad range of several hundreds of liquid stocks is generally not very successful.
We suspect that one of the reasons for failure is the relatively high volatility of prices in the last minutes
before the market closes. There have been some attempts to use less volatile daily high prices instead,
but the studies concentrated only on a specific non-statistical machine learning approach on a small
number of specific securities. We show that incorporating statistical classifiers for day ahead daily
high price movement predictions in to some simple portfolio management techniques significantly
increases their performance. Tests performed on S&P 500 stocks show that such a strategy is robust,
i.e. the difference in reliability for different stocks does not vary significantly, and that such a strategy
greatly outperforms the S&P 500 index and several other benchmarks while increasing the risk only
by a small amount.

Keywords: Stock price movement prediction; Trading strategy; Daily high price; Support vector
machines; Linear discriminant analysis; Naïve Bayes
JEL Classification: C10, C38, C45, C53, G11

1. Introduction and related work (ter Horst et al. 2012). Consequently, the daily high prices are
significantly less volatile than daily close prices (see figure 1),
The market can be considered as a system that takes in a lot since the daily high price is usually not achieved during the
of information, such as fundamental information (e.g. formal most volatile 15 min.
records that are in financial statements), political events, news, Machine learning models using more volatile data describe
rumours, general economic conditions, investors’ expectations more noise than with less volatile data. In cases where learning
and psychology of investors, and produces an output. A model was performed on noisy data, the machine learner may adjust
tries to capture the behaviour of the financial market, but it takes to very specific random features of the training data that have
as an input only a small subset of this information. The other no causal relation to the target function.
information cannot be modelled and plays the role of noise as The fact that high prices are less volatile than close prices
far as the input is concerned (Abu-Mostafa and Atiya 1996). makes the price movement based on daily high prices more
Even with the presence of noise, there is considerable evidence predictable. It seems that we can get enough information about
showing that the stock market prices or stock market trends are daily high price behaviour to be useful for successful day-
to some extent predictable (Baba and Suto 2000, Leigh et al. ahead forecasting. Despite the fact that the volatility of daily
2001, Huang et al. 2005, Yu et al. 2005, Ou and Wang 2009, high prices is significantly lower than the volatility of daily
Tsai and Hsiao 2010). This paper focuses on prediction based close prices and that the knowledge on day-ahead movement of
on daily high prices (we take 370 companies which are included daily high price would be able to contribute to, e.g. automatic
in the S&P 500) instead of commonly used daily close prices. It trading strategies, expert systems for portfolio management,
was shown that the S&P 500 exhibits unusually large realized etc., the majority of related works only try to forecast close
volatility in the last 15 min of daily trading sessions, which is price movements (Jung and Bond 1996, Lendasse et al. 2000,
due to large volumes of trades in stocks that are its members Gestel et al. 2001, Chen et al. 2003, Huang et al. 2005, Kim
2006, Huang and Tsai 2009, Lu et al. 2009, Kara et al. 2011,
∗ Corresponding author. Email: manja.gorenc@xlab.si
Subha and Nambi 2012, Kao et al. 2013). The reason why
¶Current address: J. Stefan Institute, Jamova cesta 39, 1000 Ljubljana, Slovenia.
© 2015 Taylor & Francis
794 M. Gorenc Novak and D. Velušček

researchers prefer to analyse close-to-close price movement is 2014). In appendix 1, we briefly describe the used technical
that the times of close prices are well-defined, while the time indicators and in appendix 7, we perform some classification
of daily low and high prices is not. Although the moment at tests of indicator usefulness.
which a daily high price is achieved is a random number that Predicting the movement of price returns is a practical issue
is not even a stopping time, considering the natural filtration which usually affects a financial trader’s decision to buy or to
of the price process we claim that we can still construct trad- sell an instrument. There have been a number of studies that
ing strategies which would significantly profit from machine use the application of machine learning techniques to forecast
learning model predictions. the stock price movement, but only a few presented empirical
The academic literature which examines the forecasting of results of a trading performance using obtained forecasts on
daily high and low prices is relatively rare (e.g. Martinez et al. real stock market data, e.g. Ang and Quek (2006), Gestel et al.
2009, Mettenheim and Breitner 2012), compared with the (2001) and Saad et al. (1998). In our work, we also test whether
amount of literature based on daily close data: the authors the classification results can be applied to self-financing trading
Martinez et al. (2009) show that using an artificial neural strategies with non-zero starting wealth. Their performance is
network (ANN), they can forecast the lowest and highest stock then compared with some benchmarks and the S&P 500. The
prices of the current trading day of the two main stocks of the rest of this paper is organized as follows: section 2 presents
Brazilian stock market. Mettenheim and Breitner (2012) show experimental work including a description of the data; section
that it is possible to successfully model the intraday dynamics 3 provides the classification results; and section 4 describes
of five liquid US securities using ANN model forecasts. For the trading strategies. The portfolio measurements and the
each day, they forecast daily low and high prices and propose a performance of the proposed strategies are given in section
trading system. These works are good motivation for research 5. Then, in section 6, our conclusions are summarized.
to see if the predictions of daily high (or inversely daily low)
return movements using statistical classifiers give good per-
formance on a large part of the stocks in the S&P 500 index. 2. Experiments
In our research, the focus is on daily high prices because in the
proposed trading strategies there are no short positions. The data used in this study are sourced from ‘Yahoo! Finance’.†
We build several models with a subset of information as Daily open, high, low, close and volume time series are con-
an input that captures the movement of daily high prices. The sidered, where OHLC prices have been adjusted for dividends
hit rate of 60% was experimentally achieved, which is good and splits. The data comprise of daily OHLCV time series
enough for building profitable trading strategies. Different from 31 October 2003 to 14 June 2013, a total of 2420 trading
studies select their indicators as an input for model construc- days. We analysed time series for all 370 companies which
tion differently. The central idea to successful stock market were members of S&P 500 index on 1 August 2013, and for
prediction is achieving the best results using the minimum which data were available for every trading day in the above-
required input data and the least complex stock market model. mentioned period. Each feature component x in our data-set is
Much related work considers only one type of indicator (either normalized to a variable with zero mean and unit variance as
technical indicators or fundamental indicators). The authors (x −μ)/σ , where μ is the mean and σ is the standard deviation
Vanstone and Finnie (2009) conclude that prediction models for x. The sliding window method is used and the description
which are designed for a long-term period should use funda- of it is below.
mental indicators while those for a short-term period, such The first period, the training set of 500 trading days (in figure
as with daily prediction models, should focus on technical 2 marked as ‘Training 1’), is used for building a forecasting
indicators. Considering this research, we include only technical model. The chosen length of 500 trading days is a compromise
indicators as input data. Atsalakis and Valavanis (2009) survey between a small stationary set which can be insufficient for
over 100 related scientific articles applied to stock market prob- a successful training and a large but less stationary training
lems and find out that the average number of input indicators set (Lendasse et al. 2000). The second period, h days after
in articles is between 4 and 10. The big majority of authors the training period (in figure 2 marked as ‘T’), is the reserved
include only technical indicators, and with them they try to test set and is used for comparing the classified values to the
predict the daily or weekly price index or movement of the actual. After the prediction is made and recorded, the training
index (Lendasse et al. 2000, Yu et al. 2005, Huang and Tsai set then slides forward for one period (h days) and the process
2009, Kara et al. 2011). In our study, 11 technical indicators of training and testing is carried out again. This training and
are used and calculated on a lagged time series (volume, open, testing scheme is applied to one-month models (h = 20). The
high, low, close and adjusted values) to check whether the time proper length of testing period h is chosen by the previous
series properties of the past stock price movement contain any analysis (see appendix 2, tables B1–B4). Ninety-six test set
information that is useful in predicting the future daily high forecasts (for each company) of daily high prices are generated
price movement. In the calculations for technical indicators, we for the purpose of testing. Shortly, the described procedure
mainly use the lag length (indicator length) of 10 days. Shorter means that we update our models every 20 days. The dependent
indicator lengths will produce more entry signals than longer variables are 11 technical indicators (see appendix 1). Daily
indicator lengths and are best suited for short-term trading. high returns are categorized as −1 or 1 where −1 means that
The chosen indicators in our study are selected by a review of the next day’s daily high price is predicted to be lower than
domain experts and prior research (Kim and Han 2000, Yao and today’s daily high price and 1 means that the next day’s daily
Tan 2000, Kim 2003, Kamruzzaman and Sarker 2004, Kumar
and Thenmozhi 2006, Kordos and Cwiok 2011, Faghani et al. †http://finance.yahoo.com/
Prediction of stock price movement 795

Figure 1. Comparison of standard deviations of daily high and close returns for the entire sample period. The stocks are ordered by increasing
standard deviation based on daily high returns. Most stocks have lower standard deviation based on daily high prices.

Figure 2. Sliding window method by one-month-based testing data.

high price is predicted to be higher than today’s daily high price.


Table 1. Confusion matrix.
To measure the predictive performance, hit rate, sensitivity,
specificity and precision for a class 1 and for a class −1 are Actual ↓ / Predicted→ Rise Fall
employed and defined in table 1. The R software environment
Rise a b
R Core Team (2014) with related packages is used to conduct Fall c d
the whole experiment.
a+d
Notes: Hit rate = a+b+c+d .
a
Sensitivity = a+c .
d .
Specificity = b+d
3. Results d .
Prec −1 = c+d
a .
Prec 1 = a+b
3.1. Choosing proper kernels and tuning SVM parameters
Selection of kernel functions is important due to different
performances of SVM. In this study, we use Gaussian radial parameter that needs to be tuned is the soft-margin constant C.
basis function (RBF) and linear function as kernels of SVM. The Gaussian RBF kernel tends to give a good performance.
The linear kernel provides a useful baseline. The only hyper- Between two kernels, the Gaussian RBF kernel usually out-
796 M. Gorenc Novak and D. Velušček

performs the polynomial kernel in both accuracy and con- through time for each classifier separately (see appendix 4,
vergence time (Tay and Cao 2001, Kim 2003, Ben-Hur and figures D5–D12).
Weston 2010). There are two hyperparameters associated with We will take a look at all mentioned classifiers on some pro-
RBF kernels: C and γ which play an important role on the posed strategies which are described in the following section.
generalization performance of SVMs. Too small values for C
will under-fit the training data while if C is too large, SVM
will over-fit the training set (Tay and Cao 2001, Keerthi and 4. Trading strategies
Lin 2003, Kim 2003). We decided to choose bounds of the
C between 1 and 100. Tay and Cao (2001) proposed using C To improve evaluation of proposed classifiers based on daily
between 10 and 100 due to over-fitting and under-fitting the high prices from the section 3, a simple trading strategies
training set. (named ‘Guided D-threshold strategies’) are constructed. We
We try to identify the optimal choices of C and γ in order to test whether classification results (exposed in table 2) could be
achieve the highest classification accuracy of unseen test exam- applied for building economically profitable strategies, thus we
ples. We set the kernel parameter γ heuristically as described formulate a set of simple trading rules guided by the directions
by Karatzoglou et al. (2010) and Caputo et al. (2002) and for the predicted by models. The empirical testing takes the form of a
upper bound we choose between C = 1, 10, 33, 55, 78, 100. trading simulation which closely mimics the timely investment
Due to high computational time, we tune hyperparameters decisions faced by investors in the market place. An investment
for RBF kernel and parameters for linear kernel on a first horizon of 1920 trading days is used and served as testing
training set (which is from 31 October 2003 to 26 October period in the classification task. Daily decisions are made for
2005) for each stock separately and these parameters are the one day in advance. The application of proposed strategies
same throughout the testing period. The experiments show that consists of the following two steps:
the results are not significantly different if we tune parameters
• we build models with above-mentioned classifiers;
on every training set.
• constructed models are used for deriving a day-ahead
prediction, which then serves as a selection with which
stocks we trade: trading is always done in current time
with current prices.
3.2. Classification results We would like to show that incorporating classifiers into pro-
In table 2, ‘train acc’ labels the average hit rate (with ac- posed strategies cause statistically significantly better perfor-
companying standard deviation) on all 96 training Data-sets, mance. In this section, the Guided D-threshold trading strate-
while ‘test acc’ labels the average hit rate (with accompanying gies are defined and compared to some benchmarks: Naïve
standard deviation) on all 96 test set forecasts; ‘sens’, ‘spec’, strategies, the Benchmark strategy, and the S&P 500 index. The
‘prec rise’and ‘prec fall’are averages for sensitivity, specificity, proposed strategies are compared to the S&P 500 index, which
precision for the class 1 and precision for the class −1 (with is often used as a benchmark, and to the Benchmark strategy,
accompanying standard deviations), respectively, on 96 test set where all 370 stocks are used and are equally weighted. To
forecasts. Beside the test hit rate, the relevant measure is also compare the strategies, some performance measures during
precision for the class 1, which is the number of stocks that are this section are defined. Let us describe the compound annual
correctly labelled as belonging to the class 1, divided by the growth rate (CAGR) which is the year-over-year growth rate
total number of stocks labelled as belonging to the class 1. of an investment over a specified period of time. The CAGR
Results in table 2 show that linear SVM classifier has the is calculated by taking the nth root of the total percentage
highest test hit rate, as well as the highest precision for class 1. growth rate, where n is the number of years in the period being
The proposed classifiers are able to correctly predict the direc- considered.
tions of daily high prices in the average of 60% on the test set   1
Ending Value # of years
period. The initially chosen batch of 370 S&P 500 companies CAGR = − 1.
Beginning Value
carries the burden of survival bias, and thus in appendix 3, we
compare the classification results obtained using a batch of 462
companies which consists of all S&P 500 companies with valid
4.1. Guided D-threshold trading strategies
data at a chosen date to the results by chosen 370 companies.
The comparison was conducted on a shorter time interval at The investor will follow the directions of stock returns pre-
the end of the time interval for the 370 companies batch, i.e. dicted by proposed classification models (from the section
from 29 February 2008 to 14 June 2013. To test the impact of 3). The self-financing investment strategy chooses a particular
the survival bias surprisingly the difference in test accuracy is stock whenever there is a predicted uptrend, provided the gap
approximately 1% point regardless of the classifier. between the current open price and previous high price is high
We studied whether there are certain stocks that are consider- enough.
ably more/less successful than others. Investigation reveals that
Strategy for the trading day t and the stock j :
on average all stocks perform well and that there are no outliers.
The range of forecasts by stock is from 53.54% to 64.11% (see If the model predicts that daily high price for the stock j
appendix 4, figures D1–D4). The test period of 1920 trading will rise in the next day t and if the relative difference between
days is a long time period, wherefore we graphically present hight−1 and opent in equation (1) is bigger than threshold D
how forecasts measured on a testing period are distributed (optimal D is set experimentally on the training set), we will
Prediction of stock price movement 797

Table 2. Classification results of different classifiers.

Method train acc test acc sens spec prec rise prec fall

LDA 63.95 ± 2.47 60.66 ± 10.69 57.92 ± 21.74 62.18 ± 20.10 60.41 ± 17.08 61.71 ± 15.58
NB 57.87 ± 2.27 57.28 ± 9.84 60.92 ± 23.24 47.84 ± 23.27 54.01 ± 15.86 56.98 ± 18.77
Linear SVM 63.49 ± 2.32 61.16 ± 10.68 63.36 ± 22.04 56.44 ± 21.37 60.60 ± 15.67 62.08 ± 17.34
RBF SVM 70.79 ± 5.78 59.39 ±10.71 61.30 ± 21.83 55.54 ± 21.46 59.05 ± 15.98 60.15 ± 17.28

Figure 3. Trading strategy illustrated on a sample of IBM stock (we did not include any D thresholds): suppose we woke up in the morning
on 4 January 2007 and decided to use the Guided D-threshold strategy. Today’s open price is lower than yesterday’s high price (on 3 January
2007) and the classification output of our chosen model is that the high price today will be higher than yesterday’s high price. We buy the
IBM stock at the open price and hold the stock until the current price exceeds the yesterday’s high price and then sell it. The figure above
shows the profit for that day. On the other hand, if the model’s output is that the high price will not reach yesterday’s high price, then we will
not trade IBM stock that day. On the next day, on 5 January 2007, the open price is lower than yesterday’s price, but the output of a model
could say that the high price will be lower than yesterday’s high price, so we do not buy the stock and thus we avoid of the possible loss. If
we get a wrong prediction for that day (i.e. the model predicts that the high price will be higher), the scenario will be that we buy the stock
at the open price, and because the current price that day does not reach yesterday’s high price, we close our position at the close price. The
figure above also notes a loss. On the next trading day, the open price is higher than high price on 5 January 2007, so that day we do not trade
the IBM stock. On the next two days suppose that the model’s output is that high price will be higher than yesterday’s, hence we could get
profit for the both days (on 10 January 2007, the close price is higher than open price so despite of wrong prediction we have the profit).

buy the stock j at the open price in the current trading day t, returnt, j = (hight−1, j − opent, j )/opent, j .
otherwise the stock j will not be traded on the current day.
 high  If the current stock price does not reach yesterday’s high
t−1, j
relative difft, j = − 1 · 100 (1) price (wrong prediction by a model), we close our position at
opent, j the end of the trading day with

We close all our open positions in the same trading day, in


particular, if the current stock price during the day t reaches returnt, j = (closet, j − opent, j )/opent, j ,
yesterday’s high price, we close our position. In that case for
day t and stock j, we achieve which can cause returns to be negative.
798 M. Gorenc Novak and D. Velušček

Managing the portfolio: in the next day following the same strategy (the Benchmark
The investor will use the following self-financing strategy: strategy is marked as ‘bench’).
• For every day t, all wealth will be invested in stocks Calculating the returns:
selected by previous strategy.
For each trading day, 370 stocks are available for trading.
• In each of the selected stocks, an equal amount of avail-
We calculate the daily return as:
able funds is invested.  
• For every stock j in our newly created portfolio, we follow 370 (closet −opent )
t=1 opent
the above strategy for trading day t and the stock j. returnt = .
• At the end of the trading day, there are no stocks in the 370
portfolio. After we trade d days, the total return is
 
total return = dt=1 (1 + returnt ) − 1
Calculating the returns and CAGR:
 
N
j=1 return t, j
returnt = , (2) 4.4. The S&P 500 index
 N 
total return = dt=1 (1 + (returnt ) − 1 (3) As a benchmark, we also use the S&P 500 (marked as ‘SPY’).
1
CAGR = (total return + 1) #of years − 1, (4)
where N is the number of stocks selected by the trading strategy 5. Portfolio measures and performance of the proposed
and d is the number of trading days. We vary the thresholds D strategies
since we would like to minimize the number of transactions,
which would give us too little profit, and to reduce the chance 5.1. Portfolio measures
of loss (probability that closet will be lower than opent ). The All portfolio measures mentioned below are cited from the
relative difference between the open price on day t + 1 and the book Reilly and Brown (2012):
high price on day t indicates the least positive return that we
will obtain in case our prediction proves to be correct.
5.1.1. Sharpe ratio. The Sharpe ratio is a portfolio perfor-
mance measure that combines risk and return performance into
4.2. Naïve strategies a single value and is stated as follows:
Ri − RFR
We want to test if including classifiers make for a significant Si =
increase in performance, which would demonstrate the benefits σi
of integrating classifiers into the strategies. For that purpose, where Ri is the expected portfolio return, RFR is the risk free
we define the Naïve strategies which mimic the Guided D- rate and σi is the standard deviation of the rate of return for
threshold strategies but are forecast free. portfolio i during the time period. The Sharpe ratio character-
If the relative difference between hight−1 and opent in equa- izes how well the portfolio’s returns compensate the investor
tion (1) is bigger than threshold D (the D thresholds are the for the risk taken (Sharpe 1994).
same as for the Guided D-threshold strategies and depend on
chosen classifier), we will buy the stock j at the open price in
trading day t. If the current stock price during the day reaches 5.1.2. Sortino ratio. The Sortino ratio captures the down-
yesterday’s high price (trading day t −1), we close our position. side risk (DR) in the portfolio. Sortino and Price (1994) defined
In that case, we get this measure as follows:
returnt, j = (hight−1, j − opent, j )/opent, j . Ri − τ
STi = ,
DR i
If the current stock price in trading day t does not reach
yesterday’s high price, we close our position at the end of the where τ is the minimum acceptable return threshold specified
trading day with for the time period and DR i is the downside risk coefficient for
portfolio i during the specified time period. In our examination,
returnt, j = (closet−1, j − opent, j )/opent, j we set τ = 0. Like the Sharpe ratio, higher values of the ST
is obtained as in equation (2), total return as in equation (3) measure indicate superior levels of portfolio management.
and CAGR as in equation (4).
5.1.3. Information ratio. This statistic measures the differ-
ence between the portfolio’s and benchmark portfolio’s aver-
4.3. Benchmark strategy age returns divided by the standard deviation of this difference.
Formally, the information ratio (IR) for portfolio j is calculated
As a Benchmark strategy, we propose a self-financing portfolio:
as:
every day we invest an equal proportion of wealth in 370 stocks
at open price and sell them at the end of the same day at close R j − Rb
IR j =
price. The money gained by selling the stocks is reinvested σER
Prediction of stock price movement 799

Table 3. Frequencies of used D values for D-threshold strategies.

D 1% 2% 2.5% 3%

DLDA 4 21 52 19
DNB 15 15 42 24
DRBF 0 12 48 36
Dlin 5 18 52 21

Table 4. Performance of proposed Guided D-threshold strategies, Naïve strategies, index and benchmark.

Mean(%) Std(%) Sharpe ratio Sortino ratio Info ratio CAGR (%)

Guided DLDA 0.15 0.04 3.74 0.12 3.57 39.31


Guided DNB 0.15 0.04 3.89 0.13 3.74 40.21
Guided DRBF 0.17 0.04 4.29 0.14 4.23 48.07
Guided Dlin 0.15 0.04 3.94 0.13 3.81 41.30
Naive DLDA 0.09 0.03 2.70 0.09 2.48 22.67
Naive NB 0.10 0.04 2.73 0.09 2.59 23.92
Naive DRBF 0.10 0.03 2.85 0.09 2.75 24.46
Naive Dlin 0.10 0.03 2.83 0.09 2.69 24.40
Naive D0 0.02 0.02 0.92 0.03 –0.27 4.03
SPY 0.03 0.03 0.81 0.03 / 4.17
Bench 0.03 0.03 1.03 0.03 0.25 5.78

Table 5. Classification results of ‘Naïve classifiers’.

test acc sens spec prec rise prec fall

Naïve DLDA 36.17 ± 11.57 5.87 ± 7.34 67.85 ± 19.12 9.70 ± 15.55 39.66 ± 12.66
Naïve DNB 34.66 ±11.58 6.66 ± 8.17 63.97 ± 19.84 10.64 ± 15.90 38.32 ± 12.88
Naïve DRBF 37.73 ± 11.71 4.37 ± 6.41 72.55 ± 18.75 8.52 ± 15.86 41.41 ± 12.35
Naïve Dlin 36.33 ± 11.66 5.57 ± 7.27 68.27 ± 19.41 9.63 ± 15.87 39.91 ± 12.60
Naïve D0 35.33 ± 10.63 70.14 ± 14.42 0.04 ± 0.58 41.49 ± 11.57 0.10 ± 1.51

Table 6. Wilcoxon signed-rank test of daily returns. For the input data, we use two vectors of daily returns by proposed strategies using
aforementioned classifiers, Naïve D0 , Naïve DLDA, S&P 500 index and Benchmark strategy on the whole testing set. p-values between 0.01
and 0.05 are shown with one asterisk ∗ and p-values less than 0.01 are shown with two asterisks ∗∗.

Naïve DLDA Guided DLDA Guided DNB Guided DRBF Guided Dlin SPY Bench

Naïve D0 0.0000∗∗ 0.0000∗∗ 0.0000∗∗ 0.0000∗∗ 0.0000∗∗ 0.6912 0.6753


Naïve DLDA 0.0000∗∗ 0.0062∗∗ 0.0000∗∗ 0.0024∗∗ 0.0002∗∗ 0.0000∗∗
Guided DLDA 0.7894 0.2391 0.8910 0.0000∗∗ 0.0000∗∗
Guided DNB 0.1093 0.7083 0.0000∗∗ 0.0000∗∗
Guided DRBF 0.1531 0.0000∗∗ 0.0000∗∗
Guided Dlin 0.0000∗∗ 0.0000∗∗
SPY 0.3131

where Rb is the average return for a benchmark portfolio during 5.1.5. Conditional Value at Risk. This is an alternative to
the period and σER is the standard deviation of the excess return value at risk that is more sensitive to the shape of the loss
during the period. The higher the information ratio, the higher distribution in the tail of the distribution.

the active return of the portfolio, given the amount of risk taken. 1 α
CVaR α = VaR γ (X )dγ
α 0
5.1.4. Value at Risk. Value at risk is a widely used risk
measure of the risk of loss on a specific portfolio of financial
5.2. Performance of the proposed strategies
assets. Given a confidence level α ∈ (0, 1), the Value at Risk
(VaR) of the portfolio at the confidence level α is given by The proper performance measures that can be compared across
the smallest number l such that the probability that the loss L the strategies are mean, standard deviation, CAGR (equation
exceeds l is at most (1 − α), i.e. (4)), the Sharpe ratio, information ratio and the Sortino ratio
(cf. section 5.1) on all 1920 trading days. The results in table
VaR α (L) = inf {l ∈ R : P(L > l) ≤ 1 − α}
2 show that the best performance of included classifiers in
= inf {l ∈ R : FL (l) ≥ α}. proposed strategies (if we take into account the test hit rate
800 M. Gorenc Novak and D. Velušček

Figure 4. In the Figure, seven trading strategies are exposed: Guided D-threshold strategies, Naïve strategies, the S&P 500 index and the
Benchmark strategy. From the figure, we can see that the best Guided D-threshold strategy is when we use a SVM classifier with RBF
kernel. Also the linear SVM, LDA and NB classifiers seem very close to it. All proposed D-threshold strategies have better results than Naïve
strategies, the S&P 500 index and the Benchmark strategy. After whole seven years, we could reach more than 40% of CAGR.

and precision for the class 1 accuracy) could be for the SVM strategies give better results than Naïve strategies, i.e. incor-
classifier with a linear kernel. porating predictive models in the proposed strategies (Guided
In the Guided D-threshold strategy, we include the threshold D-threshold strategies) yields higher performance than without
D described by equation (1), which indicates the least positive including the model in the strategies (figure 4). To check if there
return that we will obtain in case our prediction proves to be are any statistical differences between strategies, we use the
correct by selected classifier. Changing settings of Guided D- Wilcoxon signed-rank test. The classification results of Naïve
threshold strategy strongly affects the performance, hence the strategies are shown in table 5 which indicates that they do not
threshold D must be carefully chosen before we include it in perform quite well. The hit rate on a test set is much below
trading strategy on a testing set. During the training period, we 50%: the specificity/sensitivity are high.
vary D between D = 1, 2, 2.5 and 3%. We choose the one with The performance of Guided D-threshold strategy also de-
the highest CAGR performance. In table 3, the frequency of pends on the chosen stocks, which can variate differently over
used D values in the strategies is exposed. As we have 96 the trading period. The large proportion of stocks involved
testing and training sets, we get 96 different D values for in the strategy could cause big losses and also big profits,
each classifier. These D thresholds are used in the Guided whereas small proportion could cause small losses and also
D-threshold strategies and in Naïve strategies, i.e. DLDA are small profits.
included in Guided D-threshold strategy using LDA classi- In appendix 5 in figures E1–E4, the number of stocks in-
fier and also in Naïve strategy. The performance of different volved in D-threshold trading strategies are presented using
Guided D-threshold strategies where we take linear discrim- LDA, NB, SVM with linear kernel and SVM with Gaussian
inant analysis classifier (Guided DLDA), Naïve Bayes classi- RBF kernel, respectively. From the figures, we can see that
fier (Guided DNB ), SVM classifier based on a Gaussian RBF the intensity of traded stocks is higher in the fourth quarter of
kernel (Guided DRBF ) and SVM classifier based on a linear 2008 (around October 2008) and in the fourth quarter of 2011.
kernel (Guided Dlin ); Naïve strategies with different D values Figures E5–E8 show profits over time on a testing period. The
(Naïve DLDA, Naïve DNB , Naïve DRBF , Naïve Dlin and Naïve frequency of positive profits are higher than of negative profits
D0 ), S&P 500 (SPY) and Benchmark strategy (bench) are on a D-threshold strategy for all used classifiers. In the graphs,
given in table 4. D0 represents the vector of zeros. The results there can be also seen the correlation between traded stocks in
show that SVM with RBF kernel has the highest CAGR, mean, a strategy and the range of profits/loss, especially in the fourth
Sharpe, Sortino and information ratio. All Guided D-threshold quarter of 2008 (around October 2008) and in the fourth quarter
Prediction of stock price movement 801

of 2011. The percentage of days that have non-negative profit no risk increase at all. Overall, the increased gains more than
is 59.48, 58.75, 58.85 and 59.79% for LDA, NB, RBF, and justify the risk increase.
linear SVM, respectively. In figures E9 and F10, the frequency
distribution of the proportion of trades resulting in a loss is
6. Conclusions
exposed.
Daily high prices are less volatile than the popular daily stock
5.3. Wilcoxon signed-rank test—statistical analysis close prices. For this reason, we decided to classify the daily
high prices in order to forecast whether the daily high price will
To assess whether two related samples of daily returns’ me- rise or fall. The successful classification results on the testing
dian’s ranks differ, the Wilcoxon signed-rank test is used. Table data-set are on average 60%. We constructed simple trading
6 shows the p-values of Wilcoxon tests over two obtained strategies in which we use the classification predictions for
vectors of daily returns (from the two different strategies) in one day in advance. The achieved classification accuracy was
which distribution of the differences is symmetric around the enough to make economically profitable Guided D-threshold
median. Regarding analyses from table 6, Guided D-threshold strategies.
strategies with incorporated classifiers like LDA, NB, SVM Comparing the Guided D-threshold strategies to the Naïve
with RBF kernel and SVM with linear kernel do not perform strategies counterpart without any use of classifiers showed that
significantly different from each other over the testing daily the use of the SVM, LDA and NB classifiers can significantly
returns, so we could not say which of the proposed strategy increase the performance which demonstrates the benefits of
performs better. All proposed D-threshold strategies perform integrating classifiers in to the strategies. The trading exper-
significantly better than all Naïve strategies (we test only Naïve iments show that the Guided D-threshold trading strategies
D0 and Naïve DLDA), the S&P 500 index and the Benchmark also perform generally better than the Benchmark strategy and
strategy. Naïve D0 strategy, S&P 500 index and Benchmark the S&P 500. To get the best possible outcome, we varied
strategy do not perform significantly different from each other different D thresholds, which capture the thresholds between
as we can also see from figure 4 and table 4. Naïve D0 and openi and highi−1 prices and have a big impact on the strategy
Naïve DLDA are significantly different from each other, which performance. The choice of D was based on the comparison
indicates that including D into strategies contribute to higher of strategy output on the training set, which leaves a lot of
strategy gains. room for further improvements. The classifier with the highest
classification results and also with the highest performance on
5.4. Portfolio management the Guided D-threshold strategy is the support vector machine
classifier with a Gaussian RBF kernel. We keep the set of tech-
It might seem that using classifier information on daily high nical indicators constant throughout the whole time period. The
movement for the decision but not for constructing the weights changing behaviour of the strategies with classifiers in different
of the stocks in portfolio, we are not fully utilizing the obtained time periods (e.g. in the crisis) suggests that the set of relevant
information. Hence, we also tried to improve portfolio man- indicators is time dependent. The inspection and analysis of
agement (see appendix 6). Instead of investing equal amount how the relevant indicators are changing during the investment
of money in every stock in which we intend to invest, we make period will be performed in future work. There still remain
the weight of that stock: a lot of other open problems related to the above research,
• proportional to the expected strategy gain (results in table e.g. testing the feasibility of using the proposed strategies at
F2) higher frequency, comparing and testing different classifiers
• proportional to forecast accuracy on a set length of 20 using different attributes, including macro-economic and fun-
trading days (results in table F3) damental indicators as input data and portfolio management,
• inversely proportional to the forecast error on a set length just to name a few. As an extension of this study, the same
of 20 trading days (results in table F4) study was performed for daily low prices and an appropriate
trading strategy conceived in the same spirit; the results for
The results in tables F2–F4 show that portfolio manage- the daily low were similar. Combining both the daily low and
ment has improved only where we use weights proportional to daily high approach, a global strategy relying on long positions
forecast accuracy (for ‘Guided DNB ’, see table F3), but it is in stocks based on high price prediction, and symmetrically
not statistically significantly better than the basic D-threshold short positions in stocks based on low price prediction can
strategy with equal weights. The weights used proportional be constructed. There is no unique way to combine the two
to the forecast accuracy or inversely to the forecast error are approaches in such a global strategy, so the question of whether
not such good choices because the classification results for all such a strategy can be made market-neutral remains open.
stocks are similar on average. It seems that there does not exist
a unique optimal strategy for portfolio management, hence it Acknowledgements
remains an open problem.
The introduction of thresholds in our trading strategies raised The authors would like to thank Daniel Vladušič, Boris Cergol
the gains but on the other hand also raised the risk: the threshold and Rok Okorn for their help and advice.
itself suggests automatically higher volatility, but also higher
VaR and Conditional Value at Risk (CVaR) follow (see figure Disclosure statement
F11). On the other hand, the increase in risk is bounded and
more or less constant during 2008–2011 crisis where there was No potential conflict of interest was reported by the authors.
802 M. Gorenc Novak and D. Velušček

Funding Keerthi, S.S. and Lin, C.J., Asymptotic behaviors of support vector
machines with Gaussian kernel. Neural Comput., 2003, 15, 1667–
1689.
This study was funded in part by the European Union, European Kim, K.J., Financial time series forecasting using support vector
Social Fund, Operational Programme for Human Resources, machines. Neurocomputing, 2003, 55, 307–319.
Development for the Period 2007–2013 [P-MR-10/134] and Kim, K.J., Artificial neural networks with evolutionary instance
Slovenian Research Agency [programme number P1-0222] selection for financial forecasting. Expert Syst. Appl., 2006, 30,
and [programme number L1-4292]. 519–526.
Kim, K. and Han, I., Genetic algorithms approach to feature
discretization in artificial neural networks for the prediction of stock
References price index. Expert Syst. Appl., 2000, 19, 125–132.
Kordos, M. and Cwiok, A., A new approach to neural network
Abu-Mostafa, Y.S. and Atiya, A.F., Introduction to financial based stock trading strategy. In Intelligent Data Engineering and
forecasting. Appl. Intell., 1996, 6, 205–213. Automated Learning-IDEAL, edited by H. Yin, W. Wang and V.
Achelis, S.R., Technical Analysis from A to Z, 2013 (McGraw-Hill: Rayward-Smith, pp. 429–436, 2011 (Springer: Berlin, Heidelberg).
New York). Kumar, M. and Thenmozhi, M., Forecasting stock index movement:
Ang, K.K. and Quek, C., Stock trading using RSPOP: A novel rough A comparison of support vector machines and random forest.
set-based neuro-fuzzy approach. IEEE Trans. Neural Netw., 2006, In Proceedings of the Indian Institute of Capital Markets 9th
17, 1301–1315. Capital Markets Conference Paper, 2006. Available at SSRN:
Atsalakis, G.S. and Valavanis, K.P., Surveying stock market http://ssrn.com/abstract=876544
forecasting techniques—Part II: Soft computing methods. Expert Leigh, W., Purvis, R. and Ragusa, J.M., Forecasting the NYSE
Syst. Appl., 2009, 36, 5932–5941. composite index with technical analysis, pattern recognizer, neural
Baba, N. and Suto, H., Utilization of artificial neural networks and the network, and genetic algorithm: A case study in romantic decision
TD-learning method for constructing intelligent decision support support. Decis. Supp. Syst., 2001, 32, 361–377.
systems. Eur. J. Oper. Res., 2000, 122, 501–508. Lendasse, A., de Bodt, E., Wertz, V. and Verleysen, M., Non-linear
Ben-Hur,A. and Weston, J.,Auser’s guide to support vector machines. financial time series forecasting—Application to the Bel 20 stock
In Data Mining Techniques for the Life Sciences Methods in market index. Eur. J. Econ. Soc. Syst., 2000, 14, 81–91.
Molecular Biology, edited by O. Carugo and F. Eisenhaber, vol. Lu, C.J., Lee, T.S. and Chiu, C., Financial time series forecasting using
609, pp. 223–239, 2010 (Humana Press: Totowa, NJ). independent component analysis and support vector regression.
Caputo, B., Sim, K., Furesjo, F. and Smola, A., Appearance-based Decis. Supp. Syst., 2009, 47, 115–125.
object recognition using SVMs: Which kernel should I use? In Martinez, L., da Hora, D., de M. Palotti, J., Wagner, M.J. and Pappa,
Proceedings of the NIPS Workshop on Statistical Methods for G., From an artificial neural network to a stock market day-trading
Computational Experiments in Visual Processing and Computer system: A case study on the BM&F BOVESPA. In Proceedings
Vision, Whistler, 2002. of International Joint Conference on Neural Networks, pp. 2006–
Chen, A.S., Leung, M.T. and Daouk, H., Application of neural 2013, 2009 (IEEE: Atlanta, GA).
networks to an emerging financial market: Forecasting and trading Mettenheim, H. and Breitner, M., Forecasting daily highs and
the Taiwan Stock Index. Comput. Oper. Res., 2003, 30, 901–923. lows of liquid assets with neural networks. In Proceedings of
Faghani, F., Abzari, M., Fathi, S. and Monajemi, S.A.H., Designing a the Operations Research Proceedings 2012, pp. 253–258, 2012
stock trading system using artificial nero fuzzy inference systems (Springer: Leibnitz).
and technical analysis approach. Int. J. Acad. Res. Account. Ou, P. and Wang, H., Prediction of stock market index movement by
Finance. Manage. Sci., 2014, 4, 76–84. ten data mining technique. Mod. Appl. Sci., 2009, 3, 28–42.
Gestel, T., Suykens, J.A.K., Baestaend, D.E., Lambrechts, A., R Core Team, R: A Language and Environment for Statistical
Lanckriet, G., Vandaele, B., Moor, B. and Vandewalle, J., Financial Computing, 2014 (R Foundation for Statistical Computing:
time series prediction using least squares support vector machines Vienna).
within the evidence framework. IEEE Trans. Neural Netw., 2001, Reilly, F.K. and Brown, K.C., Analysis of Investments &
12, 809–820. Managements of Portfolios, 2012 (South-Western Cengage
ter Horst, E., Rodriguez, A., Gzyl, H. and Molina, G., Stochastic Learning: Mason, OH).
volatility model including open, close, high and low prices. Quant. Saad, E.W., Prokhorov, D.V. and Wunsch, D.C., Comparative study of
Finance, 2012, 12, 199–212. stock trend prediction using time delay, recurrent and probabilistic
Huang, W., Nakamori, Y. and Wang, S.Y., Forecasting stock market neural networks. IEEE Trans. Neural Netw., 1998, 9, 1456–1470.
movement direction with support vector machine. Comput. Oper. Sharpe, W.F., The Sharpe ratio. J. Portf. Manage., 1994, 21, 49–58.
Res., 2005, 32, 2513–2522. Sortino, F.A. and Price, L.N., Performance measurement in a
Huang, C.L. and Tsai, C.Y., A hybrid SOFM-SVR with a filter-based downside risk framework. J. Invest., 1994, 3, 59–64.
feature selection for stock market forecasting. Expert Syst. Appl., Subha, M. and Nambi, S., Classification of stock index movement
2009, 36, 1529–1539. using k-Nearest Neighbours (k-NN) algorithm. WSEAS Trans.
Jung, C. and Bond, R., Forecasting UK stock prices. Appl. Financ. Inform. Sci. Appl., 2012, 9, 261–270.
Econ., 1996, 6, 279–286. Tay, F.E.H. and Cao, L., Application of support vector machines in
Kamruzzaman, J. and Sarker, R.A., ANN-based forecasting of foreign financial time series forecasting. Omega, 2001, 29, 309–317.
currency exchange rates. Neural Inform. Process. Lett. Rev., 2004, Tsai, C.F. and Hsiao, Y.C., Combining multiple feature selection
3, 49–57. methods for stock prediction: Union, intersection, and multi-
Kao, L., Chiu, C., Lu, C. and Chang, C.H., A hybrid approach by intersection approaches. Decis. Supp. Syst., 2010, 50, 258–269.
integrating wavelet-based feature extraction with MARS and SVR Vanstone, B. and Finnie, G., An emperical methodology for
for stock index forecasting. Decis. Supp. Syst., 2013, 54, 1228– developing stockmarket trading systems using artificial neural
1244. networks. Expert Syst. Appl., 2009, 36, 6668–6680.
Kara, Y., Boyacioglu, M.A. and Baykan, O.K., Predicting direction Yao, J. and Tan, C.L.,Acase study on using neural networks to perform
of stock price index movement using artificial neural networks technical forecasting of forex. Neurocomputing, 2000, 34, 79–98.
and support vector machines: The sample of the Istanbul Stock Yu, L., Wang, S. and Lai, K.K., Mining stock market tendency using
Exchange. Expert Syst. Appl., 2011, 38, 5311–5319. GA-based support vector machines. Lect. Notes Comput. Sci., 2005,
Karatzoglou, A., Smola, A. and Hornik, K., Kernlab – An 3828, 336–345.
S4 package for kernel methods in R, 2010. Available on-
line at: http://cran.r-project.org/web/packages/kernlab/vignettes/
kernlab.pdf (accessed 16 September 2014).
Prediction of stock price movement 803

Table 1. Technical indicators and formulas.

Name of indicators Formulas


1
Mt −S Mt Ht +L t +Ct i=1 0Mt−i+1
CCI (Commodity) Channel Index, 10 days 0.015Dt , where M t : 3 , S M t : 10
1
and Dt = ( i=1 0|Mt−i+1 − S Mt |)/10

SMA (Simple )
Ct +Ct−1 + ... +Ct−10
10-day moving average 10

EMAt−1 + 11 2 · (C − EMA
EMA (Exponential 10-day moving average) t t−1 )
EMAt−1 + 21 2 · (C − EMA
EMA (Exponential 20-day moving average) t t−1 )
2 · (2 · C − C ) + (1 − 2
ZLEMA (Zero lag exponential 11 t t− 9
2 11 · Z L E M At−1 )
10-day moving average)
10 · Ct +9 · Ct−1 + ... +Ct−10
WMA (Weighted 10-day moving average) 10+9+...+1
RSI (Relative Strength Index), 10 days 100 − 
100 
9 9
1+ i=0 U pt−i / i=0 Dwt−i
10 10
Momentum, 10 days Ct − Ct−10
Ct −Ct−10
ROC (Rate of change), 10 days Ct−10 · 100
SAR (Stop and reverse) S A Rt−1 + 0.02 · (E P − S A Rt−1 )
Volume Obtained from the ‘Yahoo! Finance’
Notes: Ct is the adjusted closing price, L t is the adjusted low price, Ht is the adjusted high price at time t, we use the time period of 10 or 20 days.
 
U p = ii−10 U pt ; Dw = ii−10 Dwt where
U pt = Ct − Ct−1 and Dwt = 0 if Ct > Ct−1
Dwt = Ct−1 − Ct and U pt = 0 if Ct < Ct−1 ;
EP (the extreme point) is the highest value reached by the price during the current uptrend or lowest value during a downtrend. During each period, if a new
maximum (or minimum) is observed, the EP is updated with that value. For indicators CCI, SMA, ZLEMA, WMA, RSI, momentum and ROC, we use 10 and
for EMA, we use 10 days and 20 days.

Appendix 1. The descriptions and definitions of input generally when the RSI rises above 30, it is considered a bullish
attributes signal, i.e. it is considered a signal that prices tend to rise.
Conversely, when it falls below 70, it is considered a bearish
Brief description of the used technical indicators: signal, i.e. a signal that prices are likely to fall.
• Volume is simply the number of shares or contracts that trade
• EMA, Exponential moving average calculates an exponentially- over a day. The higher the volume, the more active the security.
weighted mean, giving more weight to recent observations. The Volume is an important aspect of technical analysis because it
longer the period of the exponential moving average, the less is used to confirm trends and chart patterns. Any price move-
total weight is applied to the most recent price. The advantage of ment up or down with relatively high volume is seen as a
the exponential average is its ability to pick up on price changes stronger, more relevant move than a similar move with weak
more. volume.
• SMA, Simple moving average calculates the arithmetic mean of
the series over the past n observations. The shorter the time pe- In our experiment, we use four types of moving averages (SMA,
riod, the more responsive a moving average becomes. A typical EMA, WMA, ZLEMA), the advantage of moving averages is its
short-term moving average ranges from 5 to 25 days. tendency to smooth out some of the irregularities that exists between
• ZLEMA, Zero lag exponential moving average is similar to market days (Yao and Tan 2000). Moving averages are one of the
the EMA, as it gives more weight to recent observations, but oldest and most popular technical analysis tools. An in-depth analysis
attempts to remove lag by subtracting data prior to (n − 1)/2 of the chosen indicators can be found in Achelis (2013).
periods (default) to minimize the cumulative effect.
• WMA, Weighted moving average is similar to the EMA but with
linear weighting.
• SAR, the Parabolic Stop-and-Reverse provides excellent exit
points. You should close long positions when the price falls
below the SAR and close short positions when the price rises Appendix 2. Classification results, length of testing period
above the SAR.
• ROC, calculates the rate of change of a series over n periods. The length of the testing period and the frequency of the updating
The time period used to calculate the ROC may range from 1- model could also have an impact on the forecasts, hence we test
day (which results in a volatile chart showing the daily price different lengths of the testing period h. Due to higher computational
change) to 200-days (or longer). costs, we begin the procedure of building classifiers with h = 5 and
• mom, the momentum calculates the change of a series over n finish with h = 160. In tables B1–B4, the results of LDA, NB, linear
periods. SVM and SVM with Gaussian RBF kernel classifiers using different
• RSI, the Relative Strength Index is one of the most popular mo- lengths of testing period, respectively, are shown. The highest average
mentum oscillators. RSI calculates a ratio of the recent upward hit rate on all test sets occurs at h = 20 (for NB, linear SVM and
price movements to the absolute price movement and generates SVM with Gaussian RBF kernel) and for the LDA classifiers, the
a number that ranges from 0 to 100. The technicians say that highest performance occurs at h = 10. For building classifiers in our
experimental work, we use h = 20.
804 M. Gorenc Novak and D. Velušček

Table B1. Classification results of LDA classifiers.

h train acc test acc sens spec prec rise prec fall

160 63.54 ± 2.33 59.93 ± 4.32 60.42 ± 14.01 59.11 ± 12.92 60.34 ± 6.29 60.64 ± 6.28
80 63.53 ± 2.30 60.26 ± 5.65 61.32 ± 15.20 58.68 ± 14.21 60.55 ± 8.09 61.08 ± 8.26
40 63.53 ± 2.29 60.40 ± 7.64 61.30 ± 17.80 58.40 ± 16.97 60.55 ±11.12 61.13 ± 11.59
20 63.95 ± 2.47 60.66 ± 10.69 57.92 ± 21.74 62.18 ± 20.10 60.41 ± 17.08 61.71 ± 15.58
10 64.10 ± 2.62 61.07 ± 15.03 59.11 ±28.23 59.24 ± 27.28 60.53 ± 23.97 60.41 ± 23.68
5 64.20 ± 2.69 60.99 ± 21.37 56.33 ± 36.96 58.29 ± 36.55 59.43 ± 32.54 58.39 ± 31.84

Table B2. Classification results of NB classifiers.

h train acc test acc sens spec prec rise prec fall

160 57.62 ± 2.09 56.94 ± 6.92 68.03 ± 17.39 41.82 ± 18.37 54.86 ± 9.72 57.77 ± 14.12
80 57.62 ± 2.09 56.95 ± 6.95 68.05 ± 17.39 41.80 ± 18.40 54.86 ± 9.75 57.77 ± 14.18
40 57.63 ± 2.09 56.92 ± 6.98 67.83 ±17.48 41.95 ± 18.46 54.81 ± 9.81 57.72± 14.26
20 57.87 ± 2.27 57.28 ± 9.84 60.92 ± 23.24 47.84 ± 23.27 54.01 ± 15.86 56.98 ± 18.77
10 58.15 ± 2.29 57.13 ± 14.24 63.32 ± 30.93 42.18 ± 30.93 53.85 ± 22.34 55.39 ± 26.98
5 58.25 ± 2.42 57.05 ± 20.71 62.09 ± 38.36 40.71 ± 38.23 52.90 ± 28.80 54.36 ± 32.85

Table B3. Classification results of linear SVM classifiers.

h train acc test acc sens spec prec rise prec fall

160 63.52 ± 2.33 60.09 ± 4.35 62.72 ± 15.09 56.83 ± 14.03 60.02 ± 6.38 61.45 ± 6.56
80 63.49 ± 2.33 60.36 ± 5.64 63.51 ± 16.04 56.34 ± 15.15 60.13 ± 8.06 61.80 ± 8.58
40 63.49 ± 2.32 60.49 ± 7.60 63.47 ± 18.41 56.01 ± 17.69 60.11 ± 10.96 61.82 ± 12.09
20 63.49 ± 2.32 61.16 ± 10.68 63.36 ± 22.04 56.44 ± 21.37 60.60 ± 15.67 62.08 ± 17.34
10 63.51 ± 2.31 60.57 ± 14.81 62.32 ± 27.55 54.53 ± 27.47 59.13 ± 22.52 61.10 ± 24.28
5 63.51 ± 2.31 60.57 ± 20.98 60.21 ± 35.51 52.75 ± 35.66 57.66 ± 30.06 59.26 ± 31.71

Table B4. Classification results of RBF SVM classifiers.

h train acc test acc sens spec prec rise prec fall

160 70.80 ± 5.78 58.82 ±4.37 60.20 ± 15.30 56.72 ± 14.30 58.93 ± 6.29 59.73 ± 6.53
80 70.80 ± 5.79 59.10 ± 5.69 61.16 ± 16.04 56.16 ± 15.22 59.06 ± 8.19 60.09 ± 8.52
40 70.78 ± 5.78 59.30 ± 7.76 61.34 ± 18.10 55.97 ± 17.52 59.16 ± 11.20 60.24 ± 11.86
20 70.79 ± 5.78 59.39 ±10.71 61.30 ± 21.83 55.54 ± 21.46 59.05 ± 15.98 60.15 ± 17.28
10 70.78 ± 5.77 59.34 ± 7.73 61.48 ± 18.08 55.87 ± 17.46 59.16 ± 11.19 60.31 ± 11.91
5 70.79 ± 5.77 59.33 ± 21.16 58.79 ± 36.21 53.10± 36.21 56.97 ± 30.47 58.22 ± 31.82

Appendix 3. Comparison of classification results between companies do not survive as a part of the S&P 500 index until the end
2 chosen data-sets of 14 June 2013.
If we compare the results obtained in the same period for 462
In this section, we compare the results obtained using a batch of stocks (tables C1, C3, C5, and C7) to the results obtained for 370
462 companies comprised of S&P 500 members on 2 January 2008 stocks (tables C2, C4, C6, and C8), we can see that results on the
to the results by 370 previously chosen companies which had sur- testing period are on average higher for the later data-sets, but there
vived in the S&P 500 until 1 August 2013. The missing 38 stocks are no drastic differences in both results (on average ≤ 1% point).
(a difference to all 500 members) in the new batch were not freely Compared sensitivity and specificity show higher differences be-
available for access because they either have missing values on the tween two different data-sets (for LDA classifiers, and both SVM
first possible trading day or it was not possible to download the classifiers), while other classification measures do not change dras-
data from any of the free data sources. The way we have chosen tically. Also the lengths of the testing periods are the same as in
our data in our research (370 companies) suffers from survival bias. prior section, h = 20 which gave the highest classification results.
The aim of this section is to compare some classification results. In figures C1 and C2, we compared the trading strategies (Guided
The construction of the models begins on the first trading day, on D-threshold strategies) using a batch of 370 and batch of 462 com-
29 February 2008 and ends on 14 June 2013, total 1332 trading days. panies. The figures show that using a batch of 462 companies, the
In the first batch, all 370 companies survive throughout the new time trading strategies reach higher results than using a batch of 370
period, while the chosen 462 companies from the second batch, 21 companies.
Prediction of stock price movement 805

Figure C1. The figure shows four trading strategies: Guided D-threshold strategies (using LDA and NB classifier). From the figure, we can
see that trading strategies reach higher CAGR on a batch of 462 companies compared to a batch of 370 companies.

Table C1. Classification results of LDA classifiers, data used are 462 stocks starting on 29 February 2008.

h train acc test acc sens spec prec rise prec fall

160 62.62 ± 2.29 59.37 ± 4.13 57.30 ± 15.08 60.78 ± 12.96 58.91 ± 6.33 60.54 ± 6.00
80 62.54 ± 2.30 59.54 ± 5.42 57.47 ± 16.77 60.70 ± 14.54 58.65 ± 8.60 61.00 ± 7.77
40 62.55 ± 2.31 59.62 ± 7.54 57.30 ± 19.37 60.31 ± 17.43 58.74 ± 11.98 60.91 ± 11.17
20 62.59 ± 2.33 59.63 ± 10.55 56.97 ± 23.27 59.50 ± 21.67 58.56 ± 17.12 60.63 ± 16.32
10 62.59 ± 2.33 59.58 ± 14.91 56.15 ± 29.11 58.81 ± 27.31 57.81 ± 23.89 60.56 ± 23.01
5 62.59 ± 2.33 59.60 ± 20.96 53.88 ± 36.54 57.28 ± 35.12 55.46 ± 30.78 59.02 ± 30.31

Table C2. Classification results of LDA classifiers, data used are 370 stocks starting on 29 February 2008.

h train acc test acc sens spec prec rise prec fall

160 63.19 ± 2.13 59.96 ± 3.84 65.63 ± 13.75 53.53 ± 13.39 60.02 ± 5.17 61.08 ± 6.37
80 63.08 ± 2.13 60.23 ± 5.31 65.67 ± 15.08 53.99 ± 14.90 60.21 ± 7.28 61.55 ± 8.59
40 63.09 ± 2.12 60.29 ± 7.47 65.29 ± 17.79 53.52 ± 17.77 60.18 ± 10.39 61.29 ± 12.39
20 63.19 ± 2.12 60.51 ± 10.22 66.66 ± 21.38 50.81 ± 21.95 59.62 ± 14.85 61.66 ± 18.97
10 63.13 ± 2.07 60.34 ± 14.46 63.13 ± 27.03 51.97 ± 27.79 60.11 ± 21.42 59.49 ± 24.96
5 63.00 ± 2.06 62.92 ± 20.11 61.18 ± 33.86 55.01 ± 34.42 61.00 ± 28.48 60.36 ± 30.03
806 M. Gorenc Novak and D. Velušček

Figure C2. The figure shows four trading strategies: Guided D-threshold strategies (using SVM classifier with linear and RBF kernel). From
the figure, we can see that trading strategies reach higher CAGR on a batch of 462 companies compared to a batch of 370 companies.

Table C3. Classification results of NB classifiers, data used are 462 stocks starting on 29 February 2008.

h train acc test acc sens spec prec rise prec fall

160 56.88 ± 2.38 55.42 ± 3.95 70.73 ± 14.23 39.49 ± 14.92 53.25 ± 5.44 59.70 ± 7.20
80 56.73 ± 2.37 55.44 ± 5.11 70.51 ± 15.86 39.31 ± 16.65 52.94 ± 6.86 59.50 ± 9.76
40 56.69 ± 2.38 55.39 ± 7.07 69.88 ± 18.37 38.50 ± 19.47 52.56 ± 9.58 58.13 ± 15.37
20 56.67 ± 2.40 55.47 ± 9.85 69.42 ± 22.16 37.25 ± 23.25 52.40 ± 13.84 56.81 ± 21.85
10 56.66 ± 2.39 55.44 ± 14.21 67.05 ± 28.11 35.51 ± 28.04 50.39 ± 19.81 55.26 ± 27.99
5 56.67 ± 2.39 55.46 ± 20.18 66.02 ± 34.27 35.00 ± 33.53 49.82 ± 25.79 55.44 ± 32.47

Table C4. Classification results of NB classifiers, data used are 370 stocks starting on 29 February 2008.

h train acc test acc sens spec prec rise prec fall

160 57.65 ± 1.90 56.24 ± 3.63 73.66 ± 11.73 37.20 ± 13.03 55.23 ± 4.86 58.72 ± 6.86
80 57.49 ± 1.90 56.36 ± 4.80 73.06 ± 13.64 37.32 ± 15.07 55.13 ± 6.35 58.28 ± 9.67
40 57.46 ± 1.89 56.41 ± 6.83 72.50 ± 16.19 36.41 ± 18.05 54.87 ± 8.89 56.84 ± 15.75
20 57.45 ± 1.89 56.52 ± 9.63 71.95 ± 20.27 35.06 ± 22.07 54.61 ± 13.20 55.60 ± 22.61
10 57.45 ± 1.89 56.48 ± 14.01 69.64 ± 26.34 33.22 ± 27.03 52.83 ± 19.29 53.86 ± 28.59
5 57.45 ± 1.89 56.46 ± 20.08 68.46 ± 32.66 32.76 ± 32.58 51.90 ± 25.50 54.05 ± 32.99

Appendix 4. The forecasts distributed through time We graphically present how forecasts measured on a testing period
are distributed through time for each classifier separately figures D5,
In each figures D1–D4, there are four barplots, each with a quarter D7, D9 and D11. A bar in the bar graph represents the forecasts
of 370 stocks. Stocks are ordered by test accuracy. Bar in the barplot averaged over all 370 stocks form our original batch on a daily
represents the average over 1920 trading days (testing set) for a stock. test hit rate. For better insight, these forecasts are also presented by
The range of forecasts by stock is from 53.54% to 64.11%. frequency distribution, which can be seen in figures D6, D8, D10 and
Prediction of stock price movement 807
Table C5. Classification results of linear SVM classifiers, data used are 462 stocks starting on 29 February 2008.

h train acc test acc sens spec prec rise prec fall

160 62.53 ± 2.30 59.06 ± 4.32 58.44 ± 17.68 58.87 ±15.32 58.65 ± 6.28 60.76 ± 6.15
80 62.44 ± 2.32 59.26 ± 5.58 58.51 ± 19.06 58.82 ± 16.72 58.37 ± 8.34 61.12 ± 8.14
40 62.45 ± 2.32 59.30 ± 7.58 58.32 ± 20.99 58.25 ± 19.08 58.41 ± 11.71 60.88 ± 11.47
20 62.48 ± 2.35 59.31 ± 10.54 58.12 ± 24.78 57.33 ± 23.16 58.13 ± 16.70 60.60 ± 17.01
10 62.48 ± 2.35 59.30 ± 14.89 57.09 ± 30.06 56.56 ± 28.40 57.20 ± 23.31 60.28 ± 23.64
5 62.48 ± 2.35 59.33 ± 20.93 54.97 ± 37.08 55.02 ± 35.74 55.00 ± 30.02 58.82 ± 30.53

Table C6. Classification results of linear SVM classifiers, data used are 370 stocks starting on 29 February 2008.

h train acc test acc sens spec prec rise prec fall

160 63.20 ± 2.17 59.88 ± 3.91 68.49 ± 14.61 50.26 ± 14.85 59.48 ± 5.15 62.05 ± 7.02
80 63.08 ± 2.16 60.09 ± 5.30 68.51 ± 15.75 50.55 ± 16.06 59.59 ± 7.15 62.43 ± 9.29
40 63.11 ± 2.12 60.20 ± 7.44 68.04 ± 17.98 50.21 ± 18.73 59.68 ± 10.18 61.98 ± 13.34
20 63.11 ± 2.11 60.30 ± 10.41 67.88 ± 21.49 49.36 ± 22.70 59.59 ± 14.60 61.70 ± 19.46
10 63.10 ± 2.11 60.25 ± 14.69 66.66 ± 26.93 48.64 ± 28.27 58.68 ± 21.03 61.12 ± 25.94
5 63.11 ± 2.11 60.24 ± 20.81 64.26 ± 34.55 46.76 ± 35.71 56.61 ± 28.43 59.14 ± 32.60

Table C7. Classification results of RBF SVM classifiers, data used are 462 stocks starting on 29 February 2008.

h train acc test acc sens spec prec rise prec fall

160 71.45 ± 6.78 57.91 ± 4.54 58.07 ± 15.88 57.13 ± 14.48 57.20 ± 6.06 59.47 ± 6.41
80 71.27 ± 6.81 58.15 ± 5.78 58.18 ± 17.19 57.33 ± 15.88 57.14 ± 8.32 59.91 ± 8.27
40 71.26 ± 6.83 58.19 ± 7.75 57.86 ± 19.52 57.31 ± 18.37 57.32 ± 11.52 59.71 ± 11.46
20 71.27 ± 6.82 58.26 ± 10.71 58.05 ± 23.25 56.56 ± 22.33 57.28 ± 16.30 59.61 ± 16.78
10 71.27 ± 6.82 58.21 ± 15.09 56.99 ± 29.29 55.73 ± 28.34 56.38 ± 23.31 59.05 ± 23.83
5 71.27 ± 6.82 58.21 ± 21.26 55.45 ± 37.39 54.28 ± 36.36 54.75 ± 30.33 57.83 ± 31.20

Table C8. Classification results of RBF SVM classifiers, data used are 370 stocks starting on 29 February 2008.

h train acc test acc sens spec prec rise prec fall

160 71.75 ± 6.39 58.63 ± 4.09 66.54 ± 14.18 49.98 ± 14.09 58.39 ± 5.28 60.12 ± 6.80
80 71.53 ± 6.40 58.84 ± 5.40 66.12 ± 15.14 50.83 ± 15.28 58.63 ± 7.17 60.27 ± 8.87
40 71.53 ± 6.42 59.00 ± 7.51 65.87 ± 17.40 50.75 ± 17.90 58.92 ± 10.01 60.09 ± 12.77
20 71.51 ± 6.42 59.20 ± 10.58 65.88 ± 21.03 50.32 ± 22.18 59.04 ± 14.63 59.91 ± 18.71
10 71.51 ± 6.42 59.15 ± 14.99 64.69 ± 27.16 49.65 ± 28.56 58.26 ± 21.47 59.26 ± 25.76
5 71.50 ± 6.42 59.07 ± 21.26 62.96 ± 35.50 47.91 ± 36.56 56.63 ± 28.99 57.60 ± 32.85

D12, into which we added mean (labelled by red) and is in all cases Appendix 7. Testing of indicator usefulness
around 60%.
There are many algorithms for feature selection, but for the sake of
argument we have taken out just one technical indicator from the
chosen subset, to test and compare if the results dramatically change.
Appendix 5. Some details of Guided D-threshold strategies Without loss of generality, we have chosen the length of testing
periods, h = 160, because the performance of the experiment is the
In figures E5–E8, profits over time on a testing period are exposed. fastest, and the test results are still comparable between each other.
In each figure, three graphs are presented, on the first daily profits The results are presented in tables G1–G4. We highlighted average
over time, on the second monthly profits over time, and on the third test results, which are higher with omitted technical indicator. From
the frequency distribution of profits are shown. In the last graph, we table G1 we can see, there are four indicators, which we should omit
include the mean of all daily profits. from the chosen attribute set: SMA10, SAR, mom10 and ROC10. In
table G2, there are also four indicators, namely SAR, mom10, ROC10
and CCI10, which should be omitted and without them we could
reach higher results. Three technical indicators (SMA10, mom10
Appendix 6. Managing the portfolio
and ROC10) should be omitted when we use linear SVM classifier
(table G3) and none of the indicators if we use SVM with RBF
We also try to improve portfolio management. Instead of investing an
kernel (table G4). Apparently, the results do not change dramatically
equal amount of money in every stock in which we intend to invest, we
if one of the indicators is omitted. In the last table G4, the highest
make the weight of that stock (results are presented in tables F1-F4).
808 M. Gorenc Novak and D. Velušček

Figure D1. Stock forecasts, each column represents average test rate on the whole testing period for one particular stock, LDA is used as a
classifier.

classification accuracy is achieved if we use all of the mentioned choose the relevant indicators). Hence, a profound investigation is
technical indicators. needed and is left for the further work.
The relevancy of the indicator depends on used classifiers and data To determine if the differences using various attribute sets were
(for every stock and data frame (see figure G2), we should separately statistically significant, the Wilcoxon signed-rank test is used. We
Prediction of stock price movement 809

Figure D2. Stock forecasts, each column represents average test rate on the whole testing period, NB is used as a classifier.

Table F1. Performance of proposed Guided D-threshold strategies (included in the article).

Mean Std Sharpe ratio Sortino ratio Info ratio CAGR

Guided DLDA 0.15 0.04 3.74 0.12 3.57 39.31


Guided DNB 0.15 0.04 3.89 0.13 3.74 40.21
Guided DRBF 0.17 0.04 4.29 0.14 4.23 48.07
Guided Dlin 0.15 0.04 3.94 0.13 3.81 41.30
810 M. Gorenc Novak and D. Velušček

Figure D3. Stock forecasts, each column represents average test rate on the whole testing period for one particular stock, SVM with RBF
kernel is used as a classifier.

want to determine the attributes (technical indicators), which give is equal or better than the classification results’median’s rank obtained
higher performance than when we use all technical indicators (for by the all technical indicators. We reject the null hypothesis and accept
each classifier separately). We used the one-tailed version of the test. the alternative: the attribute set with omitted technical indicator shows
The null hypothesis states that classification results’ median’s rank worse classification results’ median’s rank than the attribute set with
obtained by the technical indicators with omitted mentioned attribute all 12 technical indicators at a 0.05 significance level (see table G5).
Prediction of stock price movement 811

Figure D4. Stock forecasts, each column represents average test rate on the whole testing period for one particular stock, SVM with linear
kernel is used as a classifier.
812 M. Gorenc Novak and D. Velušček

Figure D5. Daily forecasts, LDA classifier.

Figure D6. Frequency distribution of daily forecasts obtained by LDA classifier.

Table F2. Performance of proposed Guided D-threshold strategies. Weights are proportional to the expected strategy gains.

Mean Std Sharpe ratio Sortino ratio Info ratio CAGR

Guided DLDA 0.14 0.04 3.05 0.10 2.84 34.35


Guided DNB 0.14 0.04 3.23 0.11 3.01 36.07
Guided DRBF 0.17 0.05 3.59 0.12 3.48 44.02
Guided Dlin 0.12 0.04 2.70 0.09 2.42 29.00
Prediction of stock price movement 813

Figure D7. Daily forecasts, NB classifier.

Figure D8. Frequency distribution of daily forecasts obtained by NB classifier.

Table F3. Performance of proposed Guided D-threshold strategies. Weights are proportional to the forecast accuracy.

Mean Std Sharpe ratio Sortino ratio Info ratio CAGR

Guided DLDA 0.15 0.04 3.69 0.12 3.52 38.87


Guided DNB 0.15 0.04 3.89 0.13 3.74 40.30
Guided DRBF 0.17 0.04 4.19 0.14 4.11 46.79
Guided Dlin 0.15 0.04 3.85 0.13 3.71 40.38
814 M. Gorenc Novak and D. Velušček

Figure D9. Daily forecasts, SVM with RBF kernel.

Figure D10. Frequency distribution of daily forecasts obtained by SVM with RBF kernel.
Prediction of stock price movement 815

Figure D11. Daily forecasts, SVM with linear kernel.

Figure D12. Frequency distribution of daily forecasts obtained by SVM with linear kernel.
816 M. Gorenc Novak and D. Velušček

Figure E1. Percentage of the number of stocks involved in ‘Guided DLDA’ strategy.

Figure E2. Percentage of the number of stocks involved in ‘Guided DNB ’ strategy.

Table F4. Performance of proposed Guided D-threshold strategies. Weights are inversely proportional to the forecast error.

Mean Std Sharpe ratio Sortino ratio Info ratio CAGR

Guided DLDA 0.14 0.04 3.64 0.12 3.46 38.40


Guided DNB 0.15 0.04 3.85 0.13 3.68 39.89
Guided DRBF 0.16 0.04 3.95 0.13 3.82 43.75
Guided Dlin 0.14 0.04 3.65 0.12 3.49 38.32
Prediction of stock price movement 817

Figure E3. Percentage of the number of stocks involved in ‘Guided DRBF ’ strategy.

Figure E4. Percentage of the number of stocks involved in ‘Guided Dlin ’ strategy.
818 M. Gorenc Novak and D. Velušček

Figure E5. Profits distributed over the time of ‘Guided DLDA’-strategy. Each bar represents daily (the first graph) or monthly (the second
graph) average profits on all possible 370 stocks. The last graph represents frequency distribution of losses and profits.
Prediction of stock price movement 819

Figure E6. Profits distributed over the time of ‘Guided DNB ’-strategy. Each bar represents daily (the first graph) or monthly (the second
graph) average profits on all possible 370 stocks. The last graph represents frequency distribution of losses and profits.
820 M. Gorenc Novak and D. Velušček

Figure E7. Profits distributed over the time of ‘Guided DRBF ’-strategy. Each bar represents daily (the first graph) or monthly (the second
graph) average profits on all possible 370 stocks. The last graph represents frequency distribution of losses and profits.
Prediction of stock price movement 821

Figure E8. Profits distributed over the time of ‘Guided Dlin ’-strategy. Each bar represents daily (the first graph) or monthly (the second
graph) average profits on all possible 370 stocks. The last graph represents frequency distribution of losses and profits.
822 M. Gorenc Novak and D. Velušček

Figure E9. In the above graphs, the frequency distribution of trades resulting in a loss is shown. The ‘Guided DLDA’, ‘Guided DNB ’ and
‘Guided DRBF ’ strategies are used. The red line represents mean. The y axis represents the frequency of days on all 1920 trading days.
Prediction of stock price movement 823

Figure F10. The ‘Guided Dlin ’ strategy is used. The red line represents mean.

Table G1. Classification results of LDA classifiers, h = 160.

Without indicator train acc test acc sens spec prec rise prec fall

/ 63.54 ± 2.33 59.93 ± 4.32 60.42 ± 14.01 59.11 ± 12.92 60.34 ± 6.29 60.64 ± 6.28
Volume 63.24 ± 2.37 59.73 ± 4.36 59.37 ± 13.48 59.92 ± 12.45 60.32 ± 6.24 60.12 ± 6.09
EMA10 63.23 ± 2.30 59.81 ± 4.35 60.30 ± 13.84 58.82 ± 12.85 60.10 ±6.21 60.41 ± 6.15
EMA20 63.05 ± 2.32 59.88 ± 4.34 61.01 ± 13.80 58.10 ± 12.93 60.01 ± 6.19 60.59 ± 6.22
SMA10 63.44 ± 2.32 60.02 ± 4.31 60.53 ± 14.10 59.19 ± 13.02 60.45 ± 6.27 60.77 ± 6.32
ZLEMA10 63.26 ± 2.32 59.75 ± 4.34 59.70 ± 14.39 59.54 ± 13.12 60.30± 6.42 60.40 ± 6.37
WMA10 63.38 ± 2.30 59.91 ± 4.34 60.22 ± 14.14 59.27 ± 13.01 60.37 ± 6.26 60.58 ± 6.31
SAR 63.43 ± 2.32 60.24 ± 4.19 61.89 ± 12.24 58.14 ± 10.92 60.19 ± 5.88 60.99 ± 5.99
mom10 63.41 ± 2.30 60.12 ± 4.24 61.36 ± 14.09 58.45 ± 12.93 60.32 ± 6.24 61.06 ± 6.19
ROC10 63.43 ± 2.31 60.10 ± 4.22 61.15 ± 14.03 58.65 ± 12.93 60.38 ± 6.20 60.98 ± 6.22
CCI10 62.19 ± 2.28 58.98 ± 4.26 57.30 ± 14.54 60.37 ± 13.02 59.82 ± 6.34 59.23 ± 6.03
RSI10 62.98 ± 2.35 59.26 ± 4.43 58.60 ± 15.49 59.73 ± 13.99 60.10 ± 6.66 60.09 ± 6.74

Table G2. Classification results of NB classifiers, h = 160.

Without indicator train acc test acc sens spec prec rise prec fall

/ 57.62 ± 2.09 56.94 ± 6.92 68.03 ± 17.39 41.82 ± 18.37 54.86 ± 9.72 57.77 ± 14.12
Volume 57.68 ± 2.02 56.91 ± 3.77 67.74 ± 12.54 44.51 ± 12.98 55.64 ± 5.26 58.83 ± 5.84
EMA10 57.81 ± 2.07 56.77 ± 3.80 67.34 ± 13.69 44.61 ± 13.93 55.56 ± 5.46 58.80 ± 6.19
EMA20 57.89 ± 2.11 56.90 ± 3.79 67.71 ± 13.37 44.57 ± 13.59 55.65 ± 5.38 59.01 ± 6.17
SMA10 57.86 ± 2.10 56.87 ± 3.78 67.64 ± 13.65 44.51 ± 13.92 55.63 ± 5.42 59.01 ± 6.22
ZLEMA10 56.31 ± 2.07 55.58 ± 3.68 67.22 ± 13.88 42.27 ± 14.12 54.38 ± 5.17 57.30 ± 6.26
WMA10 57.62 ± 2.06 56.61 ± 3.77 67.28 ± 13.90 44.32 ± 14.15 55.44 ± 5.41 58.62 ± 6.17
SAR 57.83 ± 2.11 57.07 ± 3.66 68.05 ± 12.07 44.49 ± 12.79 55.74 ± 5.05 59.11 ± 6.02
mom10 57.82 ± 2.13 56.95 ± 3.79 68.20 ± 13.47 44.12 ± 13.78 55.66 ± 5.29 59.27 ± 6.34
ROC10 57.83 ± 2.12 56.95 ± 3.77 68.15 ± 13.31 44.17 ± 13.60 55.67 ± 5.28 59.21 ± 6.20
CCI10 58.00 ± 2.21 57.00 ± 3.83 68.72 ± 13.78 43.70 ± 14.21 55.71 ± 5.32 59.55 ± 6.40
RSI10 57.79 ± 2.15 56.81 ± 3.83 68.62 ± 13.77 43.46 ± 14.11 55.54 ± 5.37 59.38 ± 6.58
824 M. Gorenc Novak and D. Velušček

Figure F11. VaR and CVaR calculated over 500 trading days. Confidence level is 0.05.
Prediction of stock price movement 825

Table G3. Classification results of linear SVM classifiers, h = 160.

Without indicator train acc test acc sens spec prec rise prec fall

/ 63.52 ± 2.33 60.09 ± 4.35 62.72 ± 15.09 56.83 ± 14.03 60.02 ± 6.38 61.45 ± 6.56
Volume 63.24 ± 2.40 59.97 ± 4.37 61.11 ± 14.83 58.35 ± 13.45 60.14 ± 6.29 60.79 ± 6.28
EMA10 63.25 ± 2.34 59.98 ± 4.34 62.67 ± 15.07 56.60 ± 14.07 59.88 ± 6.23 61.31 ± 6.48
EMA20 63.08 ± 2.36 60.00 ± 4.35 63.32 ± 15.05 55.83 ± 14.17 59.72 ± 6.24 61.47 ± 6.56
SMA10 63.46 ± 2.33 60.13 ± 4.33 62.70 ± 15.15 56.94 ± 14.11 60.09 ± 6.32 61.47 ± 6.56
ZLEMA10 63.30 ± 2.36 59.71 ± 4.34 61.35 ± 15.76 57.54 ± 14.43 59.95 ± 6.39 60.88 ± 6.62
WMA10 63.45 ± 2.34 60.08 ± 4.34 62.56 ± 15.07 56.97 ± 14.00 60.04 ± 6.30 61.36 ± 6.56
SAR 63.23 ± 2.39 59.99 ± 4.35 61.15 ± 14.84 58.37 ± 13.56 60.22 ± 6.24 60.84 ± 6.27
mom10 63.42 ± 2.33 60.17 ± 4.27 63.27 ± 15.19 56.39 ± 14.05 59.95 ± 6.28 61.71 ± 6.47
ROC10 63.40 ± 2.36 60.12 ± 4.29 63.40 ± 15.04 56.15 ± 14.07 59.90 ± 6.25 61.68 ± 6.40
CCI10 61.94 ± 2.30 59.17 ± 4.25 59.77 ± 15.85 57.93 ± 14.27 59.45 ± 6.28 59.98 ± 6.15
RSI10 62.88 ± 2.44 59.30 ± 4.48 60.65 ± 17.33 57.50 ± 15.78 59.86 ± 6.83 60.98 ± 7.22

Table G4. Classification results of SVM with RBF kernel, h = 160.

Without indicator train acc test acc sens spec prec rise prec fall

/ 63.55 ± 2.33 60.09 ± 4.35 62.71 ± 15.07 56.85 ± 14.01 60.01 ± 6.37 61.44 ± 6.54
Volume 69.65 ± 5.12 59.05 ± 4.38 60.62 ± 15.04 56.88 ± 14.07 59.15 ± 6.18 59.93 ± 6.42
EMA10 70.78 ± 5.71 58.84 ± 4.37 60.43 ± 15.28 56.52 ± 14.28 58.91 ± 6.28 59.76 ± 6.55
EMA20 70.45 ± 5.70 58.95 ± 4.41 60.65 ± 15.25 56.54 ± 14.14 58.98 ± 6.28 59.92 ± 6.57
SMA10 70.57 ± 5.58 58.93 ± 4.41 60.57 ± 15.39 56.57 ± 14.35 59.01 ± 6.20 59.91 ± 6.60
ZLEMA10 70.27 ± 5.51 58.03 ± 4.37 58.09 ± 16.05 57.33 ± 14.72 58.36 ± 6.43 58.60 ± 6.43
WMA10 70.77 ± 5.67 58.90 ± 4.39 60.47 ± 15.21 56.61 ± 14.07 58.97 ± 6.22 59.88 ± 6.57
SAR 70.55 ± 5.26 59.38 ± 4.18 61.86 ± 13.46 56.19 ± 12.38 59.14 ± 5.87 60.36 ± 6.28
mom10 70.43 ± 5.45 59.00 ± 4.43 60.90 ± 15.29 56.31 ± 14.16 58.97 ± 6.22 60.08 ± 6.70
ROC10 69.96 ± 5.32 59.00 ± 4.37 60.83 ± 15.24 56.41 ± 14.15 59.03 ± 6.20 60.03 ± 6.55
CCI10 65.61 ± 4.00 58.25 ± 4.24 59.56 ± 16.00 56.06 ± 14.88 58.30 ± 6.28 59.11 ± 6.33
RSI10 70.46 ± 5.43 58.88 ± 4.42 60.40 ± 15.45 56.71 ± 14.32 59.02 ± 6.36 59.88 ± 6.66

Table G5. The Wilcoxon signed-rank test of classification results. For the input data, we use two vectors of average classification results on
the testing set, which are obtained by omitting some technical indicators that yielded higher results than when we use all technical indicators.
p-values between 0.01 and 0.05 are shown with one asterisk ∗ and p-values less than 0.01 are shown with two asterisks ∗∗. Only highlighted
technical indicators from tables G1–G3 are exposed in the table.

LDA NB lin SVM

All TI vs. omitted SMA 10 0.014∗ / 0.059


All TI vs. omitted SAR 0.001∗∗ 0.001∗∗ /
All TI vs. omitted mom 10 0.068 0.002∗∗ 0.105
All TI vs. omitted ROC 10 0.030∗ 0.001∗∗ 0.252
All TI vs. omitted CCI 10 / 0.001∗∗ /
826 M. Gorenc Novak and D. Velušček

Figure G2. Comparison between two different sets of technical indicators. The first set contains all 12 technical indicators that are used in
experimental work, and in another set, we omit the technical indicator ‘momentum’. The figure above illustrates that through the time period
the relevance of the chosen technical indicators is not constant.

You might also like