Combining Metaheuristic Algorithms and Machine Learning for Investment Portfolio Management Based on Medium-Term Forecasting of Stock Market Index Data

Document Type : Original Article

Authors
1 PhD Student of Financial Engineering, South Tehran Branch, Islamic Azad University, Tehran, Iran
2 Assistant Professor of Accounting Department, South Tehran Branch, Islamic Azad University, Tehran, Iran
3 Associate Professor of Accounting Department, South Tehran Branch, Islamic Azad University, Tehran, Iran
4 Assistant Professor of Accounting department, Bandar Abbas Branch, Islamic Azad University, Bandar Abbas, Iran
10.22034/jik.2025.78411.4722
Abstract
This study presents a new framework for investment portfolio optimization by combining machine learning algorithms and metaheuristic methods. Using historical data of the Tehran Stock Exchange (2011-2023), the present study designs an intelligent system that is capable of predicting market behavior and forming optimal investment portfolios.
In the first stage, machine learning models including support vector regression (SVR) and random forest (RF) are used to predict stock returns and the total index. The parameters of these models are adjusted using the particle swarm optimization (PSO) algorithm.
In the next stage, the investment portfolio optimization problem is formulated as a multi-objective problem and solved with the two-objective genetic algorithm NSGA-II. By creating a Pareto front, this algorithm enables the simultaneous achievement of the conflicting goals of maximizing returns and minimizing risks. Experimental results show that portfolios constructed using this method provide higher returns than the market index with an acceptable level of risk.
This research is important in three ways: first, it shows that the intelligent combination of machine learning and meta-heuristic methods can lead to more efficient investment decisions. Second, it demonstrates the efficiency of the PSO algorithm in tuning the parameters of financial models and the ability of NSGA-II to solve complex portfolio optimization problems. Third, it provides a practical framework for financial analysts and portfolio managers that can adapt to different market conditions.
Keywords

·        اقتصاد, امیرعلی؛ محمدی,عمران. (1402). بهینه سازی سبد سرمایه گذاری به کمک پیش بینی بازده مورد انتظار با استفاده از روش های شبکه عصبی LSTM، جنگل تصادفی و ARIMA. چشم انداز مدیریت مالی.
·        تهرانی رضا،؛ محمد هندیجانی زاده، و عیسی نوروزیان لکوان ،. (1394). ارائه رویکردی جدید برای مدیریت فعال پرتفوی وانجام معاملات هوشمند سهام با تاکید بر نگرش انتخاب ویژگی. دانش سرمایه‌گذاری، 4(13): 107126.
·        رستمی, ژیلا, فتاحی, سهیلی. (1402). مدل‌سازی و تخمین بازده بورس اوراق بهادار تهران با استفاده از مدل‌های پویا. اقتصاد مالی, 17(62), 185216.
·        رضا شاطری مریم، نصیری محمد، زینالی مهدی. ارائه الگوی بهینه سبد سهام از طریق محدودیت تسلط تصادفی و کاهش ریسک گریزی مطلق. نشریه اقتصاد و بانکداری اسلامی. ۱۴۰۳; ۱۳ (۴۶) :۲۲۷-۲۵۲
·        شبان مهدی ؛ اله نخعی حبیب؛ الله طالب نیاقدرت و نازنین بشیری منش. (1399). طراحی الگوی غیرخطی سرایت‌پذیری شاخص کل بورس اوراق بهادار تهران از بازار دارایی‌های فیزیکی (کاربردی از مدل شبکه عصبی مصنوعی NARX). مهندسی مالی و مدیریت اوراق بهادار، 12(46): 476494.
·        علیزاده, حسین؛ کیانفر, کامران. (1402). توسعۀ مدل مارکوویتز در بهینه‌سازی سبد سهام با در نظر گرفتن محدودیت‌های واقع‌گرایانه. مدیریت دارایی و تامین مالی, 11(4), 6592.
·        کرامتی, اسفندیار؛ غلامی جمکرانی, و کاشفی نیشابوری. (1401). بهینه‌سازی پرتفوی سهام در بورس اوراق بهادار تهران (کاربرد رهیافت یادگیری تقویتی). مدلسازی اقتصادی, 16(58), 5166.
·        میرعلوی سید حسن؛ زهرا پورزمانی و آزیتا جهانشاد. (1398). ارائه مدلی مبتنی بر رفتار مالی سرمایه گذاران جهت پیش بینی قیمت سهام با استفاده از روش های فرا ابتکاری شبکه های عصبی. فصلنامه بورس اوراق بهادار، 47(12): 109176.
 
 
·        Awad, M., Khanna, R., Awad, M., & Khanna, R. (2015). Support vector regression. Efficient learning machines: Theories, concepts, and applications for engineers and system designers, 67-80.
·        Ban, G. Y., El Karoui, N., & Lim, A. E. (2018). Machine learning and portfolio optimization. Management Science, 64(3), 1136-1154.
·        Behera, J., Pasayat, A. K., Behera, H., & Kumar, P. (2023). Prediction based mean-value-at-risk portfolio optimization using machine learning regression algorithms for multi-national stock markets. Engineering Applications of Artificial Intelligence, 120, 105843.
·        Chen, H., Wang, P., Li, J., Zhang, G., & Zhang, Y. (2025). An improved NSGAII-SA algorithm for the cell manufacturing system layout optimization problem. Operational Research, 25(1), 22.
·        Chen, W., Zhang, H., Mehlawat, M. K., & Jia, L. (2021). Mean–variance portfolio optimization using machine learning-based stock price prediction. Applied Soft Computing, 100, 106943.
·        Cheng, Q., Yang, L., Zheng, J., Tian, M., & Xin, D. (2024). Optimizing Portfolio Management and Risk Assessment in Digital Assets Using Deep Learning for Predictive Analysis. arXiv preprint arXiv:2402.15994.
·        Daviran, M., Maghsoudi, A., & Ghezelbash, R. (2025). Optimized AI-MPM: Application of PSO for tuning the hyperparameters of SVM and RF algorithms. Computers & Geosciences, 195, 105785.
·        García-Gonzalo, E., García-Nieto, P. J., Fidalgo Valverde, G., Riesgo Fernández, P., Sánchez Lasheras, F., & Suárez Gómez, S. L. (2024). Hybrid DE-Optimized GPR and NARX/SVR Models for Forecasting Gold Spot Prices: A Case Study of the Global Commodities Market. Mathematics, 12(7), 1039.
·        Guarino, A., Santoro, D., Grilli, L., Zaccagnino, R., & Balbi, M. (2024). EvoFolio: a portfolio optimization method based on multi-objective evolutionary algorithms. Neural Computing and Applications, 36(13), 7221-7243.
·        Habbab, F. Z., & Kampouridis, M. (2024). An in-depth investigation of five machine learning algorithms for optimizing mixed-asset portfolios including REITs. Expert Systems with Applications, 235, 121102.
·        Lwin, K. T., Qu, R., & MacCarthy, B. L. (2017). Mean-VaR portfolio optimization: A nonparametric approach. European Journal of Operational Research, 260(2), 751-766.
·        Ma, Y., Han, R., & Wang, W. (2021). Portfolio optimization with return prediction using deep learning and machine learning. Expert Systems with Applications, 165, 113973.
·        Odeyemi, O., Mhlongo, N. Z., Nwankwo, E. E., Scholatica, U. C., & Okoye, C. C. (2024). Big data applications in portfolio management: A review of techniques and strategies. International Journal of Science and Research Archive, 11(1), 1984-1999.
·        Pradhan, A., Das, A., & Bisoy, S. K. (2025). Modified parallel PSO algorithm in cloud computing for performance improvement. Cluster Computing, 28(2), 131 Sadorsky, P. (2021). A random forests approach to predicting clean energy stock prices. Journal of Risk and Financial Management, 14(2), 48.
·        Sen, J., & Dutta, A. (2023). Portfolio optimization for the Indian stock market. In Encyclopedia of Data Science and Machine Learning (pp. 1904-1951). IGI Global.
·        Wu, L., Ahmad, M., Qureshi, S. A., Raza, K., & Khan, Y. A. (2022). An analysis of machine learning risk factors and risk parity portfolio optimization. Plos one, 17(9), e0272521.