An Intelligent Integrated Framework for Return Prediction, Asset Selection, and Portfolio Optimization Based on Ensemble Learning and the Aquila meta-heuristic optimization algorithm

Document Type : Original Article

Authors

1 Management Department, Faculty of Social Sciences and Economics, Alzahra University, Tehran, Iran.

2 Management Department, Faculty of Social Sciences and Economics, Alzahra University, Tehran, Iran

Abstract

Introduction:Predicting asset returns, managing tail risk, and constructing efficient portfolios are major challenges in financial markets, particularly in highly volatile and non-stationary environments such as the Iranian capital market. Most previous studies have focused on only one component return prediction, asset selection, or portfolio optimization and few have offered an integrated framework capable of performing these tasks simultaneously and intelligently. To address this gap, the present study proposes an innovative framework for intelligent stock portfolio optimization based on ensemble machine learning and the Aquila metaheuristic optimization algorithm, designed to improve return prediction accuracy and reduce tail risk using the Conditional Value-at-Risk (CVaR) criterion. Methods:Daily data from all listed and over-the-counter companies in Iran from April 2013 to October 2024 were used in this study. After data preprocessing and the removal of inconsistent or insufficiently covered symbols, 370 stocks were retained. In the first stage, an ensemble learning model comprising Random Forest, Adaptive Boosting, and Extreme Gradient Boosting was developed. The Aquila metaheuristic algorithm simultaneously performed three tasks: identifying influential features, tuning hyperparameters, and optimizing the weights of the base algorithms. The fitness function combined the mean squared error of stock returns with a penalty for feature set size. The optimized model was then used to predict future returns for all stocks, and based on prediction error, 30 stocks with the highest behavioral stability were selected. In the second stage, these 30 stocks were incorporated into the convex optimization framework of Rockafellar and Uryasev’s CVaR model to determine optimal portfolio weights for target returns of 0.2%, 0.5%, and 0.8%. Portfolio performance was evaluated using the Sortino & Sharp ratios, and the Acerbi–Szekely backtesting procedure was employed to assess the accuracy of tail-risk estimation. Results and discussion: The ensemble learning model enhanced by the Aquila metaheuristic algorithm successfully identified a compact yet highly effective set of price-, trend-, volatility-, and volume-based features, achieving a high level of predictive accuracy. The portfolio constructed with a target return of 0.5% demonstrated the best overall performance, achieving the highest Sortino & Sharp ratios at both the 95% and 99% confidence levels. Compared with an index-based portfolio, this strategy improved risk-adjusted performance by approximately 24%. Additionally, around 76% of the optimal portfolio weight was allocated to only eight top-performing stocks, mainly from the refining, petrochemical, and investment industries, which exhibited low correlation during market stress. The Acerbi–Szekely test confirmed that the CVaR model was well-calibrated and free from risk underestimation. Conclusions:This study introduces the first integrated framework that unifies three core components of financial decision-making and return prediction, intelligent asset selection, and advanced portfolio optimization-within a single, intelligent hybrid system. The results demonstrate that integrating ensemble learning with the Aquila metaheuristic algorithm under the CVaR framework can meaningfully reduce portfolio downside risk while enhancing risk-adjusted returns. This framework offers practical value for investment funds, asset managers, and institutional investors and can be extended to other emerging markets.

Keywords


Aboufazeli, Sh., Ebrahimi, S. B., & Kasaei, S. M. (2023). Portfolio optimization using a hybrid of Omega ratio and Markowitz mean-variance model based on two-level collective machine learning. Journal of Financial Management Perspective, 13(41), 33–58. (in Persian)
Abualigah, L., Yousri, D., Abd Elaziz, M., Ewees, A. A., Al-Qaness, M. A., & Gandomi, A. H. (2021). Aquila optimizer: A novel meta-heuristic optimization algorithm. Computers & Industrial Engineering, 157, Article 107250.
Acerbi, C., & Szekely, B. (2024). Backtestability and the ridge backtest. In Peter Carr Gedenkschrift: Research advances in mathematical finance (pp. 61–100). World Scientific.
Ahmadian, H., & Mirzaei, M. (2022). Machine learning in financial industry. Naghus Publisher.
Arian, H., Moghimi, M., Tabatabaei, E., & Zamani, S. (2022). Encoded Value-at-Risk: A machine learning approach for portfolio risk measurement. Mathematics and Computers in Simulation, 202, 500–525.
Asawa, Y. S. (2021). Modern machine learning solutions for portfolio selection. IEEE Engineering Management Review, 50(1), 94–112.
Ayyıldız, N., & İskenderoğlu, Ö. (2023). Prediction of stock index movement using machine learning methods: An application on BIST 100 index. Journal of Economics and Entrepreneurship Policy, 2(1), 1–18.
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, Article 105843.
Campisi, G., Muzzioli, S., & De Baets, B. (2024). A comparison of machine learning methods for predicting the direction of the US stock market on the basis of volatility indices. International Journal of Forecasting, 40(3), 869–880.
Dalili S., Rezaei Pitehnoei Y., Kabiri M., Safari Graili M., and Arabzadeh M. . (2014).Stock portfolio optimization using deep reinforcement learning based on modern portfolio theory. Accounting, Finance and Computational Intelligence, 2(4), 276-293. (in Persian)
Davallou, M., & Javadian, J. (2023). Investigating the effect of investors’ behavioral biases on the performance of risk-adjusted portfolios in the Tehran Stock Exchange. Journal of Financial Management Perspective, 13(40), 101–124. (in Persian)
Deep, A. (2024). Advanced financial market forecasting: Integrating Monte Carlo simulations with ensemble machine learning models. Quantitative Finance and Economics, 8(2), 286–314.
Dehghani, M., Ghasemzadeh, M., & Ansari Samani, H. (2019). Machine learning algorithms for time series in financial markets. Journal of Soft Computing and Information Technology, 8(3), 60–67. (in Persian)
Deng, S., & Min, X. (2013). Applied optimization in global efficient portfolio construction using earning forecasts. The Journal of Investing, 22(4), 104–114.
Dogan, A., & Birant, D. (2019). A weighted majority voting ensemble approach for classification. In Proceedings of the 2019 4th International Conference on Computer Science and Engineering (UBMK) (pp. 1–6). IEEE.
Dowd, K. (2007). Measuring market risk (2nd ed.). John Wiley & Sons.
Elfti, S., & Ohadi, F. (2022). Designing a commercial risk prediction model using machine learning techniques. Journal of Accounting Knowledge and Management Auditing, 11(42), 121–134. (in Persian)
18.Esfandiar,M.,Keramati.,M.,Gholami Jamkarani,R,.&Kashfi Neishabouri,M.(2024). Stock portfolio optimization using deep Q reinforcement learning strategy based on state-action matrix. Financial Engineering and Securities Management. 59, 23-51. (in Persian)
Faridi, S., Madanchi Zaj, M., Daneshvar, A., Shahverdiani, Sh., & Rahnama Roudposhti, F. (2022). Portfolio optimization based on hybrid Omega–Markowitz model using two-level collective machine learning. Financial Knowledge of Securities Analysis, 15(55), 33–54. (in Persian)
Greene, W. H. (2018). "Econometric analysis" (8th ed.). Pearson.
Gupta, P., Mehlawat, M. K., & Mittal, G. (2012). Asset portfolio optimization using support vector machines and real-coded genetic algorithm. Journal of Global Optimization, 53(2), 297–315.
Heratizadeh, S., & Rezaei, F. (2023). Presenting a new method for utilizing machine learning in the stock portfolio optimization process. Journal of Decisions and Operations Research, 8(2), 527–539. (in Persian)
Hull, J. C. (2021). Machine learning in business: An introduction to the world of data science. Independently published.
Luis, M. D., Rodríguez Alfonso, E., & Torres, D. (2023). Machine learning applied to active fixed-income portfolio management: A Lasso logit approach (Banco de España Working Paper No. 2324).
Noorahmadi, M., & Sadeghi, H. (2022). Machine learning based on hierarchical risk parity approach (Case study: Portfolio of 30 top companies in Tehran Stock Exchange). Financial Research Journal, 24(2), 236–256. (in Persian)
Rockafellar, R. T., & Uryasev, S. (2002). Conditional value-at-risk for general loss distributions. Journal of Banking & Finance, 26(7), 1443–1471.
Rom, B. M., & Sortino, F. A. (1994). The downside risk approach to risk measurement. Journal of Portfolio Management, 20(4), 51–59.
Wang, J.-Z., Wang, J.-J., Zhang, Z.-G., & Guo, S.-P. (2011). Forecasting stock indices with back propagation neural network. Expert Systems with Applications, 38(11), 14346–14355.
Zamani, M., Emamverdi, G., Nourifard, Y., Hamidian, M., & Jafari, S. M. (2024). Predicting value at risk with artificial intelligence approach. Journal of Quantitative Economics, 21(2), 1–33. (in Persian)
Zhang, C., & Ma, Y. (2012). Ensemble machine learning: Methods and applications (Vol. 144). Springer.