Skip to main content

Advertisement

Log in

Swarm Intelligence Based Hybrid Neural Network Approach for Stock Price Forecasting

  • Published:
Computational Economics Aims and scope Submit manuscript

Abstract

In this paper, a two-stage swarm intelligence based hybrid feed-forward neural network approach is designed for optimal feature selection and joint optimization of trainable parameters of neural networks in order to forecast the close price of Nifty 50, Sensex, S&P 500, DAX and SSE Composite Index for multiple-horizon (1-day ahead, 5-days-ahead and 10-days ahead) forecasting. Although the neural network can deal with complex non-linear and uncertain data but defining its architecture in terms of number of input features in the input layer, the number of neurons in the hidden layer and optimizing the weights is a challenging problem. The back-propagation algorithm is frequently used in the neural network and has a drawback to getting stuck in local minima and overfitting the data. Motivated by this, we introduce a swarm intelligence based hybrid neural network model for automatic search of features and other hlearnable neural networks' parameters. The proposed model is a combination of discrete particle swarm optimization (DPSO), particle swarm optimization (PSO) and Levenberg–Marquardt algorithm (LM) for training the feed-forward neural networks. The DPSO attempts to search automatically the optimum number of features and the optimum number of neurons in the hidden layer of FFNN whereas PSO, simultaneously tune the weights and bias in different layers of FFNN. This paper also compares the forecasting efficiency of proposed model with another hybrid model obtained by integrating binary coded genetic algorithm and real coded genetic algorithm with FFNN. Simulation results indicate that the proposed model is effective for obtaining the optimized feature subset and network structure and also shows superior forecasting accuracy.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig.1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12
Fig. 13
Fig. 14
Fig. 15
Fig. 16
Fig. 17
Fig. 18
Fig. 19
Fig. 20
Fig. 21

Similar content being viewed by others

Abbreviations

ABC:

Artificial Bee Colony

ACO:

Ant Colony Optimization

ACRO:

Artificial Chemical Reaction Optimization

ADI:

Accumulation Distribution Index

ADX:

Average Directional Index

ANNs:

Artificial Neural Networks

ANFIS:

Adaptive Network Fuzzy Inference System

ARCH:

Autoregressive Conditional Heteroskedasticity

ARIMA:

Autoregressive Integrated Moving Average

ARMA:

Autoregressive Moving Average

ARV:

Average Relative Variance

ATR:

Average True Range

BBBC:

Big-Bang-Big Crunch (BBBC) Optimization

BCGA:

Binary Coded Genetic Algorithm

BFO:

Bacterial Foraging Optimization

BP:

Back-Propagation

BSE:

Bombay Stock Exchange

CCI:

Commodity Channel Index

CI:

Computational Intelligence

CL:

Close Price

DE:

Differential Evolution

DJIA:

Dow Jones Industrial Average

DNN:

Dynamic Neural Network

DPSO:

Discrete Particle Swarm Optimization

EC:

Evolutionary Computation

ELM:

Extreme Learning Machine

EMA:

Exponential Moving Average

ENN:

Elman Neural Network

ES:

Exponential Smoothing

FCRBFNN:

Fully Complex-valued Radial Basis Function Neural Network

FFNN:

Feed-Forward Neural Network

FL:

Fuzzy Logic

FLANN:

Functional Link Artificial Neural Network

GA:

Genetic Algorithm

GARCH:

Generalized Autoregressive Conditional Heteroskedasticity

GRNN:

Generalized Regression Neural Network

GWO:

Gray Wolf Optimization

HI:

High Price

HS:

Harmony Search

IHHO:

Improved Harris's hawks optimization

ISCA:

Improved Sine Cosine Algorithm

IT2FS:

Interval Type-2 Fuzzy System

%K:

Stochastic %K

LM:

Levenberg–Marquardt Algorithm

LMBP:

Levenberg–Marquardt Back-Propagation

LO:

Low Price

MAAPE:

Mean Arctangent Absolute Percentage Error

MACD:

Moving Average Convergence Divergence

MOEA:

Multi-objective Evolutionary Optimization

MOMM:

Multiobjective Model-Metric (MOMM) Learning

MSE:

Mean Squared Error

MTM:

Momentum

NAS:

Neural Architecture Search

NIA:

Nature Inspired Algorithm

OBV:

On-Balance Volume

OHLC:

Open High Low Close

OP:

Open Price

PSO:

Particle Swarm Optimization

QRNN:

Quantile Regression Neural Network

%R:

William %R

RBFNN:

Radial Basis Functional Neural network

RCGA:

Real Coded Genetic Algorithm

RMSE:

Root Mean Squared Error

RNN:

Recurrent Neural Network

ROC:

Rate of Change

RSI:

Relative Strength Index

RW:

Random Walk

SI:

Swarm Intelligence

SMA:

Simple Moving Average

SMAPE:

Symmetric Mean Absolute Percentage Error

TA:

Technical Analysis

TSI:

True Strength Index

UI:

Ulcer Index

References

  • Adebiyi, A. A., Adewumi, A. O., & Ayo, C. K. (2014). Comparison of ARIMA and artificial neural networks models for stock price prediction. Journal of Applied Mathematics, 2014, 1–7.

    Article  Google Scholar 

  • Ariyo, A. A., Adewumi, A. O., & Ayo, C. K. (2014). Stock price prediction using the ARIMA model. In UKSim-AMSS 16th international conference on computer modelling and simulation (pp. 106–112). IEEE.

  • Atsalakis, G. S., & Valavanis, K. P. (2009). Surveying stock market forecasting techniques–part II: Soft computing methods. Expert Systems with Applications, 36(3), 5932–5941.

    Article  Google Scholar 

  • Azadeh, A., Saberi, M., Ghaderi, S., Gitiforouz, A., & Ebrahimipour, V. (2008). Improved estimation of electricity demand function by integration of fuzzy system and data mining approach. Energy Conversion and Management, 49(8), 2165–2177.

    Article  Google Scholar 

  • Baldominos, A., Saez, Y., & Isasi, P. (2020). On the automated, evolutionary design of neural networks: Past, present, and future. In Neural computing and applications (pp. 1–27).

  • Bartlett, P., & Downs, T. (1990). Training a neural network with a genetic algorithm. University of Queensland.

    Google Scholar 

  • Basheer, I. A., & Hajmee, M. (2000). Artificial neural networks: Fundamentals, computing, design, and application. Journal of Microbiological Methods, 43(1), 3–31.

    Article  Google Scholar 

  • Bisoi, R., & Dash, P. K. (2014). A hybrid evolutionary dynamic neural network for stock market trend analysis and prediction using unscented Kalman filter. Applied Soft Computing, 19, 41–56.

    Article  Google Scholar 

  • Botchkarev, A. (2018). Performance metrics (error measures) in machine learning regression, forecasting and prognostics: Properties and typology (pp. 1–37). arXiv preprint. https://arxiv.org/abs/1809.03006.

  • Box, G. E., Jenkins, G. M., Reinsel, G. C., & Ljung, G. M. (2015). Time series analysis: Forecasting and control (5th ed.). Wiley.

    Google Scholar 

  • Chen, W., Jiang, M., & Jiang, C. (2019). Constructing a multilayer network for stock market. Soft Computing 1–17.

  • Chiang, W. C., Enke, D., Wu, T., & Wang, R. (2016). An adaptive stock index trading decision support system. Expert Systems with Applications, 59, 195–207.

    Article  Google Scholar 

  • Darwish, A., Hassanien, A. E., & Das, S. (2020). A survey of swarm and evolutionary computing approaches for deep learning. Artificial Intelligence Review, 53(3), 1767–1812.

    Article  Google Scholar 

  • Elsken, T., Metzen, J. H., & Hutter, F. (2018). Efficient multi-objective neural architecture search via lamarckian evolution. arXiv preprint. https://arxiv.org/abs/1804.09081.

  • Elsken, T., Metzen, J. H., Hutter, F. (2018). Neural architecture search: A survey. arXiv preprint. https://arxiv.org/abs/1808.05377.

  • Elsken, T., Metzen, J. H., & Hutter, F. (2018). Neural architecture search: A survey. arXiv preprint. https://arxiv.org/abs/1808.05377.

  • Fama, E. (1970). Efficient capital markets: A review of theory and empirical work. . R. Lowbridge (Module Leader).

    Google Scholar 

  • Gao, S., Zhou, M., Wang, Y., Cheng, J., Yachi, H., & Wang, J. (2018). Dendritic neuron model with effective learning algorithms for classification, approximation, and prediction. IEEE Transactions on Neural Networks and Learning Systems, 30(2), 601–614.

    Article  Google Scholar 

  • Gocken, M., Ozcalici, M., Boru, A., & Dosdogru, A. T. (2016). Integrating metaheuristics and artificial neural networks for improved stock price prediction. Expert Systems with Applications, 44, 320–331.

    Article  Google Scholar 

  • Gocken, M., Ozcalici, M., Boru, A., & Dosdogru, A. T. (2019). Stock price prediction using hybrid soft computing models incorporating parameter tuning and input variable selection. Neural Computing and Applications, 31(2), 577–592.

    Article  Google Scholar 

  • Goh, A. T. (1995). Back-propagation neural networks for modeling complex systems. Artificial Intelligence in Engineering, 9(3), 143–151.

    Article  Google Scholar 

  • Gong, Z., Chen, H., Yuan, B., & Yao, X. (2018). Multiobjective learning in the model space for time series classification. IEEE Transactions on Cybernetics, 49(3), 918–932.

    Article  Google Scholar 

  • Guresen, E., Gulgun, K., & Daim, T. U. (2011a). Using artificial neural network models in stock market index prediction. Expert Systems with Applications, 38(8), 10389–10397.

    Article  Google Scholar 

  • Guresen, E., Kayakutlu, G., & Daim, T. U. (2011b). Using artificial neural network models in stock market index prediction. Expert Systems with Applications, 38(8), 10389–10397.

    Article  Google Scholar 

  • Guyon, I., & Elisseeff, A. (2003). An introduction to variable and feature selection. Journal of Machine Learning Research, 3, 1157–1182.

    Google Scholar 

  • Hagan, M. T., & Menhaj, M. B. (1994). Training feedforward networks with the Marquardt algorithm. IEEE Transactions on Neural Networks, 5(6), 989–993.

    Article  Google Scholar 

  • Haleh, H., Moghaddam, B. A., & Ebrahimijam, S. (2011). A new approach to forecasting stock price with EKF data fusion. International Journal of Trade, Economics and Finance, 2(2), 109–114.

    Article  Google Scholar 

  • Han, H. G., Lu, W., Hou, Y., & Qiao, J. F. (2016). An adaptive-PSO-based self-organizing RBF neural network. IEEE Transactions on Neural Networks and Learning Systems, 29(1), 104–117.

    Article  Google Scholar 

  • Haupt, R. L., & Haupt, S. E. (2004). Practical genetic algorithms (pp. 51–56). Wiley.

    Google Scholar 

  • Haykin, S. (1999). Neural network: A comprehensive foundation (2nd ed.). Prentice Hall.

    Google Scholar 

  • Holland, J. H. (1975). Adaptation in natural and artificial systems. University of Michigan Press.

    Google Scholar 

  • Hu, H., Ao, Y., Bai, Y., Cheng, R., & Xu, T. (2020). An improved Harris’s Hawks optimization for SAR target recognition and stock market index prediction. IEEE Access, 8, 65891–65910.

    Article  Google Scholar 

  • Hu, H., Tang, L., Zhang, S., & Wang, H. (2018). Predicting the direction of stock markets using optimized neural networks with Google Trends. Neurocomputing, 285, 188–195.

    Article  Google Scholar 

  • Hyndman, R. J., & Koehler, A. B. (2006). Another look at measures of forecast accuracy. International Journal of Forecasting, 22(4), 679–688.

    Article  Google Scholar 

  • Ibrahim, D. (2016). An overview of soft computing. Procedia Computer Science, 102, 34–38.

    Article  Google Scholar 

  • Inthachot, M., Boonjing, V., & Intakosum, S. (2016). Artificial neural network and genetic algorithm hybrid intelligence for predicting Thai stock price index trend. Computational Intelligence and Neuroscience, 2016, 1–8.

    Article  Google Scholar 

  • Jang, J. S. (1993). ANFIS: Adaptive-network-based fuzzy inference system. IEEE Transactions on Systems, Man, and Cybernetics, 23(3), 665–685.

    Article  Google Scholar 

  • Kapanova, K. G., Dimov, I., & Sellier, J. M. (2018). A genetic approach to automatic neural network architecture optimization. Neural Computing and Applications, 29(5), 1481–1492.

    Article  Google Scholar 

  • Kennedy, J., & Eberhart, R. (1995). Particle swarm optimization. In Proceedings of ICNN'95-international conference on neural networks (Vol. 4, pp. 1942–1948). IEEE.

  • Kennedy, J., & Eberhart, R. C. (1997). A discrete binary version of the particle swarm algorithm. In IEEE international conference on systems, man, and cybernetics. Computational cybernetics and simulation (Vol. 5, pp. 4104–4108).

  • Kim, K. J. (2006). Artificial neural networks with evolutionary instance selection for financial forecasting. Expert Systems with Applications, 30(3), 519–526.

    Article  Google Scholar 

  • Kim, S., & Kim, H. (2016). A new metric of absolute percentage error for intermittent demand forecasts. International Journal of Forecasting, 32(3), 669–679.

    Article  Google Scholar 

  • Kohonen, T. (1988). An introduction to neural computing. Neural Networks, 1(1), 3–16.

    Article  Google Scholar 

  • Kristjanpoller, W., & Minutolo, M. C. (2018). A hybrid volatility forecasting framework integrating GARCH, artificial neural network, technical analysis and principal components analysis. Expert Systems with Applications, 109, 1–11.

    Article  Google Scholar 

  • Kumar, G., Jain, S., & Singh, U. P. (2020). Stock market forecasting using computational intelligence: A survey. Archives of Computational Methods in Engineering 1–33.

  • Kumar, D., Meghwani, S. S., & Thakur, M. (2016). Proximal support vector machine based hybrid prediction models for trend forecasting in financial markets. Journal of Computational Science, 17, 1–13.

    Article  Google Scholar 

  • Kumar, S. (2004). Neural networks: A classical approach (2nd ed., pp. 61–65). Tata McGraw-Hill Education.

    Google Scholar 

  • Lin, C. S., Chiu, S. H., & Lin, T. Y. (2012). Empirical mode decomposition-based least squares support vector regression for foreign exchange rate forecasting. Economic Modelling, 29(6), 2583–2590.

    Article  Google Scholar 

  • Liu, C., Barret, Z., Maxim, N., Jonathon, S., Wei, H., Li-Jia, L., Li, F. F., Alan, Y., Jonathan, H., & Kevin, M. (2018). Progressive neural architecture search. In Proceedings of the European conference on computer vision (ECCV) (pp. 19–34).

  • Liu, F., & Wang, J. (2012). Fluctuation predictions of stock market index by Legendre neural network with random time strength function. Neurocomputing, 83, 12–21.

    Article  Google Scholar 

  • Lu, C. J., Lee, T. S., & Chiu, C. C. (2009). Financial time series forecasting using independent component analysis and support vector regression. Decision Support Systems, 47(2), 115–125.

    Article  Google Scholar 

  • Mandziuk, J., & Jaruszewicz, M. (2011). Neuro-genetic system for stock index prediction. Journal of Intelligent and Fuzzy Systems, 22(2), 93–123.

    Article  Google Scholar 

  • Menkhoff, L. (1997). Examining the use of technical currency analysis. International Journal of Finance and Economics, 2(4), 307–318.

    Article  Google Scholar 

  • Mirjalili, S., & Lewis, A. (2013). S-shaped versus V-shaped transfer functions for binary particle swarm optimization. Swarm and Evolutionary Computation, 9, 1–14.

    Article  Google Scholar 

  • More, J. J. (1978). The Levenberg-Marquardt algorithm: Implementation and theory. In Numerical analysis (pp. 105–116). Springer.

  • Nassirtoussi, A. K., Wah, T. Y., & Ling, D. N. C. (2011). A novel FOREX prediction methodology based on fundamental data. African Journal of Business Management, 5(20), 8322–8330.

    Google Scholar 

  • Nayak, S. C., Kumar, K. V., & Jilla, K. (2020). ACRRFLN: Artificial chemical reaction of recurrent functional link networks for improved stock market prediction. In Computational intelligence in data mining (pp. 311–325). Springer.

  • Nayak, S. C., Misra, B. B., & Behera, H. S. (2019). ACFLN: Artificial chemical functional link network for prediction of stock market index. Evolving Systems, 10(4), 567–592.

    Article  Google Scholar 

  • Pradeepkumar, D., & Ravi, V. (2017). Forecasting financial time series volatility using particle swarm optimization trained quantile regression neural network. Applied Soft Computing, 58, 35–52.

    Article  Google Scholar 

  • Qiu, M. Y., Song, Y., & Akagi, F. (2016). Application of artificial neural network for the prediction of stock market returns: The case of the Japanese stock market. Chaos, Solitons and Fractals, 85, 1–7.

    Article  Google Scholar 

  • Ren, G., Cao, Y., Wen, S., Huang, T., & Zeng, Z. (2018). A modified Elman neural network with a new learning rate scheme. Neurocomputing, 286, 11–18.

    Article  Google Scholar 

  • Reza, H., Shahrabi, J., & Hadavandi, E. (2015). A bat-neural network multi-agent system (BNNMAS) for stock price prediction: Case study of DAX stock price. Applied Soft Computing, 29, 196–210.

    Article  Google Scholar 

  • Rout, M., & Koudjonou, K. M. (2020). An evolutionary algorithm based hybrid parallel framework for Asia foreign exchange rate prediction. In Nature inspired computing for data science (pp. 279–295). Springer.

  • Sahoo, S., & Mohanty, M. N. (2020). Stock market price prediction employing artificial neural network optimized by Gray Wolf optimization. In New paradigm in decision science and management (pp. 77–87). Springer.

  • Sakshi, S., & Kumar, R. (2019). A neuro-genetic technique for pruning and optimization of ANN weights. Applied Artificial Intelligence, 33(1), 1–26.

    Article  Google Scholar 

  • Sands, T. M., Tayal, D., Morris, M. E., & Monteiro, S. T. (2015). Robust stock value prediction using support vector machines with particle swarm optimization. In IEEE congress on evolutionary computation (CEC) (pp. 3327–3331). IEEE.

  • Senapati, M. R., Das, S., & Mishra, S. (2018). A novel model for stock price prediction using hybrid neural network. Journal of the Institution of Engineers (india): Series B, 99(6), 555–563.

    Article  Google Scholar 

  • Shynkevich, Y., McGinnity, T. M., Coleman, S. A., Belatreche, A., & Li, Y. (2017). Forecasting price movement using technical indicators: Investing the impact of varying window length. Neurocomputing, 264, 71–88.

    Article  Google Scholar 

  • Si, Y. W., & Yin, J. (2013). OBST-based segmentation approach to financial time series. Engineering Applications of Artificial Intelligence, 26(10), 2581–2596.

    Article  Google Scholar 

  • Technical analysis. [Online]. Retrieved from https://www.investopedia.com/technical-analysis-4689657. Accessed March 20, 2020.

  • Technical analysis library in python. [Online]. Retrieved from https://technical-analysis-library-inpython.readthedocs.io/en/latest/ta.html. Accessed May 30, 2020.

  • Technical indicators. [Online]. Retrieved from https://school.stockcharts.com/doku.php?id=technicalindicators. Accessed March 30, 2020

  • Theil, H. (1966). Applied economic forecasting. North-Holland Pub. Co.

    Google Scholar 

  • Ulke, V., Sahin, A., & Subasi, A. (2018). A comparison of time series and machine learning models for inflation forecasting: Empirical evidence from the USA. Neural Computing and Applications, 30(5), 1519–1527.

    Article  Google Scholar 

  • Vaisla, K. S., & Bhatt, A. K. (2010). Ananalysis of the performance of artificial neural network technique for stock market forecasting. International Journal on Computer Science and Engineering, 2(6), 2104–2109.

    Google Scholar 

  • Wang, J., & Kumbasar, T. (2019). Parameter optimization of interval Type-2 fuzzy neural networks based on PSO and BBBC methods. IEEE/CAA Journal of Automatica Sinica, 6(1), 247–257.

    Article  Google Scholar 

  • Wang, J., & Wang, J. (2015). Forecasting stock market indexes using principle component analysis and stochastic time effective neural networks. Neurocomputing, 156, 68–78.

    Article  Google Scholar 

  • Wang, J. J., Wang, J. Z., Zhang, Z. G., & Guo, S. P. (2012). Stock index forecasting based on a hybrid model. Omega, 40(6), 758–766.

    Article  Google Scholar 

  • Webb, A. R. (2003). Statistical pattern recognition (pp. 307–352). Wiley.

  • Wright, A. H. (1991) Genetic algorithms for real parameter optimization. In Foundations of genetic algorithms (Vol. 1, pp. 205–218).

  • Xiong, T., Bao, Y., Hu, Z., & Chiong, R. (2015). Forecasting interval time series using a fully complex-valued RBF neural network with DPSO and PSO algorithms. Information Sciences, 305, 77–92.

    Article  Google Scholar 

  • Yan, W. (2012). Toward automatic time-series forecasting using neural networks. IEEE Transactions on Neural Networks and Learning Systems, 23(7), 1028–1039.

    Article  Google Scholar 

  • Yang, F., Chen, Z., Li, J., & Tang, L. (2019). A novel hybrid stock selection method with stock prediction. Applied Soft Computing, 80, 820–831.

    Article  Google Scholar 

  • Yao, J., Tan, C. L., & Poh, H. L. (1999). Neural networks for technical analysis: A study on KLCI. International Journal of Theoretical and Applied Finance, 2(2), 221–241.

    Article  Google Scholar 

  • Yao, X. (1999). Evolving artificial neural networks. Proceedings of the IEEE, 87(9), 1423–1447.

    Article  Google Scholar 

  • Yeh, W. C. (2009). A two-stage discrete particle swarm optimization for the problem of multiple multi-level redundancy allocation in series systems. Expert System Application, 36, 9192–9200.

    Article  Google Scholar 

  • Yu, L., & Liu, H. (2003). Feature selection for high-dimensional data: A fast correlation-based filter solution. In Proceedings of the 20th international conference on machine learning (pp. 856–863).

  • Zhang, D. Y., Song, H. W., & Chen, P. (2008). Stock market forecasting model based on a hybrid ARMA and support vector machines. In International conference on management science and engineering 15th annual conference proceedings (pp. 1312–1317). IEEE.

  • Zhong, X., & Enke, D. (2017). Forecasting daily stock market return using dimensionality reduction. Expert Systems with Applications, 67, 126–139.

    Article  Google Scholar 

  • Zhou, T., Gao, S., Wang, J., Chu, C., Todo, Y., & Tang, Z. (2016). Financial time series prediction using a dendritic neuron model. Knowledge-Based Systems, 105, 214–224.

    Article  Google Scholar 

Download references

Funding

No funding received from any organization.

Author information

Authors and Affiliations

Authors

Contributions

GK: Conceptualization, writing-original draft preparation, software, visualization. UPS: Methodology, result validation, writing- reviewing and editing. SJ: Writing- reviewing and supervision.

Corresponding author

Correspondence to Uday Pratap Singh.

Ethics declarations

Conflict of interest

The authors declare that they have no conflict of interest.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Kumar, G., Singh, U.P. & Jain, S. Swarm Intelligence Based Hybrid Neural Network Approach for Stock Price Forecasting. Comput Econ 60, 991–1039 (2022). https://doi.org/10.1007/s10614-021-10176-9

Download citation

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10614-021-10176-9

Keywords

Navigation