Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

Pattern Recognition Letters 147 (2021) 124–133

Contents lists available at ScienceDirect

Pattern Recognition Letters


journal homepage: www.elsevier.com/locate/patrec

Hybrid models for intraday stock price forecasting based on artificial


neural networks and metaheuristic algorithmsR
Kumar Chandar S
School of Business & Management, CHRIST (Deemed to be University), Bangalore, India

a r t i c l e i n f o a b s t r a c t

Article history: Stock market prediction is one of the critical issues in fiscal market. It is important issue for the traders
Received 14 August 2020 and investors. Artificial Neural Networks (ANNs) associated with nature inspired algorithms are play-
Revised 18 March 2021
ing an increasingly vital role in many areas including medical field, security systems and stock market.
Accepted 24 March 2021
Several prediction models have been developed by researchers to forecast stock market trend. However,
Available online 20 April 2021
few studies have focused on improving stock market prediction accuracy especially when utilizing ar-
Keywords: tificial neural networks to perform the analysis. This paper proposed nine new integrated models for
Artificial bee colony algorithm forecasting intraday stock price based on the potential of three ANNs, Back Propagation Neural Network
Artificial neural network (BPNN), Radial Basis Function Neural Network (RBFNN), Time Delay Neural Network (TDNN) and nature
Genetic algorithm inspired algorithms such as Genetic Algorithm (GA), Particle Swarm Optimization (PSO) and Artificial Bee
Hit rate Colony (ABC).The developed models were named as GA-BPNN, PSO-BPNN, ABC-BPNN, GA-RBFNN, PSO-
Intraday stock prediction
RBFNN, ABC-RBFNN, GA-TDNN, PSO-TDNN and ABC-TDNN. Nature inspired algorithms are employed for
Nature inspired algorithm
Stock market prediction
optimizing the parameters of ANNs. Technical indicators calculated from historical data are fed as input
to developed models. Proposed hybrid models validated on four datasets representing different sectors in
NSE. Four statistical metrics, Root Mean Square Error (RMSE), Hit Rate (HR), Error Rate (ER) and predic-
tion accuracy were utilized to gauge the performance of the developed models. Results proved that the
PSO-BPNN model yielded the highest prediction accuracy in estimating intraday stock price. The other
models, GA-BPNN, ABC-BPNN, GA-RBFNN, PSO-RBFNN, ABC-RBFNN, GA-TDNN, PSO-TDNN and ABC-TDNN
produced lower performance with mean prediction accuracy of 97.24%, 98.37%, 84.01%, 85.15%, 84.01%,
83.87%, 89.95% and 78.61% respectively.
© 2021 Elsevier B.V. All rights reserved.

1. Introduction non-parametric and volatile [11]. Several research studies reported


in the literature used technical indicators to forecast future behav-
Time series forecasting is a highly challenging task and has ior of stock price because of their simplicity. Recently, Computa-
caught more attention from the researchers over the past years. tional Intelligence (CI) techniques such as Artificial Neural Network
Time series forecasting has a wide variety of applications including (ANN), Fuzzy and nature inspired algorithms have been adopted to
stock market, traffic control, electricity forecasting, weather and forecast the stock price due to their abilities to handle noise data
sunspot. Stock market is a public market for people to invest for in financial market [2]. Technical indicators were successfully used
trading shares of listed companies. It has a greater impact on econ- with CI techniques ANN [1], Support Vector Machine (SVM) [8] and
omy because it provides a path to gain high profits for the in- Radial Basis Function (RBF) [3] to forecast the stock price.
vestors, trades and companies of a country [15]. Stock price pre- Fadlalla and Amani [6] combined technical indicators and ANN
diction has been a hot and interesting topic of research in financial to predict the movement of Qatar Exchange (QE) index during the
world and it has gained more attention in recent years. Financial period of January 2010 to December 2012. Ten technical indica-
market is an attractive field for investment in order to gain high tors were computed from past data and used as input to Multi-
profits. Gaining high profit in stock market is not an easy task and layer perception. Results proved that WMA and SMA are the im-
lot of risk is involved in financial market. This is because of the portant indicators in forecasting QE index and ADO is the least im-
nature of stock data such as dynamic, non-linear, non-stationary, portant indicator. However, this model needs more time for train-
ing. Hegazy et al. [9] presented a comparative study between five
R
nature inspired algorithms, Bat Algorithm (BA), Modified Cuckoo
Editor: Maria De Marsico
E-mail address: kumar.chandar@christuniversity.in
Search (MCS), Flower Pollination Algorithm (FPA), Particle Swarm

https://doi.org/10.1016/j.patrec.2021.03.030
0167-8655/© 2021 Elsevier B.V. All rights reserved.
K.C. S Pattern Recognition Letters 147 (2021) 124–133

Table 1
A summary of recent studies on stock prediction.

Contributors Year Input variables Model

Chen and Kao 2013 Slope of one-day and two-days variations PSO-SVM-fuzzy
Fasdlalla and Amani 2014 Ten technical indicators MLP
Xiong et al. 2014 Lowest and highest price FA-SVR
Hegazy et al. 2015 Six technical indicators FPA-LS-SVM
Hafezi et al. 2015 Daily statistics BAT-ANN
Khuat et al. 2016 Closing price WT-ANN-DABC
Pyo et al. 2017 Ten technical indicators ANN and SVM
Dinh et al. 2018 Volume and price SVM
Shah et al. 2018 Open, high, close and low price QGGABC-FFNN

Optimization (PSO) and Artificial Bee Colony (ABC) for tuning pa-
rameters of Least Square SVM (LS-SVM) in estimating future move-
ment of market. Six technical indicators such as Price Momentum
Oscillator (PMO), Relative Strength Index (RSI), Money Flow Index
(MFI), Exponential Moving Average (EMA) and Stochastic Oscilla-
tor (SO) are computed from historical data and used as input to
LS-SVM. Result showed that FPA-LS-SVM model achieved lowest
error rate than other models. Chen and Kao [4] presented a hy-
brid model using PSO, SVM and fuzzy time series for stock mar-
ket prediction. Result showed that the PSO-SVM model provided
better performance than earlier models. Xiong et al. [18] offered
a hybrid model by combining Firefly Algorithm (FA) and multi-
ple outputs Support Vector Regression (SVR). The developed model
was validated on S &P 500, FTSE 100 and the Nikkei 225.Simu-
lation results indicated that the method offered the potential to Fig. 1. Back propagation neural network.

forecast the stock market. Another hybrid model was developed by


Hafezi et al. [7]. The authors used Bat algorithm and ANN for de- This paper is structured as follows: Section-2 explains the
veloping their model. Prediction ability of the model was analyzed proposed hybrid models. Section-3 provides the numerical out-
by using fundamental and technical information. Results demon- comes and compares the performance of the proposed models.
strated that the proposed models functioned better than Gated Section 4 summarizes the findings and provides suggestions for fu-
Recurrent Neural Network (GRNN). Khuat et al. [10] proposed a ture enhancement.
method for stock price forecasting which based on ANN, Wavelet
Transform (WT) and Directional ABC (DABC). Wavelet transform 2. Preliminaries
used as a preprocessing tool. DABC employed for optimization and
ANN performed the forecasting task. Result showed improved pre- In this research work, nine hybrid models by combining ANN
diction accuracy. Pyo et al. [13] examined the behavior of stock and metaheuristic algorithms are developed to predict intraday
market using ANN and SVM. Efficacies of the models are tested on price of stock market. This section provides brief introduction
KOSPI 200 stock. The result was satisfactory. Shah et al. [17] de- about the selected networks and metaheuristic algorithms.
veloped a fusion model by integrating Quick Gbest Guided ABC
(QGGABC) and Feed Forward Neural Network (FFNN), named as 2.1. Back propagation neural network
QGGABC-FFNN. The outcomes showed that the proposed model
outperforms the conventional models. Dinh and Kwon [5] investi- BPNN is one type of feed forward, supervised learning network
gated the strength of SVM. They used volume and price as the in- and it has an input layer, multiple hidden layers and an output
put variables to SVM. The results demonstrated that SVM improved layer. A simple structure of BPNN is evinced in Fig. 1. Input layer
the prediction accuracy and suitable for stock market prediction. receives input signal form the source and propagates it to all hid-
A summary of reviewed papers on stock prediction is provided in den neurons in the hidden layer. Hidden layer sums weights input
Table 1. signals and apply activation function to compute output. Output
All the former investigations focused on using CI techniques layer sums signals received from all the hidden layers and apply
and technical indicators to forecast the stock market trend. In activation function to calculate corresponding output. Let the in-
many cases, ANNs suffer from some limitations like local minima, put signal x=x1 , x2 , …, xN . The output of the hidden layer can be
slow convergence, long training time and over fitting problem due expressed as,
 
to a greater number of parameters to tune. Most of the researchers 
N
have not concentrated to solve these issues. Therefore, the main fo- hi = f xi wi + b (1)
cus of this paper is to develop a forecasting model that integrates i=1
ANN and nature inspired algorithm to investigate the aforemen- Similarly, the output of the output layer can be defined as,
tioned issues and also to improve the prediction accuracy. Three    
ANNs namely Back Propagation Neural Network (BPNN), Radial Ba- 
N 
N
yk = f wj f xi wi + b (2)
sis Function Neural Network (RBFNN), Time Delay Neural Network
j=1 i=1
(TDNN) and nature inspired algorithms such as Genetic Algorithm
(GA), Particle Swarm Optimization (PSO) and Artificial Bee Colony Where, Where, hi is the output of the ith hidden neuron, f(.) is
(ABC) are considered. They are named as GA-BPNN, PSO-BPNN and the activation function, w and b are weight and bias respectively.
ABC-BPNN. A comparative study also has done in order to find Wi is the weight between input and hidden layer and wj is the
suitable model. weight between hidden and output layer.

125
K.C. S Pattern Recognition Letters 147 (2021) 124–133

Fig. 2. Radial basis function neural network.

2.2. Radial basis function neural network

RBFNN is a supervised network and it composed of input layer,


one hidden layer and output layer. General architecture of RBFNN
is depicted in Fig. 2. Input layer accepts signal from the source and
passes to the hidden layer. Hidden layer generates output corre-
sponding to an input signal in the input layer. The output of the
RBFNN is the linear combination of the hidden units signal and Fig. 3. Flowchart of GA.

given in Eq. (3).



f (x ) = wi h j ( x ) (3)

 2
h j (x ) = exp(− x − c j /r 2j (4)
Where cj is center of a region and rj is width of the receptive
field.

2.3. Time delay neural network

TDNN can be referred as FFNN, except that the input weight has
a delay element associated with it. Let the input signal x=[x(t), x(t-
1),…x(t-q)].The net input signal can be expressed as,

q
neti = wi, j x(n − p) + b (5)
p=0

The output of the TDNN can be represented as,


 

q
y(n ) = w j,k f wi, j x(n − p) + b (6)
p=0

Where, f is the activation function, b is the bias, wij represents


the weight between input and hidden layer, q denotes the tapped
delays and wjk represents the weight between hidden and output
layer.
Fig. 4. Flowchart of PSO.
2.4. Genetic algorithm

A GA is search heuristic algorithm that is inspired by Charles


Darwin’s theory of natural evolution. This algorithm reflects the 2.5. Particle swarm optimization
process of natural evolution where the fittest individuals are se-
lected for reproduction to generate offspring of the next genera- PSO is a population based stochastic optimization technique,
tion. Five major processes of GA are initial population, fitness evo- which is based on simulating the social behavior of swarm of bird
lution, selection, crossover and mutation. The process starts with flocking and fish schooling. By randomly initializing the algorithm
a set of individuals called population. Fitness functions assess the with candidate solutions, the PSO successfully leads to a global op-
capability of each individual to solve the problem, and this is per- timum. This is achieved by an iterative procedure based on the
formed after every generation in the reproduction process. Selec- processes of movement and intelligence in an evolutionary system.
tion process chooses the fittest individuals and let them pass their Flow chart of a PSO algorithm is shown in Fig. 4. In PSO, each so-
genes to the next generation. Crossover is an essential process. lution is represented as a particle. Initial position, x and velocity, v
For each pair of parents to be mated, crossover point is chosen of particle represented as, x = x1 , x2 ,…xN v = v1 , v2 ,…vN
at random. Mutation process is used to maintain diversity within In each iteration, fitness function is estimated for all the par-
the population and avoid premature problem. Fig. 3 shows the ticles in the swarm. The velocity and position of each particle is
flowchart of GA. updated based on p-best and g-best value. Each particle’s velocity

126
K.C. S Pattern Recognition Letters 147 (2021) 124–133

Fig. 6. General Framework of the developed hybrid models.

Fig. 5. Flowchart of ABC.

to be employed in the prediction of intraday stock price. Finan-


and position updated as follows: cial technical indicators are computed from past data (historical
prices) instead of fundamental analysis of the trade. There a num-
v(t + 1) = w.v + c1 r1 ( pbest − x ) + c2 r2 (gbest − x ) (7) ber of technical indicators in the market that can be utilized to
show the trend of the stock market. After reviewing of the previ-
x(t + 1 ) = x(t ) + v(t + 1 ) (8) ous published papers, this paper selected technical indicators that
have an important role in the stock market forecasting. Table 2 lists
Where, w is the inertia, r1 and r2 are random numbers; c1 and the chosen technical indicators along with their formula.
c2 are self-recognition and social coefficient. After the calculations of the selected technical indicators tab-
ulated in Table 2, they have been subjected to normalization to
2.6. Artificial bee colony algorithm make the data range between 0 and 1. Historical data are vulnera-
ble to noise and quality of the stock data affects the performance
ABC algorithm is a form swarm intelligence algorithm and of the ANNs. Since this research work uses different stock data and
mimics the natural behavior of honey bees in food foraging. In ANNs, it is necessary to bring all stock data into a common range.
ABC, the colony of artificial bees has three groups: (i) employed Normalization is done using max min method, as given in Eq. (9).
bees, (ii) onlookers and (iii) scouts. A bee going to the food source
visited by itself previously called as employed bee. Onlooker bee is X − Xmin
a bee waiting on the dance area for making decision to choose a Xnorm = ( hi − li ) (9)
Xmax − Xmin
food source and a bee carrying out random search is called a scout.
Flowchart of ABC is evinced in Fig. 5. Where, Xnorm is the normalized value of X, X is the actual value,
Xmin is the minimum value, Xmax is the maximum value, hi is the
3. Proposed methodology upper bound of the normalizing interval (in this case 1) and li is
the lower bound of the normalizing interval (in this case 0). Subse-
Previous researchers have utilized fundamental analysis, techni- quently, after the normalized data taken as feature vectors and fed
cal analysis and statistical models to forecast stock market. How- as input to the developed models. There is no general algorithm or
ever, fundamental and technical analysis is widely used to forecast guidelines for designing ANNs.
stock market. Fundamental analysis concentrates on the forces of In this research work, BPNN is designed with an input layer,
supply and demand while technical analysis concentrates on the two hidden layers with 25 hidden neurons and an output layer
movement of market. Several earlier works aiming to contribute with a neuron corresponding to intraday predicted price. Number
in stock market prediction using technical analysis. From the re- of input neurons is equals to the number of technical indicators.
viewed papers, it is well known that neither ANN nor nature in- Tangent sigmoidal and linear transfer function is utilized at the
spired algorithms can alone predict the stock price precisely. In hidden layer and an output later respectively. Similarly, TDNN is
case of employing single ANN or nature inspired algorithm, per- designed with an input layer, a hidden layer with 25 hidden neu-
formance is superior to conventional models in terms of prediction rons and an output layer. RBFNN is designed with an input layer
accuracy [1,2]. However, intraday stock price prediction, there is no and an output layer. Though ANN is a promising tool for forecast-
single ANN or nature inspired algorithm that provide better result. ing stock price, optimizing the parameters (weights and bias) of
Because of these reasons, this paper proposes nine fusion models ANN is a very difficult and time-consuming task. To address such
that integrate ANN and nature inspired algorithms. Fig. 6 illustrates an issue, this research work uses nature inspired (bio inspired)
that the main processes of this proposed models. The developed algorithms to optimize the parameters of ANNs. During training
hybrid stock predictive models are based on the study of technical phase, the nature inspired algorithm, GA, PSO and ABC is applied
indicators and optimizing ANNs with nature inspired algorithms to tune the parameters of BPNN separately. At testing phase, the

127
K.C. S Pattern Recognition Letters 147 (2021) 124–133

Table 2
Selected technical indicators.

Technical indicators Formula


t
1
Simple Moving Average (SMA) SMAt = t
Ci
i=1
Exponential Moving Average (EMA) K(Ct − EMA(t − 1 ) ) + EMA(t − 1 ); K = 2
1+n
100 EMA (U,n )
Relative Strength Index (RSI) RSI = 100 − 1+ RS
; RS = EMA (D,N )
U = Ct − Ct−1 D = 0
D = Ct−1 − Ct U = 0
Moving Average Convergence/Divergence (MACD) MACD = EMA(12 ) − EMA(26 )
Signal = EMA(MACD, 9 )
Histogram = MACD − Signal
l (n )
Stochastic %K %K = 100 CCt −C
h (n )−CL
Stochastic %D %D = EMA(%K, 3 )
Momentum Price(t ) − Price(t − n )
Price (t )
Rate of Change (ROC) ( Price (t−n ) ) ∗ 100
Ht −Ct−1
Accumulation/Distribution Oscillator (ADO) Ht −Lt
William’s R % ( HHtt −Ct
−Lt
) ∗ 100
H-Highest price, C-Closing price, L-Lowest price.

Table 3
Stock data consisting of two months data from 1st January 2018 to 28th February 2018, with one-minute sample rate. Total
number of samples is 16208.

Stock name Stock ID Sector Period Data samples

State Bank of India SBIN.NS Bank 01/01/2018-28/02/2018 16208


National Thermal Power Corporation NTPC.NS Energy 01/01/2018-28/02/2018 16208
Tata steel limited TATASTEEL.NS Steel & Iron 01/01/2018-28/02/2018 16208
Infosys limited INFY.NS IT 01/01/2018-28/02/2018 16208

optimized network is implemented to forecast the intraday stock Table 4


GA parameters.
price. Similarly, at training phase, GA, PSO and ABC are applied to
optimize the parameters of RBFNN and TDNN separately. At test- Parameters Value
ing phase, the optimized RBFNN and TDNN applied to forecast the Swarm size 30
intraday stock price. Cross over 0.6
Mutation 0.3
Iteration 500

4. Experimental results and discussions

This section presents the simulation results of the developed Table 5


PSO parameters.
nine hybrid models such as GA-BPNN, PSO-BPNN, ABC-BPNN, GA-
RBFNN, PSO-RBFNN, ABC-RBFNN, GA-TDNN, PSO-TDNN and ABC- Parameters Value
TDNN used for forecasting intraday stock price. All the nine hybrid Swarm size 30
models share the common features of forecasting intraday price of Self-recognition coefficient, c1 1.4
stocks. Prediction accuracy of the developed models is analyzed by Social coefficient, c2 2.7
varying number of training and testing samples. Inertia weight, w 0.1 -0.9
Iteration 500

4.1. Details of data set


Table 6
ABC parameters.
In this research, nine hybrid models are developed by integrat-
ing ANNs and nature inspired algorithms and utilized to predict Parameters Value
the intraday stock price. To investigate the effectiveness of the de- Swarm size 30
veloped hybrid models, historical data of four stocks representing Number of employed bees 50% of the swarm
different sectors are considered. Each sample consists of opening Number of onlooker bees 50% of the swarm
Iteration 500
price, highest price, lowest price and closing price. Details of the
selected stocks, sectors and number of samples are provided in
Table 3.
Three networks such as BPNN, RBFNN and TDNN are used to
predict next minute stock price. Parameters of the ANNs are usu- 4.2. Performance indices
ally tuned by training process, which requires more time. To ad-
dress such an issue, metaheuristic algorithms are adopted to op- To evaluate the superiority of the developed hybrid models, GA-
timize the parameters of the selected networks. Three algorithms BPNN, PSO-BPNN, ABC-BPNN, GA-RBFNN, PSO-RBFNN, ABC-RBFNN,
such as GA, PSO and ABC are separately used to tune the parame- GA-TDNN, PSO-TDNN and ABC-TDNN, Root Mean Square Error
ters of the selected networks. Simulation parameters used for im- (RMSE), Hit Rate (HT), Error Rate (ER) and prediction accuracy are
plementation of GA, PSO and ABC are summarized in Tables 4–6 used as indices of the model’s performance. The formula for the
respectively. above-mentioned indices is given in Eqs. (10)–(12)

128
K.C. S Pattern Recognition Letters 147 (2021) 124–133

Fig. 7. Prediction results based on 80-20%. (a) RMSE (b) HR (c) ER (d) Prediction
accuracy.
Fig. 8. Prediction results based on 70-30%. (a) RMSE. (b) HR. (c) ER. (d) Prediction
accuracy.

1
N
RMSE = (|Ak − Pk | )2 (10) 1
N
N Er ror rate = Ak = Pk (12)
k=1
N
k=1

1
N
Hitrate = Ak = Pk (11) Where, N denotes total number of samples, A indicates the ac-
N tual price and P represents the predicted price.
k=1

129
K.C. S Pattern Recognition Letters 147 (2021) 124–133

Fig. 9. Prediction results based on 60-40%. (a) RMSE. (b) HR. (c) ER. (d) Prediction Fig. 10. Prediction results based on 50-50%. (a) RMSE. (b) HR. (c) ER. (d) Prediction
accuracy. accuracy.

4.3. Performance evaluation and comparison in order to analyze the prediction ability of the developed hybrid
models. In the first experiment, 80% of the samples were selected
This research used stock data of two months of selected stocks to develop the models and remaining 20% of the samples were
from January 2018 to February 2018. Before predicting intraday used for testing. In the second experiment, 70% and 20 % of the
stock price by the offered models, the entire dataset is divided into samples were used for training the models and testing the mod-
two sets, i.e. training and testing. Four experiments are conducted els respectively. In the third experiment, 60% of the samples were

130
K.C. S Pattern Recognition Letters 147 (2021) 124–133

Fig. 11. Actual versus predicted values of SBI data. (a) The outcome of the developed models based on 80-20%. (b) The outcome of the developed models based on 70-30%.
(c) The outcome of the developed models based on 60-40%. (d) The outcome of the developed models based on 50-50%.

used for training the models and 40% were used for testing the (0.052 and 83%), (0.049 and 96.13%), (0.337 and 70%), (0.028
models. In the fourth experiment, 50% of the samples were used and 94.07%), (0.088 and 93.19%) and (0.083 and 94.07%) re-
for training and remaining 50% of the samples were used for val- spectively. The hybrid model PSO-BPNN yielded lower ER and
idating the models. Figs. 7–10 graphically presents intraday stock higher HR. From the Fig. 7, it is observed that the hybrid model
price forecasting by developed hybrid models and their statistical PSO-BPNN provided outstanding performance in almost all the
metrics. stocks.
According to Fig. 7 and based on first experiment (80% training Fig. 8 illustrates the performance of the developed models in
and 20% testing), for NTPC, PSO-BPNN achieved lowest RMSE value terms of RMSE, HR, ER and prediction accuracy. In this experiment,
of 0.027 and highest prediction accuracy of 98.87 % than other hy- 70% of the samples are used for model developing and remaining
brid models. GA-BPNN, ABC-BPNN, GA-RBFNN, PSO-RBFNN, ABC- 30% samples are used for testing. From the Fig. 8, it is noticed that
RBFNN, GA-TDNN, PSO-TDNN and ABC-TDNN achieved RMSE and the PSO-BPNN model (SBI stock) achieved lowest error with RMSE
prediction accuracy value of (0.058 and 96.92%), (0.052 and 96%), of 0.012 and ER of 0.018 respectively. It is also observed that PSO-

131
K.C. S Pattern Recognition Letters 147 (2021) 124–133

Fig. 11. Continued

BPNN provided dominant performance with a prediction accuracy models with respect to performance indices in almost all the
of 99.38 % and HR of 0.981. stocks.
Based on 60% training and 40% testing outcomes depicted Fig. 10 demonstrates the efficacy of the developed models
in Fig. 9, for NTPC stock, GA-BPNN, PSO-BPNN, ABC-BPNN, GA- for the data division of 50% training and 50% testing samples.
RBFNN, PSO-RBFNN, ABC-RBFNN, GA-TDNN, PSO-TDNN and ABC- As in Fig. 10, it is observed that the PSO-BPNN model yielded
TDNN yielded RMSE value of 0.016, 0.012, 0.026, 0.026, 0.007, highest performance is forecasting intraday stock price. For an
0.091, 0.034, 0.11 and 0.103 respectively. For HR and ER, the val- instance, INFOSYS stock, GA-BPNN, PSO-BPNN, ABC-BPNN, GA-
ues are 0.995 and 0.004, 0.983 and 0.017, 0.99 and 0.009, 0.799 RBFNN, PSO-RBFNN, ABC-RBFNN, GA-TDNN, PSO-TDNN and ABC-
and 0.2, 0.996 and 0.009, 0.914 and 0.085, 0.934 and 0.065, 0.899 TDNN yielded RMSE,HR and ER values are (0.021, 0.982 and 0.017),
and 0.1 and 0.923 and 0.07. For prediction accuracy, the values (0.0 09, 0.999 and 0.0 01), (0.03, 0.987 and 0.128), (0.584, 0.633 and
are 99.1%, 99.33%, 98.04%, 82.88%, 99.97%, 95.35%, 92.17%, 93% and 0.367), (0.534, 0.666 and 0.333), (0.521, 0.689 and 0.311), (0.632,
93.15%. From the results, it is revealed that the performance of 0.567 and 0.433), (0.83, 0.588 and 0.411) and (0.619, 0.736 and
PSO-RBFNN provides outstanding performance compared to other 0.263).

132
K.C. S Pattern Recognition Letters 147 (2021) 124–133

focused on developing stock forecasting using ANN and technical


indicators, there is a still need to investigate these approaches in
order to enhance prediction accuracy and reduce the computation
time. In recent years, bio inspired algorithms employed for opti-
mizing the parameters of ANN which resulted in improved per-
formance. Research studied proved that hybrid model (ANN and
nature inspired algorithm) showed outstanding performance when
compared with standard ANN. This research developed nine hy-
brid models by combining ANN and metaheuristic algorithms for
forecasting intra-day stock price, i.e., GA-BPNN, PSO-BPNN, ABC-
BPNN, GA-RBFNN, PSO-RBFNN, ABC-RBFNN, GA-TDNN, PSO-TDNN
and ABC-TDNN. Performance of the developed models are analyzed
by varying training and testing samples and compared. From the
empirical findings, it is observed that the nature inspired algo-
rithms performed well in tuning the parameters of selected ANN.
Experimental results proved that the PSO-BPNN model provides
Fig. 12. Efficacy comparison in terms of prediction accuracy. promising result in almost all the stock compared to other hybrid
models as well as earlier models considered for comparison. The
remaining models provided satisfactory results. From the obtained
For prediction accuracy, the values are 98.58%, 99.31%, 97.56%, results, it is concluded that hybrid model can accurately predict
60%, 65.46%, 68.9%, 50%, 48% and 57.4%. From the Figs. 7–10, it the intraday stock price.
is evident that PSO-BPNN achieved lowest RMSE and ER with lit-
tle over other hybrid models in almost all the stocks. The weakest Declaration of Competing Interest
hybrid models in this research are GA-TDNN, PSO-TDNN and ABC-
TDNN (TATA stock) with a prediction accuracy of 52.75%, 54.67% None.
and 52.05%.
To demonstrate the performance of the developed hybrid mod- References
els, predicted values are plotted against observed values for SBI
[1] G.S. Atsalakis, K.P. Valavanis, Surveying stock market forecasting techniques–
stock data. Fig. 11 graphically illustrates the predicted values gener-
Part II: soft computing methods, Expert Syst. Appl. 36 (2009) 5932–5941.
ated by GA-BPNN, PSO-BPNN, ABC-BPNN, GA-RBFNN, PSO-RBFNN, [2] K.S. Chandar, Soft computing and bio-inspired computing techniques for stock
ABC-RBFNN, GA-TDNN, PSO-TDNN and ABC-TDNN against observed market prediction-a comprehensive survey, Int. J. Eng. Technol. 7 (3) (2018)
values. From the Fig. 11, it is found that the predicted curve us- 1836–1845.
[3] S.K. Chandar, H. Punjabi, Intraday stock price prediction of state bank of India
ing PSO-BPNN is closer to observer values which indicate higher using soft computing models, Indian J. Econ. Bus. 18 (2019) 79–89.
prediction accuracy. Simulation results showed consistent perfor- [4] S.M. Chen, P.Y. Kao, Forecasting the TAIEX based on fuzzy time series, in: A. Se-
mance of PSO-BPNN compared to other hybrid models. lamat, N.T. Nguyen, H. Haron (Eds.), PSO Techniques and Support Vector Ma-
chines, Intel. Info. and Database Syst. Lecture Notes in Comp. Sci., Springer
This research also conducted an experiment to compare the publications, Berlin, Heidelberg, 2013, p. 7802.
outcomes between the developed hybrid models which predict in- [5] T.A. Dinh, Y.K. Kwon, in: An Empirical Study on Importance of Modeling Pa-
traday stock price based on technical indicators and other models rameters and Trading Volume-Based Features in Daily Stock Trading Using
Neural Networks. in Informatics, Multidisciplinary Digital Publishing Institute,
including standard ANN model, hybrid models of GARCH-ANN in Basel, Switzerland, 2018, p. 36.
Lahimiri and Boukadoum [12], GA-ANN in Qiu and Song [14] and [6] A. Fadlalla, F. Amani, Predicting next trading day closing price of Qatar ex-
ANN in Selvamuthu et al. [16]. Lahimiri and Boukadoum [12] com- change index using technical indicators and artificial neural networks, Intel.
Syst. Accounts. Financ. Mgmt. 21 (2014) 209–223.
bined GARCH and ANN to predict the intraday stock price. Predic-
[7] R. Hafezi, J. Shahrabi, E. Hadavandi, A bat-neural network multi-agent system
tion ability the proposed model was analyzed by using two-week (BNNMAS) for stock price prediction: case study of DAX stock price, Appl. Soft
of the S&P 500-index from Feb 28, 2011 to Mar 11, 2011, with one- Comput. 29 (2015) 196–210.
[8] O. Hegazy, O.S. Soliman, M.A. Salam, A machine learning model for stock mar-
minute sample rate and five-minute sample rate. Qiu and Song
ket prediction, Int. J. Comp. Sci. Telecommun. 4 (12) (2013) 17–23.
[14] proposed a hybrid method to improve the prediction accuracy. [9] O. Hegazy, O.S. Soliman, M.A. Salam, Comparative study between FPA, BA, MCS,
In this method, set of technical indicators such as ROC, William’s ABC, and PSO algorithms in training and optimizing of LS-SVM for stock mar-
R, stochastic %K, stochastic %D, momentum, RSI, On Balance Vol- ket prediction, Int. J. Adv. Comp. Res. 5 (8) (2015) 35–45.
[10] T.T. Khuat, Q.C. Le, B.L. Nguyen, M.H. Le, Forecasting stock price using wavelet
ume (OBV), disparity in 5 days, disparity in 10 days and ADO de- neural network optimized by directed artificial bee colony algorithm, J.
rived from historical data, normalized and used as input variables. Telecommun. Inf. Technol. 2 (2016) 43–52.
GA utilized for tuning weights and bias of ANN. Selvamuthu et al. [11] S. Lahmiri, M. Boukadoum, Intelligent ensemble forecasting system of stock
market fluctuations based on symmetric and asymmetric wavelet functions,
[16] investigated the strength of ANN in forecasting intraday stock Fluct. Noise Lett. 14 (4) (2015) 15500339.
price. ANN is trained with three different training algorithms such [12] S. Lahmiri, M. Boukadoum, An ensemble system based on hybrid EGARCH-ANN
as LM, Scaled Conjugate Gradient (SCG) and Bayesian Regulariza- with different distributional assumptions to predict S&P 500 intraday volatility,
Fluct. Noise Lett. 14 (1) (2015) 1550 0 01.
tion (BR). Efficacy of each algorithm was compared in order to find [13] S. Pyo, J. Lee, M. Cha, H. Jang, Predictability of machine learning techniques to
out suitable one. Result indicated that SCG algorithm provides bet- forecast the trends of market index prices: hypothesis testing for the Korean
ter results than LM and BR. To show the power of the developed stock markets, PLoS One 12 (2017) e0188107.
[14] M. Qiu, Y. Song, Predicting the direction of stock market index movement using
hybrid models, the outcomes have been compared with respect to
an optimized artificial neural network model, PLoS One 11 (5) (2016) e0155133.
mean accuracy in Fig. 12. According to the Fig. 12, it is noted that [15] K.S.N. Ripon, S.A.A. Rajon, Stock market forecast using bio-inspired computing,
the PSO-BPNN achieved highest accuracy compared to other mod- in: Int. Conf. on Control, Decision and Info. Technologies (CoDIT), St. Julian’s,
2016, pp. 523–529.
els.
[16] D. Selvamuthu, V. Kumar, A. Mishra, Indian stock market prediction using arti-
ficial neural networks on tick data, Financ. Innov. 5 (2019) 16.
[17] H. Shah, N. Tairan, H. Garg, R.A. Ghazali, Quick gbest guided artificial bee
5. Conclusions
colony algorithm for stock market prices prediction, Symmetry 10 (2018) 292.
[18] T. Xiong, Y. Bao, Z. Hu, Multiple-output support vector regression with a firefly
Accessing future trends of stock price is of great importance algorithm for interval-valued stock price index forecasting, Knowl. Based Syst.
for both traders and investors. Although many researchers have 55 (2014) 87–100.

133

You might also like