Evaluating The Effectiveness of Advanced Machine Learning Algorithms in Reducing Stock Trading Risk on The Iranian Stock Exchange

Document Type : Research Paper

Authors

1 Department of Accounting, Ker.C., Islamic Azad University, Kermanshah, Iran.

2 Department of Economics, Ker.C. Islamic Azad University, Kermanshah, Iran.

Abstract

The primary objective of the present study was to thoroughly assess the efficiency of advanced machine learning algorithms in managing and mitigating stock trading risk in the Iranian capital market. Utilizing financial, economic, textual, and behavioral data from 172 companies over a 15-year period (2008–2023), this research estimated trading risk using advanced time-series models and modeled it against a total of 33 independent variables across five main dimensions. The methodology involved comparing the performance of six algorithmic families, ranging from simple regression to deep neural networks, in two scenarios: continuous prediction and risk level classification. The analysis of the results revealed that linear models performed very poorly due to the highly volatile and non-linear structure of the Iranian market. However, in the realm of non-linear methods, deep neural networks demonstrated the best capability for accurate and continuous risk prediction by recording the lowest error rates; this success is attributed to the ability of these models to identify long-term temporal patterns and the complex interaction of variables. In the section on classifying stocks into risk levels, algorithms based on gradient boosting decision trees achieved the highest efficiency with an accuracy exceeding 83% and were suggested as ideal tools for early warning systems. The analysis indicated that the primary drivers of risk volatility are macroeconomic variables (such as exchange rates and inflation), the effects of which are amplified by investor behavioral factors. Ultimately, this research confirms the significant and decisive superiority of advanced machine learning models over traditional approaches in analyzing risk within the Tehran Stock Exchange.

Keywords

Main Subjects


Abbasian, E., Shahri, K., Fallahpour, S., & Namaki, A. (2023). A novel approach to predicting financial distress using financial network-based information and hybrid gradient boosting decision tree method. Journal of Asset Management and Financing, 11(3), 113–140. https://doi.org/10.22108/amf.2023.138909.1818
Abdi, M., Hosseini, A., & Gholamabri, A. (2022). Modeling shocks of influential variables on stock return prediction: A hybrid BMA-BVAR approach. Economic Modelling, 6(16), 87–112. https://doi.org/10.30495/eco.2022.1972863.2706
Abolhassani Hastiani, A., Elmi Moghadam, M., Mansouri, N., & Amini Milani, M. (2023). Investigating the impact of financial and trade sanctions on the exchange rate in Iran (Fuzzy approach). Financial Economics, 17(63), 49–94. https://doi.org/10.30495/fed.2023.702185
Zolfaghary Tabesh et al., Iran J Econ Stud, 14(2) 2025, 443-500 495
Addy, W. A., Ajayi-Nifise, A. O., Bello, B. G., Tula, S. T., Odeyemi, O., & Falaiye, T. (2024). Machine learning in financial markets: A critical review of algorithmic trading and risk management. International Journal of Science and Research Archive, 11(01), 1853–1862. https://doi.org/10.30574/ijsra.2024.11.1.0292
Akhbari, H., Mohammadzadeh Salteh, H., Baradaran Hasanzadeh, R., & Zinali, M. (2024). Optimizing risk-based stock return prediction in selected industries of the Tehran Stock Exchange (Data Envelopment Analysis approach). Financial Research Journal, 26(2), 347–370. https://doi.org/10.22059/frj.2023.339775.1007309
Ashouri, M., & Tarh, M. J. (2012). Intelligent Web: A tool for generating and disseminating tacit knowledge in supply chains. Supply Chain Management, 14(37), 60–69. https://scmj.ihu.ac.ir/article_203491.html
Ashrafzadeh, M., Sadrani, M., & Hashemkhani Zolfani, S. (2025). Deep learning and machine learning models for portfolio optimization: Enhancing return prediction with stock clustering. Results in Engineering, 27, 106263. https://doi.org/10.1016/j.rineng.2025.106263
Athey, S., & Imbens, G. W. (2019). Machine learning methods that economists should know about. Annual Review of Economics, 11, 685-725. https://doi.org/10.1146/annurev-economics-080217-053433
Avramov, D., Cheng, S., & Metzker, L. (2022). Machine learning vs. economic restrictions: Evidence from stock return predictability. Management Science, 69(5), 2587-2619. https://doi.org/10.1287/mnsc.2022.4449
Ayyıldız, N., & İskenderoğlu, Ö. (2024). How effective is machine learning in stock market predictions? Heliyon, 10(2), e24123. https://doi.org/10.1016/j.heliyon.2024.e24123
Azevedo, V., & Hoegner, C. (2023). Enhancing stock market anomalies with machine learning. Review of Quantitative Finance and Accounting, 61, 1407-1458. https://doi.org/10.1007/s11156-022-01099-z
Bahoo, S., Cucculelli, M., Goga, X., & Mondolo, J. (2024). Artificial intelligence in finance: A comprehensive review through bibliometric and content analysis. SN Business & Economics, 4(2). https://doi.org/10.1007/s43546-023-00618-x
Balan, G. S., Kumar, V. S., & Raj, S. A. (2025). Machine learning and artificial intelligence methods and applications for post-crisis supply chain resiliency and recovery. Supply Chain Analytics, 10(1), 100121. https://doi.org/10.1016/j.sca.2025.100121
Bhuiyan, M. S. M., Rafi, M. A., Rodrigues, G. N., Mir, M. N. H., Ishraq, A., Mridha, M. F., & Shin, J. (2025). Deep learning for algorithmic trading: A systematic review of predictive models and optimization strategies. Array, 26, 100390. https://doi.org/10.1016/j.array.2025.100390
Blackledge, J., & Blackledge, A. (2025). Optimisation of Cryptocurrency Trading Using the Fractal Market Hypothesis with Symbolic Regression. Commodities, 4(4), 22-46. https://doi.org/10.3390/commodities4040022
496 Zolfaghary Tabesh et al., Iran J Econ Stud, 14(2) 2025, 443-500
Chen, C., Xue, L., & Xing, W. (2023). Research on improved GRU-based stock price prediction method. Applied Sciences, 13(15), 8813. https://doi.org/10.3390/app13158813
Chernozhukov, V., Chetverikov, D., Demirer, M., Duflo, E., Hansen, C., Newey, W., & Robins, J. (2018). Double/debiased machine learning for treatment and structural parameters. The Econometrics Journal, 21(1), C1-C68. https://academic.oup.com/ectj/article/21/1/C1/5056401
Chernozhukov, V., Wüthrich, K., & Zhu, Y. (2021). An exact and robust conformal inference method for counterfactual and synthetic controls. Journal of the American Statistical Association, 116(536), 1849-1864.
https://doi.org/10.48550/arXiv.1712.09089
Choudhary, H., Orra, A., Sahoo, K., & Thakur, M. (2025). Risk-adjusted deep reinforcement learning for portfolio optimization: A multi-reward approach. International Journal of Computational Intelligence Systems, 18, 126. https://doi.org/10.1007/s44196-025-00875-8
Daiya, H. (2024). AI-driven risk management strategies in financial technology. Journal of Artificial Intelligence General Science (JAIGS), 5(1), 194–216. https://doi.org/10.60087/jaigs.v5i1.194
Dalili, S., Rezaei Piteh-Noei, Y., Kabiri, M., Safari Gerayli, M., & Arabzadeh, M. (2024). Portfolio optimization using deep reinforcement learning and modern portfolio theory. Journal of Accounting, Finance and Computational Intelligence, 2(4), 276–293. https://jafci.com/index.php/jafci/article/view/89
Dehghani, M., Ghasemzadeh, M., & Ansari Samani, H. (2019). Machine learning algorithms for time series in financial markets. Soft Computing and Information Technology, 8(3), 60–67. https://sid.ir/paper/245855/fa
Esmaeili Moghadam, M. (2024). Behavioral finance and risk estimation in stochastic portfolio optimization. Scientific Journal of Modern Approaches in Management and Accounting, 8(29), 511–538. https://www.majournal.ir/index.php/ma/article/view/2700
Fama, E. F. (1970). Efficient capital markets: A review of theory and empirical work. The Journal of Finance, 25(2), 383-417. https://doi.org/10.2307/2325486
Farzad, A., Dehghan Manshadi, H., & Dashti Rahmatabadi, M. A. (2023). Predicting scheduling issues in civil projects using LSTM neural network (Long Short-Term Memory). Amirkabir Journal of Civil Engineering, 55(9), 1753–1764. https://doi.org/10.22060/ceej.2023.21383.7701
Fatouros, G., Makridis, G., Kotios, D., Soldatos, J., Filippakis, M., & Kyriazis, D. (2023). DeepVaR: A framework for portfolio risk assessment leveraging probabilistic deep neural networks. Digital Finance, 5, 29–56. https://doi.org/10.1007/s42521-022-00060-0
Gerlein, E. A., McGinnity, M., Belatreche, A., & Coleman, S. (2016). Evaluating machine learning classification for financial trading: An empirical approach. Expert Systems with Applications, 54, 193-207. https://doi.org/10.1016/j.eswa.2016.01.018
Zolfaghary Tabesh et al., Iran J Econ Stud, 14(2) 2025, 443-500 497
Ghasemieh, R., Sinaei, H. A., & Saeedi, Z. (2023). A hybrid model for predicting variable price behaviors in the stock market. Quarterly Journal of Strategic Management Studies, 14(56), 61–82. https://doi.org/10.22034/smsj.2023.383003.1781
Grudniewicz, J., & Slepaczuk, R. (2023). Application of machine learning in algorithmic investment strategies on global stock markets. Research in International Business and Finance, 66, 102052. https://doi.org/10.1016/j.ribaf.2023.102052
Han, Y. (2024). Machine learning based portfolio analysis. Highlights in Business Economics and Management, 44, 135–147. https://doi.org/10.54097/wc6epk11
Hao, J., He, F., Ma, F., Zhang, S., & Zhang, X. (2025). Machine learning vs deep learning in stock market investment: An international evidence. Annals of Operations Research, 348, 93–115. https://doi.org/10.1007/s10479-023-04800-5
Harvey, C. R., Liu, Y., & Zhu, H. (2016). … and the cross-section of expected returns. Review of Financial Studies, 29(1), 5-68. https://academic.oup.com/rfs/article/29/1/5/1843824
Hosseinzadeh, M., & Mehrgan, M. R. (2016). Designing a multiple methodology framework in operations research using social network analysis approach. Journal of Modern Research in Decision Making, 1(1), 1–26. Retrieved from https://journal.saim.ir/article_20702.html
Hou, K., Xue, C., & Zhang, L. (2020). Replicating anomalies. Review of Financial Studies, 33(5), 2019-2133. https://academic.oup.com/rfs/article/33/5/2019/5236964
Houshmand Naqabi, Z., Eslami Mofidabadi, H., & Aghasi, M. (2022). The relationship between stock returns and return volatility with market liquidity during the COVID-19 pandemic in companies listed on the Tehran Stock Exchange. Journal of Financial Accounting and Auditing Research, 14(56), 191–220. https://doi.org/10.30495/faar.2022.698386
Jafari, A., Arab Salehi, M., & Samadi, S. (2021). Analyzing the impact of market anomalies and growth opportunities on stock returns. Journal of Asset Management and Financing, 9(1), 63–92. https://doi.org/10.22108/amf.2020.120050.1490
keshavarz, H. and Rezaei, M. (2022). The Effect of Economic, Financial and Political Risk on the Risk and Return of Tehran Stock Exchange. Monetary & Financial Economics, 28(22), 127-152. https://doi.org/10.22067/mfe.2022.74053.1144
Kiumarthi, M., Ahmadi Shadmehri, M. T., Salimifar, M. and Abrishami, H. (2019). The Impact of Financial and Energy Sanctions on Output Gap in Iran. Iranian Journal of Economic Research, 24(79), 33-66. https://doi.org/10.22054/ijer.2019.10887
Koh, X. R., Rasiah, D., Yuen, Y. Y., & Ramasamy, S. (2018). An analysis of the relationship between risk and expected return in the Malaysia stock market:
498 Zolfaghary Tabesh et al., Iran J Econ Stud, 14(2) 2025, 443-500
Test of the CAPM. International Journal of Engineering & Technology, 7(3.21), 161. https://doi.org/10.14419/ijet.v7i3.21.17154
Kordestani, Gh. R., Eskandari, R., & Shams, M. (2024). The impact of organizational culture on stock price crash risk: A text analysis approach. Financial Accounting Research, 16(2), 89–118. https://doi.org/10.22108/far.2025.143326.2080
Krishnamurthy, S., & Adewuyi, O. B., & Salimon, S. A. (2026). Recent advances in artificial intelligence-based optimization for power system applications: A review of techniques, challenges, and future directions. Renewable and Sustainable Energy Reviews, 226(C), 116340. https://doi.org/10.1016/j.rser.2025.116340
Kubo, K., & Nakagawa, K. (2025). Portfolio optimization using deep learning with risk aversion utility function. Finance Research Letters, 74, 106761. https://doi.org/10.1016/j.frl.2025.106761
Liu, T., & Yu, Z. (2022). The analysis of financial market risk based on machine learning and particle swarm optimization algorithm. EURASIP Journal on Wireless Communications and Networking, 2022, Article 31. https://doi.org/10.1186/s13638-022-02180-y
Liu, Z., & Wang, J. (2019). Supply chain network equilibrium with strategic financial hedging using futures. European Journal of Operational Research, 272(3), 962–978. https://doi.org/10.1016/j.ejor.2018.08.033
Lu, H., & Ma, X. (2020). Hybrid decision tree-based machine learning models for short-term water quality prediction. Chemosphere, 249, Article 126169. https://doi.org/10.1016/j.chemosphere.2020.126169
Maleki, A., Hajizadeh, E., & Fereydooni, A. (2023). A risk-based trading system using algorithmic trading and deep learning models. In Data Analytics for Management, Banking and Finance (pp. 135–155). Springer Nature. https://doi.org/10.1007/978-3-031-34161-2_10
Markowitz, H. (1952). Portfolio selection. The Journal of Finance, 7(1), 77-91. https://doi.org/10.2307/2975974
Melina, M., Sukono, Napitupulu, H., & Mohamed, N. (2025). Modeling of machine learning-based extreme value theory in stock investment risk prediction: A systematic literature review. Big Data, 13(3). https://doi.org/10.1089/big.2023.0004
Merkoulova, Y., & Veld, C. (2022). Stock return ignorance. Journal of Financial Economics, 144(3), 864-884. https://doi.org/10.1016/j.jfineco.2021.06.016.
Moezdi, H., & Rezaei, M. (2021). The effect of economic, financial, and political risk on risk and return of the Tehran Stock Exchange. Monetary and Financial Economics, 28(Fall & Winter), 127–152. https://doi.org/10.22067/mfe.2022.74053.1144
Mohammadi Moradian, J., Ali, A., Yan, X., Pei, G., Zhang, S., Naveed, A., Shehzad, K., Shahnavaz, Z., Ahmad, F., & Yousaf, B. (2025). Sensors innovations for smart lithium-based batteries: Advancements, opportunities,
Zolfaghary Tabesh et al., Iran J Econ Stud, 14(2) 2025, 443-500 499
and potential challenges. Nano-Micro Letters, 17(2), 279-293. https://doi.org/10.1007/s40820-025-01786-1 .
Molnar, C. (2022). Interpretable machine learning: A guide for making black box models explainable (2nd ed.). https://originalstatic.aminer.cn/misc/pdf/Molnar-interpretable-machine-learning_compressed.pdf
Pattnaik, D., Ray, S., & Raman, R. (2024). Applications of artificial intelligence and machine learning in the financial services industry: A bibliometric review. Heliyon, 10(1), e23492. https://doi.org/10.1016/j.heliyon.2023.e23492 .
Rudin, C. (2019). Stop explaining black box machine learning models for high stakes decisions and use interpretable models instead. Nature Machine Intelligence, 1(5), 206-215. https://www.nature.com/articles/s42256-019-0048-x
Rudin, C. (2019). Stop explaining black box machine learning models for high stakes decisions and use interpretable models instead. Nature Machine Intelligence, 1(5), 206-215. https://www.nature.com/articles/s42256-019-0048-x
Sadeghi, A. and Tayebi, S. K. (2018). Effects of International Sanctions and Other Determinants on Iran’s Inflation Rate (1981-2014). Iranian Journal of Economic Research, 23(74), 33-57. https://doi.org/10.22054/ijer.2018.8825
Sarıkoç, M., & Celik, M. (2025). PCA-ICA-LSTM: A hybrid deep learning model based on dimension reduction methods to predict S&P 500 index price. Computational Economics, 65, 2249–2315. https://doi.org/10.1007/s10614-024-10629-x
Sharif Karimi, M., Emamverdi, Gh., & Dabbaghi, N. (2013). Evaluation and identification of the most suitable asset and financial investment option in Iran (2001–2010). Financial Economics, 7(25), 177–207. https://journals.iau.ir/article_512517.html
Shirazi, H., Azarbaiejani, K. and Sameti, M. (2016). The Effect of Economic Sanctions on Iran's Export. Iranian Economic Review, 20(1), 111-124. https://doi.org/10.22059/ier.2016.58273
Song, H., & Choi, H. (2023). Forecasting stock market indices using the recurrent neural network-based hybrid models: CNN-LSTM, GRU-CNN, and ensemble models. Applied Sciences, 13(7), 4644. https://doi.org/10.3390/app13074644
Sun, Z., Wang, G., Li, P., & Wang, H. (2023). An improved random forest based on the classification accuracy and correlation measurement of decision trees. Expert Systems with Applications, 237(18), 121549. https://doi.org/10.1016/j.eswa.2023.121549
Taheri Haftasiabi, R., Piri, P., Naderi, A., & Esmaily, N. (2023). Forecasting the financial crisis in Iran according to the slope of the yield curve and the bank credit index: A machine learning approach. Iranian Journal of Economic Studies, 12(1), 217-248. https://doi.org/10.22099/ijes.2024.51275.1973
500 Zolfaghary Tabesh et al., Iran J Econ Stud, 14(2) 2025, 443-500
Taslimipour, A., Askari Zadeh, Gh., Ghalmagh, K., & Nasiri, H. (2026). Forecasting the Tehran Stock Exchange overall index using the NARX neural network model. Journal of Asset Management and Financing, 14(1), 21–48. https://doi.org/10.22108/amf.2025.143461.1940
Torki, L., & Mazaheri, B. (2022). Economic impacts of financial sanctions on the Iranian economy. Economic Research and Perspectives, 22(4), 69–98. https://ecor.modares.ac.ir/article_13535.html
Uddin, A., Pabel, M. A. H., Alam, M. I., Kamruzzaman, F. N., Haque, M. S. U., Hosen, M. M., Sajal, A., Miah, M. R., & Ghosh, S. K. (2025). Advancing financial risk prediction and portfolio optimization using machine learning techniques. The American Journal of Management and Economics Innovations, 7(01), 5–20. https://doi.org/10.37547/tajmei/Volume07Issue01-02
Wu, Y., Sicard, B., & Gadsden, S. A. (2024). Physics-informed machine learning: A comprehensive review on applications in anomaly detection and condition monitoring. Expert Systems with Applications, 255(Part C), 124678. https://doi.org/10.1016/j.eswa.2024.124678
Wu, Z. (2021). Using machine learning approach to evaluate the excessive financialization risks of trading enterprises. Computational Economics, 59, 1607–1625. https://doi.org/10.1007/s10614-020-10060-5
Xie, J., Sun, L., & Zhao, Y. F. (2025). On the data quality and imbalance in machine learning-based design and manufacturing—A systematic review. Engineering, 45, 105-131. https://doi.org/10.1016/j.eng.2024.04.024
Xu, X. (2025). AI optimization algorithms enhance higher education management and personalized teaching through empirical analysis. Scientific Reports, 15(2), 10157. https://www.nature.com/articles/s41598-025-94481-5
Yan, R., Jin, J., & Han, K. (2024). Reinforcement learning for deep portfolio optimization. Electronic Research Archive, 32(9), 5176–5200. https://doi.org/10.3934/era.2024239
Yarlagadda, V. R., Awaafo, K. A., Hope, N. C., & Anne, U. (2024). Artificial intelligence in investment decision making and risk management. International Journal of Advance Research and Innovation, 12(4), 46–49. https://doi.org/10.69996/ijari.2024022
Zhang, Y., & Zhou, H. (2024). Multi-source sentiment analysis and SVM for stock risk prediction. Journal of Financial Technology, 18(2), 45–61. https://doi.org/10.1016/j.jft.2024.01.004