Designing a Model for Stock Price Prediction Based on the Integration of Machine Learning Models

Authors

    Farhang Sahabi Department of Management, Ta.C., Islamic Azad University, Tabriz, Iran
    Mehdi Zeynali * Department of Accounting, Ta.C., Islamic Azad University, Tabriz, Iran Dr.zeynali@iau.ac.ir
    Yagoub Alavimatin Department of Management, Ta.C., Islamic Azad University, Tabriz, Iran

Keywords:

Stock price prediction, machine learning, stacking ensemble, Tehran Stock Exchange, financial forecasting, artificial intelligence

Abstract

This study aimed to design and evaluate an integrated machine learning model for predicting the stock prices of companies listed on the Tehran Stock Exchange using market, technical, trading, and financial predictors. This applied, quantitative, longitudinal, and predictive-modeling study was conducted on companies listed on the Tehran Stock Exchange during 2014–2024. After applying inclusion and exclusion criteria, 148 companies were selected as the final sample, and 301,284 firm-day observations were analyzed. The predictor variables included historical price data, trading volume, trading value, number of transactions, market capitalization, technical indicators, volatility indicators, and selected financial ratios. Data were cleaned, adjusted, normalized, and transformed into a supervised learning structure. The dataset was divided chronologically into training, validation, and test sets. Several machine learning algorithms, including multiple linear regression, ridge regression, decision tree, support vector regression, random forest, gradient boosting, extreme gradient boosting, and long short-term memory neural network, were trained and compared. Finally, an integrated stacking ensemble model was developed. The results showed that nonlinear machine learning models outperformed linear models in predicting adjusted closing stock prices. Among the individual models, extreme gradient boosting achieved the strongest performance, with MAE = 398.26, RMSE = 642.37, MAPE = 6.18%, R² = 0.948, and directional accuracy = 72.61%. The final stacking ensemble model demonstrated the best overall predictive performance, with MAE = 331.44, RMSE = 548.63, MAPE = 5.08%, R² = 0.964, and directional accuracy = 76.39%. Feature-importance analysis indicated that lagged adjusted price, moving averages, market capitalization, trading value, earnings per share, MACD, RSI, trading volume, volatility, and return on equity were the most influential predictors. The findings indicated that integrating multiple machine learning models improves stock price prediction accuracy compared with single-model approaches. The proposed stacking ensemble model can serve as an effective decision-support tool for investors, analysts, and portfolio managers in emerging stock markets.

References

[1] S. Ahmed, M. M. Alshater, A. E. Ammari, and H. Hammami, "Artificial intelligence and machine learning in finance: A bibliometric review," Research in International Business and Finance, vol. 61, p. 101646, 2022/10/01/ 2022, doi: 10.1016/j.ribaf.2022.101646.

[2] D. Sheth and M. Shah, "Predicting Stock Market Using Machine Learning: Best and Accurate Way to Know Future Stock Prices," (in English), International Journal of System Assurance Engineering and Management, vol. 14, no. 1, pp. 1-18, 2023, doi: 10.1007/s13198-022-01811-1.

[3] G. Sonkavde, D. S. Dharrao, A. M. Bongale, S. T. Deokate, D. Doreswamy, and S. K. Bhat, "Forecasting Stock Market Prices Using Machine Learning and Deep Learning Models: A Systematic Review, Performance Analysis and Discussion of Implications," International Journal of Financial Studies, vol. 11, no. 3, p. 94, 2023, doi: 10.3390/ijfs11030094.

[4] L. Liu, B. Peng, and J. Yu, "Stock Price Prediction Based on Machine Learning," pp. 1277-1282, 2022, doi: 10.2991/978-94-6463-036-7_189.

[5] J. Chen, Y. Wen, Y. A. Nanehkaran, M. D. Suzauddola, W. Chen, and D. Zhang, "Machine learning techniques for stock price prediction and graphic signal recognition," Engineering Applications of Artificial Intelligence, vol. 121, p. 106038, 2023/05/01/ 2023. [Online]. Available: https://doi.org/10.1016/j.engappai.2023.106038.

[6] V. Chang, Q. A. Xu, A. Chidozie, and H. Wang, "Predicting Economic Trends and Stock Market Prices with Deep Learning and Advanced Machine Learning Techniques," Electronics, vol. 13, no. 17, p. 3396, 2024, doi: 10.3390/electronics13173396.

[7] M. Vijh, D. Chandola, V. A. Tikkiwal, and A. Kumar, "Stock Closing Price Prediction Using Machine Learning Techniques," Procedia Computer Science, vol. 167, pp. 599-606, 2020, doi: 10.1016/j.procs.2020.03.326.

[8] M. Yang, "Predicting the Direction of Stock Price Movement With Machine Learning Algorithms," Advances in Economics Management and Political Sciences, vol. 52, no. 1, pp. 283-291, 2023, doi: 10.54254/2754-1169/52/20230758.

[9] W. Liu, Y. Suzuki, and S. Du, "Forecasting the Stock Price of Listed Innovative SMEs Using Machine Learning Methods Based on Bayesian optimization: Evidence from China," Computational Economics, vol. 63, no. 5, pp. 2035-2068, 2024, doi: 10.1007/s10614-023-10393-4.

[10] B. Egüz, F. E. Çorbacı, and T. Kaya, "Stock Price Prediction of Turkish Banks Using Machine Learning Methods," pp. 222-229, 2021, doi: 10.1007/978-3-030-85577-2_26.

[11] S. Das, T. P. Sahu, and R. R. Janghel, "Effective forecasting of stock market price by using extreme learning machine optimized by PSO-based group oriented crow search algorithm," Neural Computing & Applications, vol. 34, pp. 555-591, 2022, doi: 10.1007/s00521-021-06403-x.

[12] W. Yao, Y. Zhang, S. Chang, J. Li, Q. Zhao, and F. Ge, "Stock price analysis and forecasting based on machine learning," ed, 2022.

[13] I. Behravan and S. M. Razavi, "Stock price prediction using machine learning and swarm intelligence," Journal of electrical and computer engineering innovations (JECEI), vol. 8, no. 1, pp. 31-40, 2020. [Online]. Available: https://jecei.sru.ac.ir/article_1421_6d94cea044bc908eba67a7ad40fe184e.pdf.

[14] A. Khosravi and S. M. J. Amirhosseini, "Providing a stock price prediction method using improved hybrid machine learning algorithms," Journal of Computing and Distributed Systems, vol. 6, no. 1, pp. 74-88, 2023.

[15] R. Chowdhury, M. Mahdy, T. Nourin Alam, and G. Al Guaderi, "Predicting the Stock Price Of Frontier Markets Using Modified BlackScholes Option Pricing Model and Machine Learning," Physica A: Statistical Mechanics and its Applications, 2020, doi: 10.1016/j.physa.2020.124444.

[16] M. N. Ashtiani and B. Raahemi, "News-based intelligent prediction of financial markets using text mining and machine learning: A systematic literature review," Expert Systems with Applications, vol. 217, p. 119509, 2023/05/01/ 2023. [Online]. Available: https://doi.org/10.1016/j.eswa.2023.119509.

[17] J. Maqbool, P. Aggarwal, R. Kaur, A. Mittal, and I. A. Ganaie, "Stock Prediction by Integrating Sentiment Scores of Financial News and MLP-Regressor: A Machine Learning Approach," Procedia Computer Science, vol. 218, pp. 1067-1078, 2023/01/01/ 2023. [Online]. Available: https://doi.org/10.1016/j.procs.2023.01.086.

[18] S. Z. Shaikh, K. R. Khan, F. K. Sherwani, and M. Khan, "Smart Trading: Unlocking Artificial Intelligence in Stock Market," The Business & Management Review, vol. 15, no. 03, 2025, doi: 10.24052/bmr/v15nu03/art-17.

[19] J. Mansilla-Lopez, "Factors, Forecasts, and Simulations of Volatility in the Stock Market Using Machine Learning," Journal of Risk and Financial Management, 2025, doi: 10.3390/jrfm18050227.

[20] F. Ghallabi, B. Souissi, A. M. Du, and S. Ali, "ESG stock markets and clean energy prices prediction: Insights from advanced machine learning," International Review of Financial Analysis, vol. 97, no. 1, p. 103889, 2025, doi: 10.1016/j.irfa.2024.103889.

[21] A. Taftiyan, M. Mirzababaei Mazraeh Akhond, and A. S. Oliaei Bajgani, "A systematic review of the machine learning approach in stock price prediction in the form of a time series model," in The 2nd National Conference on Modern Applied Research in Accounting, Damghan, 2023. [Online]. Available: https://civilica.com/doc/1964451.

Downloads

Published

2027-07-01

Submitted

2026-03-19

Revised

2026-06-23

Accepted

2026-06-30

Issue

Section

Articles

How to Cite

Sahabi, F. ., Zeynali, M., & Alavimatin, Y. . (2027). Designing a Model for Stock Price Prediction Based on the Integration of Machine Learning Models. Business, Marketing, and Finance Open, 1-21. https://www.bmfopen.com/index.php/bmfopen/article/view/492

Similar Articles

21-30 of 243

You may also start an advanced similarity search for this article.