Dynamic Portfolio Optimization in the Tehran Stock Exchange Using Machine Learning and Deep Earning Algorithms

Authors

https://doi.org/10.48313/maa.v2i3.48

Abstract

Classical optimization models are applicable for portfolio optimization when capital market constraints and portfolio construction criteria are limited. However, given the existing complexities in capital markets, intricate relationships, and non-linear issues, classical models exhibit significant weaknesses and limitations. To address and solve such problems, computers and Machine Learning (ML)-based models have emerged to assist human decision-makers. Recently, techniques based on hybrid ML models have been designed, demonstrating robust capabilities in handling non-linear problems. This paper proposes a hybrid ML model for portfolio optimization based on specific historical data in the capital market. For this purpose, daily returns from 20 high-liquidity companies listed on the Tehran Stock Exchange (TSE) over a specific timeframe were utilized. The proposed framework integrates Random Forest (RF) for feature importance analysis and Extreme Gradient Boosting (XGBoost) for return prediction, combined with a Deep Reinforcement Learning (DRL) agent using Proximal Policy Optimization (PPO) for dynamic asset allocation. Portfolio performance is evaluated across four distinct risk metrics: Variance, Mean Absolute Deviation (MAD), Semi-Variance, and Conditional Value at Risk (CVaR). Based on evaluations of portfolio return, risk indices, and other key indicators, the results of this research indicate that the performance of the proposed ML model is at an optimal and desirable level.

Keywords:

Portfolio optimization, Machine learning, Deep reinforcement learning, Tehran stock exchange, Random forest, XGBoost, Risk management

References

  1. [1] Zare, H. (2021). Political uncertainty and stock market fluctuations in Iran: With consideration of international political changes. Journal of development and capital, 6(1), 123–145. https://doi.org/10.22103/jdc.2021.15440.1091

  2. [2] Fabozzi, F. J., Markowitz, H. M., & Gupta, F. (2008). Portfolio selection. In Handbook of finance (pp. 3–13). Wiley. https://doi.org/10.1002/9780470404324.HOF002001

  3. [3] Fahimi, A., & Shahbandarzadeh, H. (2021). Developing the Markowitz portfolio optimization model concerning investor non-financial considerations and supporting domestic products. Industrial management journal, 13(1), 53-79. https://doi.org/10.22059/imj.2021.316204.1007811

  4. [4] Ghasempour, A., Khodamipour, A., Zainali, H., & Taebi Naghandari, A. (2025). Designing an optimal model for predicting stock liquidity using the random forest. Journal of accounting knowledge, 16(2), 1-26. (In Persian). https://doi.org/10.22103/jak.2025.24973.4156

  5. [5] Ghods, M., Amiry, M., Peymani Forooshani, M., & Dehghan Dehnavi, M. (2025). Prediction of Tehran stock exchange total index using natural gradient boosting and SHAP values. Financial management perspective, 15(2), 34–53. https://doi.org/10.48308/jfmp.2025.239954.1498

  6. [6] Jiang, Z., Xu, D., & Liang, J. (2017). A deep reinforcement learning framework for the financial portfolio management problem. https://doi.org/10.48550/arXiv.1706.10059

  7. [7] Markowitz, H. (1952). Modern portfolio theory. Journal of finance, 7(11), 77–91. https://www.raymondjames.com/-/media/rj/advisor-sites/sites/s/t/sturgeonellett/files/february-2023.pdf

  8. [8] Breiman, L. (2001). Random forests. Machine learning, 45(1), 5–32. https://doi.org/10.1023/A:1010933404324

  9. [9] Chen, T., & Guestrin, C. (2016). Xgboost: A scalable tree boosting system. Proceedings of the 22nd acm sigkdd international conference on knowledge discovery and data mining (pp. 785-794). Association for Computing Machinery (ACM). https://dl.acm.org/doi/abs/10.1145/2939672.2939785

  10. [10] Schulman, J., Wolski, F., Dhariwal, P., Radford, A., & Klimov, O. (2017). Proximal policy optimization algorithms. https://doi.org/10.48550/arXiv.1707.06347

Published

2025-09-12

How to Cite

Pira, H. (2025). Dynamic Portfolio Optimization in the Tehran Stock Exchange Using Machine Learning and Deep Earning Algorithms. Metaheuristic Algorithms With Applications, 2(3), 229-235. https://doi.org/10.48313/maa.v2i3.48

Similar Articles

1-10 of 15

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