Forecasting Tehran Price Index (TEPIX) Using Novel Meta-Heuristic Algorithms

Document Type : Original Article


1 Department of Finance, Faculty of Management, Khatam University, Tehran, Iran.

2 Ph.d Candidate, Department of Financial Management, Faculty of Management and

3 Ph.d Candidate, Department of Financial Management, Faculty of Management and Economics, Science and Research Branch, Islamic Azad University, Tehran, Iran


The stock market involves risks and returns that, if forecasted correctly, can lead to profitability, and for this forecasting, appropriate methods are needed. It is affected by various parameters and needs a way to identify these parameters well and have a dynamic nature. The main goal of this article is forecasting Tehran Price Index (TEPIX) by using hybrid Artificial Neural Network (ANN) based on Genetic Algorithm (GA), Harmony Search (HS) particle Swarm Optimization algorithm (PSO) Moth Flame Optimization (MFO) and Whale Optimization algorithms. GA is used as feature selection. So, PSO, HS MFO and WOA are used to determine the number of input and hidden layers. We use the daily values of the stock price index of the Tehran Stock Exchange from 2013 to 2018 in order to forecasting price and test it. The accuracy of ANN, hybrid Artificial Neural Network with HS, PSO MFO and WOA is evaluated based on different loss functions such as MSE, MAE and etc. the results show that the predictability of Meta-heuristic algorithms in testing period is higher than normal ANN. Also, the predictability of hybrid WOA is higher than hybrid PSO and HS algorithms and MFO.


  • Abdullah, M. A., Ab Rashid, M. F. F., Ghazali, Z., & Rose, A. N. M. (2019). A case study of energy efficient assembly sequence planning problem. In IOP Conference Series: Materials Science and Engineering (Vol. 469, No. 1, p. 012013). IOP Publishing.
  • Ahmed, J., Jafri, M., Ahmad, J., & Khan, M. I. (2005). Design and implementation of a neural network for real-time object tracking. Paper presented at the Proceedings of machine vision and pattern recognition in 4th world enformatika conference, Istanbul.
  • Ahmed, M. K., Wajiga, G. M., Blamah, N. V., & Modi, B. (2019). Stock Market Forecasting Using ant Colony Optimization Based Algorithm. American Journal of Mathematical and Computer Modelling, 4(3), 52-57.
  • Bhowmik, P. (2019). Research Study on basic Understanding of Artificial Neural Networks. Global Journal of Computer Science and Technology.
  • Caginalp, G., & DeSantis, M. (2011). Nonlinearity in the dynamics of financial markets. Nonlinear Analysis: Real World Applications, 12(2), 1140-1151.
  • Chandana, P. H. (2019). A Survey on Soft Computing Techniques and Applications.
  • Chong, E., Han, C., & Park, F. C. (2017). Deep learning networks for stock market analysis and prediction: Methodology, data representations, and case studies. Expert Systems with Applications, 83, 187-205.
  • Chou, J.-S., & Nguyen, T.-K. (2018). Forward Forecast of Stock Price Using Sliding-Window Metaheuristic-Optimized Machine-Learning Regression. IEEE Transactions on Industrial Informatics, 14(7), 3132-3142.
  • Dash, R., & Dash, P. K. (2015, October). A comparative study of radial basis function network with different basis functions for stock trend prediction. In 2015 IEEE Power, Communication and Information Technology Conference (PCITC) (pp. 430-435). IEEE.
  • Davallou, M., & Azizi, N. (2017). The Investigation of Information Risk Pricing; Evidence from Adjusted Probability of Informed Trading Measure. Financial Research Journal, 19(3), 415-438.
  • de Oliveira, F. A., Nobre, C. N., & Zárate, L. E. (2013). Applying Artificial Neural Networks to prediction of stock price and improvement of the directional prediction index–Case study of PETR4, Petrobras, Brazil. Expert Systems with Applications, 40(18), 7596-7606.
  • de Rubio, J. J. (2020). Stability analysis of the modified Levenberg-Marquardt algorithm for the artificial neural network training. IEEE Transactions on Neural Networks and Learning Systems.
  • Dong, G., Fataliyev, K., & Wang, L. (2013, December). One-step and multi-step ahead stock prediction using backpropagation neural networks. In 2013 9th International Conference on Information, Communications & Signal Processing (pp. 1-5). IEEE.
  • Dubey, M., Kumar, V., Kaur, M., & Dao, T. P. (2021). A systematic review on harmony search algorithm: theory, literature, and applications. Mathematical Problems in Engineering, 2021.
  • Eberhart, R., & Kennedy, J. (1995). A new optimizer using particle swarm theory. Paper presented at the MHS'95. Proceedings of the Sixth International Symposium on Micro Machine and Human Science.
  • Efron, B., & Tibshirani, R. J. (1994). An introduction to the bootstrap: CRC press.
  • Emamverdi, G., Karimi, M. S., Khakie, S., & Karimi, M. (2016). Forecasting The Total Index of Tehran Stock Exchange. Financial Studies, 20(1).
  • Faris, H., Aljarah, I., & Mirjalili, S. (2016). Training feedforward neural networks using multi-verse optimizer for binary classification problems. Applied Intelligence, 45(2), 322-332.
  • Ftiti, Z., Guesmi, K., & Abid, I. (2016). Oil price and stock market co-movement: What can we learn from time-scale approaches? International review of financial analysis, 46, 266-280.
  • Gao, T., & Chai, Y. (2018). Improving stock closing price prediction using recurrent neural network and technical indicators. Neural computation, 30(10), 2833-2854.
  • Geem, Z. W., Kim, J. H., & Loganathan, G. V. (2001). A new heuristic optimization algorithm: harmony search. simulation, 76(2), 60-68.
  • Ghanbari, M., & Arian, H. (2019). Forecasting Stock Market with Support Vector Regression and Butterfly Optimization Algorithm. arXiv preprint arXiv:1905.11462.
  • Gharehchopogh, F. S., & Gholizadeh, H. (2019). A comprehensive survey: Whale Optimization Algorithm and its applications. Swarm and Evolutionary Computation, 48, 1-24.
  • Ghasemiyeh, R., Moghdani, R., & Sana, S. S. (2017). A hybrid artificial neural network with metaheuristic algorithms for predicting stock price. Cybernetics and Systems, 48(4), 365-392.
  • Göçken, M., Özçalıcı, M., Boru, A., & Dosdoğru, A. T. (2016). Integrating metaheuristics and artificial neural networks for improved stock price prediction. Expert Systems with Applications, 44, 320-331.
  • Guerrien, B., & Gun, O. (2011). Efficient Market Hypothesis: What are we talking about? real-world economics review, 56(11), 19-30.
  • Hadavandi, E., Ghanbari, A., & Abbasian-Naghneh, S. (2010). Developing an evolutionary neural network model for stock index forecasting. Paper presented at the International Conference on Intelligent Computing.
  • Haider, A., & Hanif, M. N. (2009). Inflation forecasting in Pakistan using artificial neural networks. Pakistan economic and social review, 123-138.
  • Hassanin, M. F., Shoeb, A. M., & Hassanien, A. E. (2016). Grey wolf optimizer-based back-propagation neural network algorithm. Paper presented at the 2016 12th International Computer Engineering Conference (ICENCO).
  • Idris, M. A., Saiang, D., & Nordlund, E. (2015). Stochastic assessment of pillar stability at Laisvall mine using Artificial Neural Network. Tunnelling and Underground Space Technology, 49, 307-319.
  • Ismael, M., Heikal, M., & Baharom, M. (2013). Characteristics of compressed natural gas jet and jet-wall impingement using the Schlieren imaging technique. Paper presented at the IOP Conference Series: Earth and Environmental Science.
  • Joe, H. Y., Ruiz Estrada, M. A., & Yap, S. F. (2016). The Evolution of Complex Systems Theory and the Advancement of Econophysics Methods in the Study of Stock Markets Crashes. Labuan Bulletin of International Business & Finance (LBIBf), 14(1).
  • Jóhannsson, Ó. S. (2020). Forecasting the Icelandic stock market using a neural network (Doctoral dissertation).
  • Krauss, C., Do, X. A., & Huck, N. (2017). Deep neural networks, gradient-boosted trees, random forests: Statistical arbitrage on the S&P 500. European Journal of Operational Research, 259(2), 689-702.
  • Lv, D., Yuan, S., Li, M., & Xiang, Y. (2019). An Empirical Study of Machine Learning Algorithms for Stock Daily Trading Strategy. Mathematical Problems in Engineering, 2019.
  • Wang, F. F. Chan, Y. Wang and Q. Chang, "Predicting public housing prices using delayed neural networks," 2016 IEEE Region 10 Conference (TENCON), 2016, pp. 3589-3592, doi: 10.1109/TENCON.2016.7848726.
  • Mirjalili, S. (2015). Moth-flame optimization algorithm: A novel nature-inspired heuristic paradigm. Knowledge-based systems, 89, 228-249.
  • Mirjalili, S., & Lewis, A. (2016). The whale optimization algorithm. Advances in engineering software, 95, 51-67.
  • Naseer, M., & Bin Tariq, D. (2015). The efficient market hypothesis: A critical review of the literature. The IUP Journal of Financial Risk Management, 12(4), 48-63.
  • Panahian, H. (2018). P/E Modeling and Prediction of Firms Listed on the Tehran Stock Exchange; a New Approach to Harmony Search Algorithm and Neural Network Hybridization. Iranian Journal of Management Studies, 11(4), 765-786.
  • Prasanna, S., & Ezhilmaran, D. (2013). An analysis on stock market prediction using data mining techniques. International Journal of Computer Science & Engineering Technology (IJCSET), 4(3), 49-51.
  • Preethi, G., & Santhi, B. (2012). Stock market forecasting techniques: A survey. Journal of Theoretical and Applied Information Technology, 46, 24-30.
  • Rajesh and et al (2019). Stock trend prediction using Ensemble learning techniques in python International Journal of Innovative Technology and Exploring Engineering (IJITEE), 8(5).
  • Rana, N., Latiff, M. S. A., Abdulhamid, S. I. M., & Chiroma, H. (2020). Whale optimization algorithm: a systematic review of contemporary applications, modifications and developments. Neural Computing and Applications, 1-33.
  • 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.
  • Rather, A. M., Sastry, V., & Agarwal, A. (2017). Stock market prediction and Portfolio selection models: a survey. Opsearch, 54(3), 558-579.
  • Ravichandran, K., Thirunavukarasu, P., Nallaswamy, R., & Babu, R. (2005). Estimation of return on investment in share market through ANN. Journal of Theoretical and Applied Information Technology, 3.
  • Safa, M., & Panahian, H. (2019). Ranking P/E Predictor Factors In Tehran Stock Exchange With Using The Harmony Search Meta Heuristic Algorithm.
  • Samadisoufi, R., & Noraei, M. The eminent effect of the business intelligence on the inner business processes and the role of the culture of the analytic decision making related (the subject of the study: Asia insurance of Zanjan province). Cumhuriyet Üniversitesi Fen-Edebiyat Fakültesi Fen Bilimleri Dergisi, 36(3), 2971-2981.
  • Sedighi, M., Jahangirnia, H., Gharakhani, M., & Farahani Fard, S. (2019). A Novel Hybrid Model for Stock Price Forecasting Based on Metaheuristics and Support Vector Machine. Data, 4(2), 75.
  • Sengupta, S., Basak, S., & Peters, R. A. (2019). Particle Swarm Optimization: A survey of historical and recent developments with hybridization perspectives. Machine Learning and Knowledge Extraction, 1(1), 157-191.
  • Sezer, O. B., Ozbayoglu, M., & Dogdu, E. (2017). A Deep neural-network based stock trading system based on evolutionary optimized technical analysis parameters. Procedia computer science, 114, 473-480.
  • Sheela, K. G., & Deepa, S. N. (2013). Review on methods to fix number of hidden neurons in neural networks. Mathematical Problems in Engineering, 2013.
  • Shehab, M., Abualigah, L., Al Hamad, H., Alabool, H., Alshinwan, M., & Khasawneh, A. M. (2020). Moth–flame optimization algorithm: variants and applications. Neural Computing and Applications, 32(14), 9859-9884.
  • Siami-Namini, S., & Namin, A. S. (2018). Forecasting economics and financial time series: ARIMA vs. LSTM. arXiv preprint arXiv:1803.06386.
  • Sin, E., & Wang, L. (2017, July). Bitcoin price prediction using ensembles of neural networks. In 2017 13th International Conference on Natural Computation, Fuzzy Systems and Knowledge Discovery (ICNC-FSKD) (pp. 666-671). IEEE.
  • Wang, T., Gao, H., & Qiu, J. (2015). A combined adaptive neural network and nonlinear model predictive control for multirate networked industrial process control. IEEE Transactions on Neural Networks and Learning Systems, 27(2), 416-425.
  • Wei, L.-Y., & Cheng, C.-H. (2012). A hybrid recurrent neural networks model based on synthesis features to forecast the Taiwan stock market. Int. J. Innov. Comput. Inf. Control, 8(8), 5559-5571.
  • Yang, J.-S., Nam, H.-J., Seo, M., Han, S. K., Choi, Y., Nam, H. G., . . . Kim, S. (2011). OASIS: online application for the survival analysis of lifespan assays performed in aging research. PloS one, 6(8), e23525.
  • Zhang, G. P., Patuwo, B. E., & Hu, M. Y. (2001). A simulation study of artificial neural networks for nonlinear time-series forecasting. Computers & Operations Research, 28(4), 381-396.
  • 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.
  • Zheng, T., Fataliyev, K., & Wang, L. (2013, May). Wavelet neural networks for stock trading. In Independent Component Analyses, Compressive Sampling, Wavelets, Neural Net, Biosystems, and Nanoengineering XI (Vol. 8750, p. 87500A). International Society for Optics and Photonics.