Professional Documents
Culture Documents
Hybrid Models For Intraday Stock Price Forecasting Based On Artificial
Hybrid Models For Intraday Stock Price Forecasting Based On Artificial
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.
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.
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.
125
K.C. S Pattern Recognition Letters 147 (2021) 124–133
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.
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
126
K.C. S Pattern Recognition Letters 147 (2021) 124–133
127
K.C. S Pattern Recognition Letters 147 (2021) 124–133
Table 2
Selected technical indicators.
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.
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
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
133