Evaluation of PSO-BiLSTM method for stock price forecasting using stock price time series data (Case study: Iran Stock Exchange and OTC stock)

Document Type : Research Paper

Authors

1 Ph.D. Student, Department of Finance, Faculty of Economics, Management and Accounting, Yazd University, Yazd, Iran

2 Associate Professor, Faculty of Economics, Management and Accounting, Yazd University, Yazd, Iran

3 Assistant Professor, Faculty of Economics, Management and Accounting, Yazd University, Yazd, Iran

Abstract

In recent years, with the increase in the penetration rate of the capital market, more people have invested in the stock market. Predicting the stock prices accurately with the least error can reduce investment risk and increase investment return. Due to nonlinear fluctuations, stock prices prediction is often described as a subject of nonlinear time series that is influenced by many factors. In this study, the bidirectional long short-term memory (BiLSTM) method for predicting stock prices is evaluated. In this regard, several machine learning techniques are applied to predict stocks prices using time series, and finally two deep learning methods including a recurrent neural network algorithm (LSTM) and a bidirectional neural network algorithm (BiLSTM) are implemented and their results are compared. Time series data of price characteristics including open, closed, high and low prices for the selected value stocks listed in Tehran stock exchange and the OTC, are used as a case study to implement the mentioned methods. Considering the evaluation criteria of RMSE and R-Square, the results of this study indicated that the combined PSO-BiLSTM algorithm, predicts the stock prices more accurately and has a better performance than the BiLSTM, LSTM, SVR, CART and MLP algorithms.

Keywords

Main Subjects


Aguilar-Rivera, A., & Valenzuela-Rendón, M. (2019). A new multi-period investment strategies method based on evolutionary algorithms. Neural Computing and Applications, 31(3), 923-937.
AhmadKhanBeygi, S., & Abdolvand, N. (2017). Stock Price Prediction Modeling Using Artificial Neural Network Approach and Imperialist Competitive Algorithm Based On Chaos Theory. Financial Management Strategy, 5(3), 27-73. (In persian).
Aminimehr, A., Bajalan, S., & Hekmat, H. (2021). A study on the characteristics of TSE index return data and introducing a regime switching prediction method based on neural networks. ـJournal of Financial Management Perspective, 11(34).
Arévalo, R., García, J., Guijarro, F., & Peris, A. (2017). A dynamic trading rule based on filtered flag pattern recognition for stock market price forecasting. Expert Systems with Applications, 81, 177-192.
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.
Ayala, J., García-Torres, M., Noguera, J. L. V., Gómez-Vela, F., & Divina, F. (2021). Technical analysis strategy optimization using a machine learning approach in stock market indices. Knowledge-Based Systems, 225, 107119.
Babajani, J., Taghva, M., Blue, G., & Abdollahi, M. (2019). Forecasting Stock Prices In Tehran Stock Exchange Using Recurrent Neural Network Optimized by Artificial Bee Colony Algorithm. Financial Management Strategy7(2), 195-228. (In persian).
Bagnall, A., Lines, J., Bostrom, A., Large, J., & Keogh, E. (2017). The great time series classification bake off: a review and experimental evaluation of recent algorithmic advances. Data mining and knowledge discovery, 31(3), 606-660.
Bustos, O., Pomares, A., & Gonzalez, E. (2017). A comparison between SVM and multilayer perceptron in predicting an emerging financial market: Colombian stock market. 2017 Congreso Internacional de Innovacion y Tendencias en Ingenieria (CONIITI),
Chai, J., Du, J., Lai, K. K., & Lee, Y. P. (2015). A hybrid least square support vector machine model with parameters optimization for stock forecasting. Mathematical Problems in Engineering, 2015.
Chakraborty, P., Pria, U. S., Rony, M. R. A. H., & Majumdar, M. A. (2017). Predicting stock movement using sentiment analysis of Twitter feed. 2017 6th International Conference on Informatics, Electronics and Vision & 2017 7th International Symposium in Computational Medical and Health Technology (ICIEV-ISCMHT),
Chen, Q., Zhang, W., & Lou, Y. (2020). Forecasting stock prices using a hybrid deep learning model integrating attention mechanism, multi-layer perceptron, and bidirectional long-short term memory neural network. IEEE Access, 8, 117365-117376.
Coyne, S., Madiraju, P., & Coelho, J. (2017). Forecasting stock prices using social media analysis. 2017 IEEE 15th Intl Conf on Dependable, Autonomic and Secure Computing, 15th Intl Conf on Pervasive Intelligence and Computing, 3rd Intl Conf on Big Data Intelligence and Computing and Cyber Science and Technology Congress (DASC/PiCom/DataCom/CyberSciTech),
Dang, M., & Duong, D. (2016). Improvement methods for stock market prediction using financial news articles. 2016 3rd National Foundation for Science and Technology Development Conference on Information and Computer Science (NICS),
Dase, R., & Pawar, D. (2010). Application of Artificial Neural Network for stock market predictions: A review of literature. International Journal of Machine Intelligence, 2(2), 14-17.
Dechow, P. M., Hutton, A. P., Meulbroek, L., & Sloan, R. G. (2001). Short-sellers, fundamental analysis, and stock returns. Journal of financial Economics, 61(1), 77-106.
Dharani, N., Bojja, P., & Kumari, P. R. (2021). Evaluation of performance of an LR and SVR models to predict COVID-19 pandemic. Materials Today: Proceedings.
Di Persio, L., & Honchar, O. (2016). Artificial neural networks architectures for stock price prediction: Comparisons and applications. International journal of circuits, systems and signal processing, 10(2016), 403-413.
Dingli, A., & Fournier, K. S. (2017). Financial time series forecasting–a deep learning approach. International Journal of Machine Learning and Computing, 7(5), 118-122.
Dunea, D., & Iordache, S. (2015). TIME SERIES ANALYSIS OF AIR POLLUTANTS RECORDED FROM ROMANIAN EMEP STATIONS AT MOUNTAIN SITES. Environmental Engineering & Management Journal (EEMJ), 14(11).
Edwards, R. D., Magee, J., & Bassetti, W. C. (2018). Technical analysis of stock trends. CRC press.
Fischer, T., & Krauss, C. (2018). Deep learning with long short-term memory networks for financial market predictions. European Journal of Operational Research, 270(2), 654-669.
Ghanavati, M., Wong, R. K., Chen, F., Wang, Y., & Fong, S. (2016). A generic service framework for stock market prediction. 2016 IEEE International Conference on Services Computing (SCC),
Gonzalez, R. T., Padilha, C. A., & Barone, D. A. C. (2015). Ensemble system based on genetic algorithm for stock market forecasting. 2015 IEEE congress on evolutionary computation (CEC),
Hochreiter, S., & Schmidhuber, J. (1996). LSTM can solve hard long time lag problems. Advances in neural information processing systems, 9.
Hu, Y. (2018). Stock market timing model based on convolutional neural network–a case study of Shanghai composite index. Finance& Economy, 4, 71-74.
Huang, C.-F., & Li, H.-C. (2017). An evolutionary method for financial forecasting in microscopic high-speed trading environment. Computational Intelligence and Neuroscience, 2017.
Huang, Q., Kong, Z., Li, Y., Yang, J., & Li, X. (2018). Discovery of trading points based on Bayesian modeling of trading rules. World Wide Web, 21(6), 1473-1490.
Hyndman, R. J., & Koehler, A. B. (2006). Another look at measures of forecast accuracy. International journal of forecasting, 22(4), 679-688.
Ican, O., & Celik, T. B. (2017). Stock market prediction performance of neural networks: A literature review. International Journal of Economics and Finance, 9(11), 100-108.
Ismail Fawaz, H., Forestier, G., Weber, J., Idoumghar, L., & Muller, P.-A. (2019). Deep learning for time series classification: a review. Data mining and knowledge discovery, 33(4), 917-963.
Jing, N., Wu, Z., & Wang, H. (2021). A hybrid model integrating deep learning with investor sentiment analysis for stock price prediction. Expert Systems with Applications, 178, 115019.
Kamble, R. A. (2017). Short and long term stock trend prediction using decision tree. 2017 International Conference on Intelligent Computing and Control Systems (ICICCS),
Kelleher, J. D. (2019). Deep learning. MIT press.
Khashei, M., Bijari, M., & Ardali, G. A. R. (2012). Hybridization of autoregressive integrated moving average (ARIMA) with probabilistic neural networks (PNNs). Computers & Industrial Engineering, 63(1), 37-45.
Kia, A. N., Haratizadeh, S., & Shouraki, S. B. (2018). A hybrid supervised semi-supervised graph-based model to predict one-day ahead movement of global stock markets and commodity prices. Expert Systems with Applications, 105, 159-173.
Kim, K.-j., & Han, I. (2000). Genetic algorithms approach to feature discretization in artificial neural networks for the prediction of stock price index. Expert Systems with Applications, 19(2), 125-132.
Kim, Y., & Enke, D. (2016). Developing a rule change trading system for the futures market using rough set analysis. Expert Systems with Applications, 59, 165-173.
Labiad, B., Berrado, A., & Benabbou, L. (2016). Machine learning techniques for short term stock movements classification for moroccan stock exchange. 2016 11th International Conference on Intelligent Systems: Theories and Applications (SITA),
Leitao, J., Neves, R. F., & Horta, N. (2016). Combining rules between PIPs and SAX to identify patterns in financial markets. Expert Systems with Applications, 65, 242-254.
Li, B., Chan, K. C., Ou, C., & Ruifeng, S. (2017). Discovering public sentiment in social media for predicting stock movement of publicly listed companies. Information Systems, 69, 81-92.
Li, Y., Zhang, Y., Zhou, G., & Gong, Y. (2021). Bayesian Optimization with Particle Swarm. 2021 International Joint Conference on Neural Networks (IJCNN),
Li, Z., Tam, V., & Yeung, L. (2016). Combining cloud computing, machine learning and heuristic optimization for investment opportunities forecasting. 2016 IEEE Congress on Evolutionary Computation (CEC),
Liu, Y., Gong, C., Yang, L., & Chen, Y. (2020). DSTP-RNN: A dual-stage two-phase attention-based recurrent neural network for long-term and multivariate time series prediction. Expert Systems with Applications, 143, 113082.
Liu, Y., Zeng, Q., Yang, H., & Carrio, A. (2018). Stock price movement prediction from financial news with deep learning and knowledge graph embedding. Pacific rim knowledge acquisition workshop,
Lorenzo, P. R., Nalepa, J., Kawulok, M., Ramos, L. S., & Pastor, J. R. (2017). Particle swarm optimization for hyper-parameter selection in deep neural networks. Proceedings of the genetic and evolutionary computation conference,
Lv, L., Kong, W., Qi, J., & Zhang, J. (2018). An improved long short-term memory neural network for stock forecast. MATEC web of conferences,
Malagrino, L. S., Roman, N. T., & Monteiro, A. M. (2018). Forecasting stock market index daily direction: A Bayesian Network approach. Expert Systems with Applications, 105, 11-22.
McCluskey, J., & Liu, J. (2017). US financial market forecasting using data classification with features from global markets. 2017 2nd International Conference on Image, Vision and Computing (ICIVC),
Mingyue, Q., Cheng, L., & Yu, S. (2016). Application of the Artifical Neural Network in predicting the direction of stock market index. 2016 10th International Conference on Complex, Intelligent, and Software Intensive Systems (CISIS),
Misra, P., & Chaurasia, S. (2020). Data-driven trend forecasting in stock market using machine learning techniques. Journal of Information Technology Research (JITR), 13(1), 130-149.
Nelson, D. M., Pereira, A. C., & De Oliveira, R. A. (2017). Stock market's price movement prediction with LSTM neural networks. 2017 International joint conference on neural networks (IJCNN),
Nielsen, A. (2019). Practical time series analysis: Prediction with statistics and machine learning. O'Reilly Media.
Oberlechner, T. (2001). Importance of technical and fundamental analysis in the European foreign exchange market. International Journal of Finance & Economics, 6(1), 81-93.
Pagolu, V. S., Reddy, K. N., Panda, G., & Majhi, B. (2016). Sentiment analysis of Twitter data for predicting stock market movements. 2016 international conference on signal processing, communication, power and embedded system (SCOPES),
Patel, J., Shah, S., Thakkar, P., & Kotecha, K. (2015). Predicting stock and stock price index movement using trend deterministic data preparation and machine learning techniques. Expert Systems with Applications, 42(1), 259-268.
Rather, A. M., Agarwal, A., & Sastry, V. (2015). Recurrent neural network and a hybrid model for prediction of stock returns. Expert Systems with Applications, 42(6), 3234-3241.
Ren, R., Wu, D. D., & Liu, T. (2018). Forecasting stock market movement direction using sentiment analysis and support vector machine. IEEE Systems Journal, 13(1), 760-770.
Sadeh, e., Ehtesham Rasi, r., & Sheidaei Narmigi, a. (2017). Fuzzy – neural model with hybrid genetic algorithms for stock price forecasting in auto industry in Tehran security exchange. Financial Engineering and Portfolio Management, 8(33), 113-136. (In persian).
Salehinejad, H., Sankar, S., Barfett, J., Colak, E., & Valaee, S. (2017). Recent advances in recurrent neural networks. arXiv preprint arXiv:1801.01078.
Schuster, M., & Paliwal, K. K. (1997). Bidirectional recurrent neural networks. IEEE transactions on Signal Processing, 45(11), 2673-2681.
Sharif far, A., Khalili Araghi, M., Raeesi Vanani, I., & Fallah, M. (2021). The Assessment of the optimal Deep Learning Algorithm on Stock Price Prediction (Long Short-Term Memory Approach). Financial Engineering and Portfolio Management, 12(48), 348-370. (In Persian).
Shumway, R. H., Stoffer, D. S., & Stoffer, D. S. (2000). Time series analysis and its applications (Vol. 3). Springer.
Shynkevich, Y., McGinnity, T. M., Coleman, S., & Belatreche, A. (2015). Stock price prediction based on stock-specific and sub-industry-specific news articles. 2015 international joint conference on neural networks (ijcnn),
Shynkevich, Y., McGinnity, T. M., Coleman, S. A., Belatreche, A., & Li, Y. (2017). Forecasting price movements using technical indicators: Investigating the impact of varying input window length. Neurocomputing, 264, 71-88.
Smagulova, K., & James, A. P. (2019). A survey on LSTM memristive neural network architectures and applications. The European Physical Journal Special Topics, 228(10), 2313-2324.
Sun, T., Wang, J., Zhang, P., Cao, Y., Liu, B., & Wang, D. (2017). Predicting stock price returns using microblog sentiment for chinese stock market. 2017 3rd International Conference on Big Data Computing and Communications (BIGCOM),
Tsantekidis, A., Passalis, N., Tefas, A., Kanniainen, J., Gabbouj, M., & Iosifidis, A. (2017). Using deep learning to detect price change indications in financial markets. 2017 25th European Signal Processing Conference (EUSIPCO),
Vanstone, B., & Finnie, G. (2009). An empirical methodology for developing stockmarket trading systems using artificial neural networks. Expert Systems with Applications, 36(3), 6668-6680.
Vassiliadis, V., Thomaidis, N., & Dounias, G. (2011). On the performance and convergence properties of hybrid intelligent schemes: application on portfolio optimization domain. European Conference on the Applications of Evolutionary Computation,
Verma, J. P., Tanwar, S., Garg, S., Gandhi, I., & Bachani, N. H. (2019). Evaluation of pattern based customized approach for stock market trend prediction with big data and machine learning techniques. International Journal of Business Analytics (IJBAN), 6(3), 1-15.
Wang, D., Liu, X., & Wang, M. (2013). A DT-SVM strategy for stock futures prediction with big data. 2013 IEEE 16th International Conference on Computational Science and Engineering,
Wang, J., Shang, W., Liu, Z., & Wang, S. (2017). An enhanced LGSA-SVM for S&P 500 index forecast. 2017 IEEE International Conference on Big Data (Big Data),
Wang, Q., Xu, W., & Zheng, H. (2018). Combining the wisdom of crowds and technical analysis for financial market prediction using deep random subspace ensembles. Neurocomputing, 299, 51-61.
White, H. (1988). Economic prediction using neural networks: The case of IBM daily stock returns. ICNN,
Wu, Z., Fan, J., Gao, Y., Shang, H., & Song, H. (2019). STUDY ON PREDICTION MODEL OF SPACE-TIME DISTRIBUTION OF AIR POLLUTANTS BASED ON ARTIFICIAL NEURAL NETWORK. Environmental Engineering & Management Journal (EEMJ), 18(7).
Xu, F., & Keelj, V. (2014). Collective sentiment mining of microblogs in 24-hour stock price movement prediction. 2014 IEEE 16th conference on business informatics,
Yu, Y., Si, X., Hu, C., & Zhang, J. (2019). A review of recurrent neural networks: LSTM cells and network architectures. Neural computation, 31(7), 1235-1270.
Zhang, G. P. (2003). Time series forecasting using a hybrid ARIMA and neural network model. Neurocomputing, 50, 159-175.
Zhang, J., Cui, S., Xu, Y., Li, Q., & Li, T. (2018). A novel data-driven stock price trend prediction system. Expert Systems with Applications, 97, 60-69.
Zhang, Y., & Wu, L. (2009). Stock market prediction of S&P 500 via combination of improved BCO approach and BP neural network. Expert Systems with Applications, 36(5), 8849-8854.
Zhou, P.-Y., Chan, K. C., & Ou, C. X. (2018). Corporate communication network and stock price movements: insights from data mining. IEEE Transactions on Computational Social Systems, 5(2), 391-402.