Applied Soft Computing: Manoj Thakur, Deepak Kumar
Applied Soft Computing: Manoj Thakur, Deepak Kumar
a r t i c l e i n f o a b s t r a c t
Article history: This study presents a decision support system for algorithmic trading in the financial market that uses a
Received 2 August 2017 new hybrid approach for making automatic trading decision. The hybrid approach integrates weighted
Received in revised form multicategory generalized eigenvalue support vector machine (WMGEPSVM) and random forest (RF)
17 December 2017
algorithms (named RF-WMGEPSVM) to generate “Buy/Hold/Sell” signals. The WMGEPSVM technique
Accepted 3 March 2018
has an advantage of handling the unbalanced data set effectively. The input variables are generated from
Available online 10 March 2018
a number of technical indicators and oscillators that are widely used in industry by professional financial
experts. Selection of relevant input variables can enhance the predictive capability of the prediction
Keywords:
Financial forecasting
algorithms. RF technique is employed to discover the optimal feature subset from a large set of technical
Technical Analysis indicators. The proposed hybrid system is tested using “walk forward” approach for its capability of taking
Weighted Multicategory GEPSVM an automatic trading decision on daily data of five index futures, viz., NASDAQ, DOW JONES, S&P 500,
Random forest NIFTY 50 and NIFTY BANK. RF-WMGEPSVM achieves the notable improvement over the buy/hold strategy
Walk forward approach and other predictive models contemplated in this study. It is also observed that combining WMGEPSVM
with RF further improves the results. Empirical results confirm the effectiveness of RF-WMGEPSVM in
the real market scenarios having bullish, bearish or flat trend.
© 2018 Elsevier B.V. All rights reserved.
https://doi.org/10.1016/j.asoc.2018.03.006
1568-4946/© 2018 Elsevier B.V. All rights reserved.
338 M. Thakur, D. Kumar / Applied Soft Computing 67 (2018) 337–349
or high correlation with another input may drastically affect the market. The RF technique is applied to find the optimal set of input
performance of the prediction model and may result in high gener- technical indicators for WMGEPSVM. The trading strategy gives
alization error in the prediction phase. Feature selection techniques “Buy/Hold/Sell” signals that are generated based on the historical
try to address this problem by discovering the optimal subset price of the stock indices. The proposed financial trading system is
of input variables. Therefore, research in the recent years is also tested with the NASDAQ, DOW JONES and S&P 500, NIFTY 50 and
focused on the development and use of suitable feature selection NIFTY BANK futures indices over a period of 500 trading days. The
techniques to enhance the generalization capability and reducing data considered for the study consist of variety of market scenar-
the computation time in building the prediction model for finan- ios that are witnessed during various phases (bullish, bearish and
cial markets. Various feature extraction methods such as Principal sideways) of the real financial markets. Some of the most widely
Component Analysis (PCA), Kernel Principal Component Analysis used practical performance measures used in financial markets
(KPCA), Independent Component Analysis (ICA) [24], Genetic Algo- such as rate of return, percent profitability and Maximum draw-
rithm (GA) [14] and nonlinear independent component analysis down are used to evaluate the performance of the proposed trading
[25], have been used to identify the optimal subset of features that strategy. Performance of RF-WMGEPSVM is compared with tradi-
serve as inputs to SVMs for forecasting the market prices. Recently, tional and recently developed approaches such as “buy and hold”
Lee [26] proposed SVM based prediction model with hybrid fea- investment strategy, RF-PSVM [17], balanced multicategory sup-
ture selection techniques for forecasting the future direction that port vector machine (BMPSVM) [35], OVA-Multi-class least squares
combines the F-score with Supported Sequential Forward Search twin SVM (MLSTSVM) [36] and RF in combination with BMPSVM
(F-SSFS). (RF-BMPSVM) and MLSTSVM (RF-MLSTSVM) based on these mea-
In the last decade, research in the area of automatic learning sures. Experimental findings show that the RF-WMGEPSVM system
has opened an unprecedented possibility in developing more reli- outperforms most of other strategies with respect to these matri-
able decision support system for financial trading strategy. Various ces and is also found to be effective in bullish, bearish and sideways
hybrid artificial intelligence tools have been developed that help to financial market scenarios.
make a financial trading decision. Tsaih et al. [27] applied a hybrid The contents of this paper are organized as follows. The pro-
AI approach that integrates the neural network technique with the posed financial trading strategy are explained in Section 2. Section 3
rule-based systems technique to predict daily price changes in S&P gives a brief introduction of RF and WMGEPSVM used in the current
500 index futures. A decision support system was proposed by Baba study. Section 4 reports the experimental findings comparison and
et al. [28], combining neural networks and genetic algorithms for analysis of results. Conclusions from the current study are drawn
forecasting the Tokyo Stock Exchange Indexes. Though many stud- in Section 5.
ies for trading decision support system have shown encouraging
results, most of them are evaluated based on statistical measures
such as forecasting accuracy, mean squared error, precision, recall. 2. Financial trading decision system using RF-WMGEPSVM
Transaction cost is one of the most important factors that needs
to be considered while evaluating the performance of a financial The decision making in financial markets involves picking the
trading system. Most of the studies done in the area of automatic right stock for possibility of getting desired returns. There are two
trading system have not included transaction cost while measur- different type of techniques used for making an investment deci-
ing the trading system performance. However, Alexander [29] and sion. These methodologies are termed as Fundamental Analysis and
Hudson et al. [30] are reported that the performance of a trading Technical Analysis [37].
strategy is quite sensitive to the transaction cost. Fundamental Analysis is a way of analyzing the price of the
In more recent work, a hybrid neurogenetic system for finan- stocks based on various economical factors such as cash flow,
cial trading was proposed by Kwon et al. [31]. A recurrent neural balance sheet and income analysis. In Fundamental Analysis the
network (RNN) is used for the predicting the market direction reports about the profits, expenditures, holding of resources hav-
and a Genetic Algorithm (GA) optimizes the NN’s weights under ing a potential of future earnings, debts and interests paid against
a 2-D encoding and crossover. Wen et al. [32] proposed an intel- a debt are taken in to account to take an investment decision.
ligent stock decision support system by combining the support Technical Analysis is based on postulates collected from the Dow
vector regression (SVR) [33] and box theory. Both studies have Theory given by Charles Dow around a hundred years back (refer
been reported that automatic stock decision support system is [38] for details). Technical Analysis deals with the study of price
performed significantly better than buy-and-hold strategy. Above movements in the market. It only takes into account the chart pat-
mentioned studies have concluded that the hybrid prediction terns generated with the historical stock price data. On a chart, the
model in financial forecasting performs better than the individual price is plotted in the form of a bar that enables the analysis of a
learning paradigm. However, the way of integration of such meth- chart on a fixed time frame. A green bar is called a bullish bar (indi-
ods is very critical for development of such prediction models. The cates a rise in the price) indicating that the close price on the bar
aim of these studies is to combine use of different techniques to is higher than the open price. On the other hand a red bar is called
achieve better decision making system than employment of the a bearish bar (points to a fall in the price) reflecting the scenario
techniques alone. Recently, Kumar et al. [17] proposed Proximal when the close price is less than the open price. The peak and bot-
support vector machine (PSVM) based predictive model with ran- tom of the chart reflect the high and low prices seen during the
dom forest that uses a tree based ensemble technique to rank the period of the bar. Fig. 1 reflects the bullish, bearish and sideways
relative importance of input technical indicators. The empirical market trend for Dow Jones index future based on chart made up
findings suggested that random forest (RF) in combination with of daily data.
PSVM is superior to linear correlation, rank correlation, regression A trending market is one which moves in only one direction.
relief techniques for stock index trend prediction. A bullish (up) trend is identified by a series of higher high and
This study focuses on the development of financial trading sys- higher low while a bearish (down) trend is identified by a series of
tems which uses Weighted Multicategory GEPSVM (WMGEPSVM) lower high and lower lows. When the stock price moves in a narrow
[34] in combination of random forest (RF) and technical indi- range (a range bound market), the price trend is difficult to identify.
cators. This automatic financial trading system is named as Another major difficulty faced is to differentiate between correc-
RF-WMGEPSVM. Various technical indicators and oscillators are tion and trend reversal. A correction is a movement in a trending
used as input variables for WMGEPSVM to predict the trends of the market when the price pulls back a little and resumes moving again
M. Thakur, D. Kumar / Applied Soft Computing 67 (2018) 337–349 339
in that direction. On the other hand, a reversal is a price moment is kept as it is till these signal of square off (buying in case of short
when stock price start moving the opposite trend (uptrend in case positions and selling in the case of long position).
of bearish market and down trend in case of bullish market). The
chart pattern and trends formed are analyzed to predict the price Algorithm 1. “BUY-HOLD-SELL” trading strategy
movement.
The chart is analyzed using a set of instruments termed as Initialize LONG ←− NONE
SHORT ←− NONE
technical indicators that are superimposed onto a chart to spot
BUY ←− NONE
identifiable price patterns. Based on the collective behavior of the SELL ←− NONE
price data and technical indicators trading strategies are made. A IF (St = Buy)
trading strategy is aimed to capture the major trends of the mar- IF(SHORT = / NONE)
ket. Technical Analysis is about the decision making based on price SELL = Ct // Short position is squared off at price Ct .
SHORT ←− NONE
trend. The objective is to make a decision (a buy signal or a sell sig-
END IF
nal) based on the price trend, and then keep the position as it is until IF(LONG = NONE)
it becomes evident from a weight of the evidences suggested by a BUY = Ct // Long position is opened at price Ct .
number of technical indicators indicating the change in the trend LONG ←− 1
END IF
(i.e. the current trend has ended and a reverse trend has begun).
END IF
For comprehensive details about the Technical Analysis, readers IF (St = Sell)
are advised to refer [37,39,40]. IF(LONG = / NONE)
Financial institutions and investors require to make investment LONG = Ct // Long position is squared off at price Ct .
decisions depending on their behavioral scopes and trading horizon LONG ←− NONE
END IF
such as intraday, daily, weekly, and monthly trading. In this study,
IF(SHORT = NONE)
a trading strategy is considered which make use of daily data index SELL = Ct // Short position is opened at price Ct .
future. SHORT ←− 1
The daily market data at day t consists of open (Ot ), high (Ht ), END IF
END IF
low (Lt ), close (Ct ) price and volume (Vt ). The signals at day t, i.e., St
IF (St = Hold)
is produced based on the following rule. SHORT
⎧ LONG // Keep all positions open.
⎪ BUY, if C(t+1) > H(t) and L(t+1) > L(t)
⎨ END IF
St = SELL, if C(t+1) < L(t) and H(t+1) < H(t) (1) The performance of a financial trading system is evaluated based
⎪
⎩ on some of the most significant performance measures such as the
HOLD, otherwise rate of return (ROR), maximum draw down (MDD) and percent
profitability (PP). Let R0 is the initial investment and Rt be the value
A schematic representation of a desired trading strategy is depicted of fund at day t.
in Fig. 1. The ROR is one of the most useful criterion for evaluating a trad-
ing strategy that indicates the profit/loss on the initial investment
2.1. Financial trading strategy over a period of time. It can be calculated for a period of time t.
Table 1
Description and input variable formulation.
1
ı
6 x(t,6) = ı
CLt−i ı-days moving average (SMA)
i=1
CLt −MA(ı)
12 x(t,12) = y
ı-days Bias
13 x(t,13) = (EMA(ı) − EMA(ı − d)) ı days Moving Average Convergence and Divergence MACD
14 x(t,14) = CLt − CLt−ı Momentum measures change in stock price over last ı days (MTM)
CLt
15 x(t,15) = CLt−ı
× 100 ı-days Price Rate of Change
MA(ı)−MA(z)
16 x(t,16) = MA(ı)
Price oscillator (OSCP)
1
17 x(t,17) = 2
(LL(t−ı) + HH (t−ı) Median Price (MP)
LLt−ı and HHt−ı are the lowest low and highest high in last ı trading days respectively. (t − ı) denotes the last ı trading days from day t and different input features can be
generated by using the different values of input parameter ı.
cumulative loss from the peak to the subsequent trough. MDD is random subsets of features, where each tree i , (∀i = 1, 2, . . ., ) is
computed in percentage terms as: constructed using bootstrapped training data. In RF, a subset of ran-
SUP s ∈ [0,t] X(s) − X(t) domly selected features is taken rather than defining the best split
PP = ∗ 100 (3) among all the input variables.
SUP s ∈ [0,t] X(s)
Let ((1 , y1 ), (2 , y2 ), . . ., (m , ym )) denotes the training set con-
The PP (also called as the probability of winning) is obtained by sisting of feature vectors, ∈ Rn , and output, yi ∈ R (∀, yi ∈ {1, 2,
dividing the total number of winning trades by the total number of . . ., K} into K classes), where m is the number of trading days and
trades for the entire trading period t. n is the number of features. Firstly, data is sampled with replace-
ment for each decision tree i . For constructing the decision tree,
Number of winning trades
PP = (4) best split among mtry n randomly selected variables one of n
Total number of trades
features is chosen. The final classification decision is obtained by
3. Methodology aggregating the outcomes of all decision trees. In RF, randomness
in the construction of different trees and selecting the best split
3.1. Random forest feature subset plays a critical role for better generalization. Hence,
only two-third of randomly split bootstrapped data is utilized for
Random forests (RF) [41] is an efficient and extensively used sta- training and remaining one-third data, called Out-of-a Bag (OOB)
tistical learning algorithm for both categorization and regression samples, is utilized to test the performance of a decision tree and
problems. RF has been also getting attention in feature pruning is also used to determine the importance score of the variable. The
due to its better generalization capability and robustness. It con- prediction error rate is computed on OOB samples for all deci-
i
structs an ensemble model of many unpruned decision trees from sion trees i (∀i = 1, 2, . . ., ). Then, the OOB samples are perturbed
M. Thakur, D. Kumar / Applied Soft Computing 67 (2018) 337–349 341
for each decision tree i to obtain the importance score of each fea- where is used as a regularization parameter such that ≥ 0.
ture fi . Again, the features are randomly permuted among the OOB Let,
samples and prediction error for the perturbed OOB samples
i
are recorded for each decision tree i . The importance score of a T
K
T
˛i = [ i ei ] [ i ei ] + I, ˇj = Cj [ j ej ] [ j ej ],
feature IS RF
f is given as follows:
j=1
1
IS RF
f = ( − ) (5)
i i ωi
i and zi = , the solution become:
bi
The features are sorted according to IS RF
f in descending order. Take
down that true features are significantly more informative than the ziT ˛i zi
minimize , (10)
noisy ones. zi =
/ 0 ziT ˇj zi
3.2. Weighted Multicategory GEPSVM where ˛i , ˇj ∈ R(n+1)×(n+1) . The optimization problem (10) takes the
form similar to a Rayleigh quotient problem and can be solved easily
Weighted multicategory generalized eigenvalue proximal sup- by solving following generalized eigenvalue problem:
port vector machine (WMGEPSVM) [34] is a multi-class classifier
which generates K nonparallel separating hyperplanes by using ˛i zi = i ˇj zi (11)
“One-Versus-All” (OVA) approach for all classes. Each plane is closer
Here, i is the smallest eigenvalue of (11) and zi is the correspond-
to its respective class and farthest from the other classes. To mini-
ing eigenvector. Plane Pi is determined by setting the optimal [ωi ,
mize the effect of unbalanced classes, WMGEPSVM uses the weight
bi ]T = zi in right hand side of Eq. (6) for ith class. By following a
factor which is determined by using a modified balancing tech-
similar procedure, all K planes (one plane for each class) can be
nique proposed in [34]. The data samples belonging to ith class i
generated. After getting (ωi , bi ), a new sample ∈ Rn can be clas-
are labeled as +1, and those from the rest of the class j = / i are
sified and assigned to class i having the closest distance to the
labeled as −1. The goal of WMGEPSVM is to determine the following
corresponding plane Pi of (6), i.e.,
non-parallel planes:
Fig. 3. ROR on 500 trading days testing data of different stock indices obtained by different trading systems without feature selection.
3.4. Training and parameter selection for training the classifier and feature pruning task, and subsequent
50 days of trading data is used for testing the performance of the
The proposed trading system is trained by diving the whole data proposed hybrid model. For the training and testing purpose in the
set into ten overlapping training-testing sets as depicted in Fig. 2. net window, the training data is shifted 50 days forward by adding
In this work, we use the walk forward (sliding window) testing next 50 days and removing first 50 day so that the training sample
approach which is extensively used in evaluating the performance size remain 1500 only. The testing is done on next 50 days. This
of time-series forecasting system [32,31]. For each data set, 1500 process is repeated 10 times. In this way, data of 500 consecutive
consecutive days of data is considered as the training set and is used trading days is used as testing data for testing the performance of
M. Thakur, D. Kumar / Applied Soft Computing 67 (2018) 337–349 343
Fig. 4. ROR on 500 trading days testing data of different stock indices obtained by different hybrid trading systems.
the proposed financial trading system. The training set is utilized as ization parameter of WGEPSVM is critical. Hence, optimal value of
input to the RF algorithm to rank all the input variables according is determined based on trade-offs between generalization ability
to their importance. Then, these variables are added iteratively to and forecasting accuracy. Regularization parameter is optimized
WGEPSVM according to their ranks, i.e., a feature with the high- by 5-fold Cross Validation (5-CV) method [24], [14], [43]. In 5-fold
est rank is added first and then the second highest rank feature is CV validation, training set is divided into five subsets (of equal size).
added, and so on. In the next step, WGEPSVM is trained with the One set is considered to be validation data and the remaining four
training set. During the training phase, the optimization of regular- subsets are considered for training. The value of the parameter
344 M. Thakur, D. Kumar / Applied Soft Computing 67 (2018) 337–349
Table 2
Experimental results on testing data of different stock indices obtained by BUY-HOLD, PSVM, BMPSVM, LSTSVM and WMGEPSVM (best results are shown in bold).
Fig. 5. Trading log (“ ”: BUY, “ ”: SELL) of DOW JONES for 500 trading days from December 23, 2013 to December 18, 2015 using RF-WMGEPSVM.
Fig. 6. Trading log (“ ”: BUY, “ ”: SELL) of NIFTY 50 for 500 trading days from November 12, 2013 to December 24, 2015 using RF-WMGEPSVM.
M. Thakur, D. Kumar / Applied Soft Computing 67 (2018) 337–349 345
Fig. 7. Trading log (“ ”: BUY, “ ”: SELL) of NIFTY BANK for 500 trading days from November 12, 2013 to December 24, 2015 using RF-WMGEPSVM.
Fig. 8. Trading log (“ ”: BUY, “ ”: SELL) of NASDAQ for 500 trading days from December 23, 2013 to December 18, 2015 using RF-WMGEPSVM.
with the maximum average validation accuracy is used as the final RAM and implemented in MATLAB. For the comparison under the
recommended value of . homogeneous environment, same experimental setup was used
to implement PSVM, RF-PSVM, BMPSVM, RF-BMPSVM, MLSTSVM
and RF-MLSTSVM techniques. The proposed trading system is first
4. Experiment and discussions
tested without applying feature pruning. The proposed trading
strategies are assessed on the basis of performance criteria (dis-
The pertinence and effectiveness of proposed RF-WGEPSVM
cussed in Section 2.1). Fig. 3 shows ROR of different all five index
trading system have been tested on five index future contract
future for 500 consecutive trading days (10 out of sample data sets
data, viz., Dow Jones, NASDAQ, S&P 500, Nifty 50 and Nifty Bank
of 50 trading days each). Each point on this plot represents ROR for
Index. This data set has been carefully chosen as it is the repre-
50 trading days.
sentative of major financial markets around the globe. The time
The ROR in fluctuant and range bound scenario for DOW JONES
period for the empirical study is also chosen in such a manner
future for 500 trading days is depicted in Fig. 3a, WMGEPSVM
that all the possible market scenarios are observed in the selected
achieved positive return in 7 out of 10 sample data sets with 24.46 %
duration. The data sets used to conduct the experiment are col-
ROR while the market yields is only about 1.75% with negative ROR
lected from Quandl (https://www.quandl.com) for the period from
in five testing sets among the ten out of sample data sets. The PSVM
January 2007 to December 2015. In this experiment, the total trans-
and BMPSVM based trading strategies are found to loose 18.96% and
action cost is set to 0.05% of the transaction. For expediency to
20.84%, respectively.
compare with other approaches all open positions are squared off
Fig. 3b and c shows the ROR in fluctuant and uptrend markets for
at the end of each trading period of 50 days. All numerical exper-
NIFTY 50 and NIFTY BANK for 500 trading days, respectively. Both
iments were performed on a computer with 2.5 GHz with 4 GB
346 M. Thakur, D. Kumar / Applied Soft Computing 67 (2018) 337–349
Fig. 9. Trading log (“ ”: BUY, “ ”: SELL) of S&P 500 for 500 trading days from May 23, 2013 to May 18, 2015 using RF-WMGEPSVM.
Table 3
Experimental results on testing data of different stock indices obtained by RF-PSVM, RF-BMPSVM, RF-LSTSVM and RF-WMGEPSVM (best results are shown in bold).
indices show positive growth in the first 300 days, but the growth fore, a trading system with a smaller MDD is considered a more
was negative between next 300 to 500 trading days. In such realis- reliable. The detailed statistical results are reported in Table 2.
tic market scenario, the proposed WMGEPSVM has shown 43.81% WMGEPSVM performs better than BUY-HOLD, PSVM, BMPSVM and
and 43.30% gain, respectively, while the market gains about 17.13% LSTSVM trading systems in terms of ROR, MDD and PP. The trad-
and 42.25% for NIFTY 50 and NIFTY BANK, respectively. It can be ing system using WMGEPSVM has achieved highest ROR for four
observed that WMGEPSVM is also able to make a profit while both out of five market indices. S&P 500 is the only indices for that the
indices lost in the 7th, 9th and 10th out of the sample test data set. market return is higher than WMEPSVM. The trading system with
PSVM, BMPSVM and LSTSVM trading strategies have also shown WMGEPSVM has lower MDD for four indices than other trading
positive ROR for both the indices. systems. NIFTY BANK is the only index future for which LSTSVM
For NASDAQ and S&P 500 index futures, the ROR in fluctuant and has the lowest MDD. WMEPSVM is also achieved the highest PP for
bull markets are plotted in Fig. 3d and e. The corresponding market NIFTY BANK, NASDAQ and S&P 500. It is interesting to note that
returns for these indices are about 17.69% and 22.65%, respectively. WMGEPSVM is the only trading system which is profitable for all
WMGEPSVM is having positive ROR in 9 out of 10 sample data sets five stock index futures. This is an indication of the fact that the
with 27.67% returns for NASDAQ data set. For S&P 500 future, the WMGEPSVM is capable of capturing the uptrend, downside and
proposed WMGEPSVM is also able to make positive ROR in 8 out range bound market trends scenarios with higher degree of success.
of 10 sample data sets with 18.30% profit. For S&P 500, it is also After analyzing the significant better performance of the proposed
noted that PSVM, BMPSVM, and LSTSVM based trading systems lost WMGEPSM using all the indicators, the experiment is extended to
15.09%, 31.57% and 12.32% respectively. make a hybrid trading system by amalgamating all four predictive
The other important measure used to evaluate the trading sys- algorithms with RF (named RF-PSVM, RF-BMPSVM, RF-MLSTSVM
tem is PP and MDD. A trading system with larger MDD would and RF-WMGEPSVM) algorithm. The results of hybrid Trading sys-
lead to investment deterioration since investors would lose money tems for all five stock indices on the same test data set (considered
as well as confidence in the performance of the strategy. There- in the first case) are depicted in Fig. 4.
M. Thakur, D. Kumar / Applied Soft Computing 67 (2018) 337–349 347
Fig. 10. Demonstrating performance improvement by applying RF with different prediction models on all five stock indices.
It is observed from Fig. 4 that all hybrid systems achieve higher Fig. 4b and c shows the ROR attained by all hybrid decision sup-
ROR on average as compared to BUY-HOLD strategy. Further- port systems considered in this study for fluctuant and uptrend
more, all multi-class methods (RF-BMPSVM, RF-MLSTSVM, and markets for NIFTY 50 and NIFTY BANK indices respectively. RF-
RF-WMGEPSVM) produced BUY/SELL/HOLD trading signals that WMGEPSVM shows the positive ROR in all ten out of sample sets
have shown better performance than RF-PSVM which is a “BUY- however, the market lost in three out of sample (7th, 9th and 10th)
SELL” trading system. test data set for both NIFTY 50 and NIFTY BANK indices.
The ROR acquired by all hybrid trading systems for DOW JONES The ROR for NASDAQ index is shown in Fig. 4d. The proposed
index are plotted in Fig. 4a. RF-WMGEPSVM has produced positive hybrid trading system using RF-WMGEPSVM gains positive return
ROR in all ten out of sample data sets while BUY-HOLD strategy lost in all ten out of sample data sets, while the market lost in five out
in five out of sample sets (second, forth, eighth, ninth and tenth). of sample sets (2nd, 4th, 8th, 9th and 10th testing phase).
It is also observed Fig. 4a that RF-WMGEPSVM has returned the Fig. 4e shows the ROR obtained by different hybrid trading sup-
highest profit (up to 41.72%) followed by RF-BMPSVM with ROR of port systems for S&P 500 index future. As in the case of NASDAQ
33.53% while BUY-HOLD strategy returns about 1.75%. index, RF-WMEPSVM has the positive return in all ten out of sam-
348 M. Thakur, D. Kumar / Applied Soft Computing 67 (2018) 337–349
ple sets, while the market lost in three out of sample sets (2nd, 7th of the proposed “BUY/SELL/HOLD” signals based trading systems
and 9th test sample set). (RF-WMGEPSVM, RF-PSVM, RF-BMPSVM, and RF-LSTSVM) as com-
For a visual illustration of the effectiveness of the RF- pared to the BUY-HOLD investment strategy and RF-PSVM based
WMGEPSVM based trading system, trading logs using the trading system. The proposed RF-WMGEPSVM based trading sys-
RF-WMGEPSVM are plotted for all five indices. In the trading log, tem is found to outperform all other trading systems based on other
Date is plotted on the X-axis and the bar chart of the index future classifiers considered in this study in terms of ROR, PP, and MDD in
value is plotted on Y-axis. A blue “ ” indicates that the proposed bull, bearish and sideways market scenario.
decision support system generates a BUY signal, and a red “ ” The results obtained in this study are promising and may be
indicates that a SELL signal is generated by the proposed decision useful for portfolio making in the financial market.
support system.
From Fig. 4a, it is clearly observed that the proposed RF-
WMGEPSVM based trading system outperforms other trading
References
system for all five market indices. The significance of the RF-
WMGEPSVM technique lies in the fact that it can capture the major [1] Y.S. Abu-Mostafa, A.F. Atiya, Introduction to financial forecasting, Appl. Intell.
change in the index movements, are shown in Figs. 5–9. 6 (3) (1996) 205–213.
The detailed statistical results for all hybrid trading systems are [2] G. Deboeck, Trading on the Edge: Neural, Genetic, and Fuzzy Systems for
Chaotic Financial Markets, vol. 39, John Wiley & Sons, 1994.
summarized in Table 3. The performances of trading systems have [3] S.C. Blank, “Chaos” in futures markets? A nonlinear dynamical analysis, J.
significantly improved by applying the RF technique in conjunction Futures Markets 11 (6) (1991) 711–728.
with various predictive methods. The experimental results indicate [4] C.-F. Tsai, Y.-C. Lin, D.C. Yen, Y.-M. Chen, Predicting stock returns by classifier
ensembles, Appl. Soft Comput. 11 (2) (2011) 2452–2459.
that RF-WMGEPSVM based trading system outperforms all other [5] L. Cao, F. Tay, Support vector machine with adaptive parameters in financial
trading systems in terms of ROR. The trading systems making use of time series forecasting, IEEE Trans. Neural Netw. 14 (6) (2003) 1506–1518.
RF-WMGEPSVM performs better as compared to BUY-HOLD, PSVM, [6] K. Hornik, M. Stinchcombe, H. White, Multilayer feedforward networks are
universal approximators, Neural Netw. 2 (5) (1989) 359–366.
BMPSVM, and MLSTSVM based trading systems on the basis of ROR, [7] S. Haykin, R. Lippmann, Neural networks, a comprehensive foundation, Int. J.
MDD, and PP. RF-WMGEPSVM has achieved the lowest MDD for 3 Neural Syst. 5 (4) (1994) 363–364.
out of 5 index future data sets, and achieved the highest PP for 3 out [8] L. Yu, S. Wang, K.K. Lai, A neural-network-based nonlinear metamodeling
approach to financial time series forecasting, Appl. Soft Comput. 9 (2) (2009)
of 5 index future data sets. The trading system with RF-MLSNHSVM
563–574.
is able to achieve the lowest MDD and the highest PP for 2 out of 5 [9] G. Grudnitski, L. Osburn, Forecasting S&P and gold futures prices: an
index future data sets. All hybrid trading systems are found to out- application of neural networks, J. Futures Markets 13 (6) (1993) 631–643.
[10] W. Leigh, R. Purvis, J.M. Ragusa, Forecasting the NYSE composite index with
perform the BUY-HOLD strategy, which indicates the superiority of
technical analysis, pattern recognizer, neural network, and genetic algorithm:
machine learning based trading systems over the naive BUY-HOLD a case study in romantic decision support, Decis. Support Syst. 32 (4) (2002)
investment strategy (refer Table 3). 361–377.
Finally, all four trading systems and their hybrid versions are [11] G.P. Zhang, An investigation of neural networks for linear time-series
forecasting, Comput. Oper. Res. 28 (12) (2001) 1183–1202.
compared in Fig. 10, on the basis of their respective ROR for all five [12] C. Cortes, V. Vapnik, Support-vector networks, Mach. Learn. 20 (3) (1995)
stock indices. From Fig. 10, it is noted that all the hybrid trading sys- 273–297.
tems perform significantly better than their non-hybrid versions. [13] V.N. Vapnik, V. Vapnik, Statistical Learning Theory, vol. 1, Wiley, New York,
1998.
Moreover, it also noted that all the hybrid trading system are able [14] L. Yu, H. Chen, S. Wang, K.K. Lai, Evolving least squares support vector
to achieve positive ROR in all five markets. This clearly indicates machines for stock market trend mining, IEEE Trans. Evol. Comput. 13 (1)
the reliability and superiority of hybrid trading system over the (2009) 87–102.
[15] W. Huang, Y. Nakamori, S.-Y. Wang, Forecasting stock market movement
non-hybrid systems. direction with support vector machine, Comput. Oper. Res. 32 (10) (2005)
2513–2522.
[16] K.-j. Kim, Financial time series forecasting using support vector machines,
Neurocomputing 55 (1) (2003) 307–319.
5. Conclusion
[17] D. Kumar, S.S. Meghwani, M. Thakur, Proximal support vector machine based
hybrid prediction models for trend forecasting in financial markets, J.
In this study, decision support systems for making the Comput. Sci. 17 (2016) 1–13.
[18] J. Patel, S. Shah, P. Thakkar, K. Kotecha, Predicting stock and stock price index
automated trading decision are proposed. For this purpose,
movement using trend deterministic data preparation and machine learning
WMGEPSVM algorithm is amalgamated with RF technique. The techniques, Expert Syst. Appl. 42 (1) (2015) 259–268.
trading rules have been constructed using a “Buy/Hold/Sell” sig- [19] C.-Y. Yeh, C.-W. Huang, S.-J. Lee, A multiple-kernel support vector regression
nal, which are received on daily close prices of the stock market. approach for stock market price forecasting, Expert Syst. Appl. 38 (3) (2011)
2177–2186.
The proposed trading systems are tested over 500 days daily data [20] Y. Pan, Z. Xiao, X. Wang, D. Yang, A multiple support vector machine approach
of DOW JONES, NIFTY 50, NIFTY BANK, NASDAQ, and S&P 500 index to stock index forecasting with mixed frequency sampling, Knowl. Based Syst.
futures. 122 (2017) 90–102.
[21] C.-F. Huang, A hybrid stock selection model using genetic algorithms and
The performance is evaluated on the basis of various perfor- support vector regression, Appl. Soft Comput. 12 (2) (2012) 807–818.
mance metrics, viz., ROR, PP and MDD ratio. The experimental [22] N. Verma, S. Das, N. Srivastava, Multiple kernel support vector regression for
results indicate that WMGEPSVM performs significantly better pricing nifty option, Int. J. Appl. Math. Res. 4 (4) (2015) 488–495.
[23] P.-C. Chang, J.-L. Wu, J.-J. Lin, A Takagi–Sugeno fuzzy model combined with a
than Buy-HOLD approach, PSVM, BMPVM and MLSTVM. This is due support vector regression for stock trading forecasting, Appl. Soft Comput. 38
to the fact that the classification of unbalanced data classes can (2016) 831–842.
be effectively handled by the WMGEPSVM. The input variable is [24] L. Cao, K. Chua, W. Chong, H. Lee, Q. Gu, A comparison of PCA, KPCA and ICA
for dimensionality reduction in support vector machine, Neurocomputing 55
some of the widely used technical indicators and oscillators in the
(1) (2003) 321–336.
financial market by experts. For the purpose of selecting more infor- [25] L.-J. Kao, C.-C. Chiu, C.-J. Lu, J.-L. Yang, Integration of nonlinear independent
mative indicators, RF technique is used. Use of RF technique has component analysis and support vector regression for stock price forecasting,
Neurocomputing 99 (2013) 534–542.
demonstrated notable improvements on the overall performance
[26] M.-C. Lee, Using support vector machine with a hybrid feature selection
of all predictive methods (without using feature pruning). method to the stock trend prediction, Expert Syst. Appl. 36 (8) (2009)
After applying RF technique, it is observed that dimensional- 10896–10904.
ity reduction not only reduces the computational complexity of [27] R. Tsaih, Y. Hsu, C.C. Lai, Forecasting S&P 500 stock index futures with a hybrid
AI system, Decis. Support Syst. 23 (2) (1998) 161–174.
the models but also improves the performance of the financial [28] N. Baba, N. Inoue, Y. Yanjun, Utilization of soft computing techniques for
trading systems. Empirical findings also suggest the superiority constructing reliable decision support systems for dealing stocks, in:
M. Thakur, D. Kumar / Applied Soft Computing 67 (2018) 337–349 349
Proceedings of the 2002 International Joint Conference on Neural Networks, [37] J.D. Schwager, A Complete Guide to the Futures Markets: Fundamental
2002, IJCNN’02, vol. 3, IEEE, 2002, pp. 2150–2155. Analysis, Technical Analysis, Trading, Spreads, and Options, John Wiley &
[29] S.S. Alexander, Price movements in speculative markets: trends or random Sons, 1984.
walks, Ind. Manag. Rev. (pre-1986) 2 (2) (1961) 7. [38] R. Rhea, The Dow Theory: An Explanation of Its Development and an Attempt
[30] R. Hudson, M. Dempsey, K. Keasey, A note on the weak form efficiency of to Define Its Usefulness as an Aid in Speculation, Fraser Publishing Company,
capital markets: the application of simple technical trading rules to UK stock 1993.
prices – 1935 to 1994, J. Bank. Finance 20 (6) (1996) 1121–1132. [39] J.J. Murphy, Technical Analysis of the Financial Markets: A Comprehensive
[31] Y.-K. Kwon, B.-R. Moon, A hybrid neurogenetic approach for stock forecasting, Guide to Trading Methods and Applications, Penguin, 1999.
IEEE Trans. Neural Netw. 18 (3) (2007) 851–864. [40] M.J. Pring, Technical Analysis Explained: The Successful Investor’s Guide to
[32] Q. Wen, Z. Yang, Y. Song, P. Jia, Automatic stock decision support system based Spotting Investment Trends and Turning Points, McGraw-Hill Professional,
on box theory and SVM algorithm, Expert Syst. Appl. 37 (2) (2010) 1015–1022. 2002.
[33] A. Smola, V. Vapnik, Support vector regression machines Advances in Neural [41] L. Breiman, Random forests, Mach. Learn. 45 (1) (2001) 5–32.
Information Processing Systems, vol. 9, 1997, pp. 155–161. [42] C.-L. Huang, C.-Y. Tsai, A hybrid SOFM–SVR with a filter-based feature
[34] D. Kumar, M. Thakur, Weighted multicategory nonparallel planes SVM selection for stock market forecasting, Expert Syst. Appl. 36 (2 Pt 1) (2009)
classifiers, Neurocomputing 211 (2016) 106–116. 1529–1539.
[35] G.M. Fung, O.L. Mangasarian, Multicategory proximal support vector machine [43] T. Hastie, R. Tibshirani, J. Friedman, T. Hastie, J. Friedman, R. Tibshirani, The
classifiers, Mach. Learn. 59 (1–2) (2005) 77–97. Elements of Statistical Learning, vol. 2, Springer, 2009.
[36] D. Tomar, S. Agarwal, A comparison on multi-class classification methods
based on least squares twin support vector machine, Knowl. Based Syst. 81
(2015) 131–147.