Predicting Next-Day Closing Prices in Emerging Stock Markets Using Machine Learning Framework and Engineered
Features—Iraq as a Case Study
Ali Subhi Alhumaima1,*,Wisam Hayder Mahdi2 , Marwa M. Eid3,4, El-Sayed M. El-Kenawy5,6*
1Electronic Computer Center, University of Diyala, Diyala, Iraq
2Department of communications, College of Engineering, University of Diyala, Diyala, Iraq
3Faculty of Artificial Intelligence, Delta University for Science and Technology, Mansoura, Egypt
4Jadara Research Center, Jadara University, Irbid 21110, Jordan
5Department of Communications and Electronics, Delta Higher Institute of Engineering and Technology, Mansoura, 35111, Egypt
6Applied Science Research Center. Applied Science Private University, Amman, Jordan
Emails: alhumaimaali@uodiyala.edu.iq; wisam_haider@uodiyala.edu.iq; mmm@ieee.org; skenawy@ieee.org
Abstract
The complex nature, non-linear dynamics, and inherent volatility of stock markets make it difficult to provide accurate predictions. Recent developments in the area have shown the efficiency of some machine learning methodologies in predicting financial stock prices. However, emerging markets, such as Iraq, face additional challenges due to the lack of fundamental data needed to support predictive analysis. In this study, we present a novel framework that focuses on overcoming this issue and predicting the next-day closing prices of the Iraq Stock Exchange (ISX) main index, using only available historical closing prices to engineer 12 technical indicators. The goal is to compensate for the lack of important Open, High, and Low prices data while improving prediction accuracy. We used four machine-learning algorithms in the form of Random Forest (RF), Support Vector Machine (SVM), Artificial Neural Network (ANN), and K-Nearest Neighbor (KNN), which were optimized using grid search hyperparameter tuning technique. The performance of the models was evaluated using Root Mean Square Error (RMSE), Mean Absolute Percentage Error (MAPE), and Coefficient of Determination (R²). The comparison analysis resulted in the SVM with the linear kernel yielding the best performance (RMSE = 16.25, MAPE = 1.15, R² = 0.989), followed closely by the ANN (RMSE = 18.25), RF (RMSE = 26.76), then KNN (RMSE = 55.77). The current study introduces two main contributions: (1) the feasibility of using engineered features to achieve reliable predictions in markets with incomplete data, and (2) the critical role of using hyperparameter optimization to enhance models accuracy. The framework we propose provides a practical model for predicting stock prices in resource-constrained emerging markets.
Keywords: Stock market prediction; Emerging markets; Feature engineering; Technical indicators; Hyperparameter tuning; Iraq Stock Exchange (ISX); Support Vector Machine (SVM); Machine learning optimization; Time series prediction