Providing a Portfolio Optimization Model Based on Prediction Considering Investment Sentiment

Authors

    Ali Ghasemi Kian * Department of Industrial Engineering, K. N. Toosi University of Technology, Tehran, Iran. alikian7777777@gmail.com
    Amirabbas Najafi Department of Industrial Engineering, K. N. Toosi University of Technology, Tehran, Iran.

Keywords:

 Portfolio Optimization, Machine Learning, Investor Sentiment Analysis, Grey Wolf Optimizer

Abstract

The purpose of this study was to develop an integrated model for stock return prediction and portfolio optimization by combining historical market data, technical indicators, and investor sentiment extracted from social media in order to improve investment decision-making accuracy in financial markets. This study was conducted using daily data from 16 selected U.S. stock market symbols during the period from September 30, 2021 to September 29, 2022. Price data, trading volume, and social media textual information were collected and preprocessed into 105 features, including 92 technical features and 13 sentiment-related features. Binary Grey Wolf Optimizer (BGWO) was employed for feature selection, while the XGBoost algorithm was used for stock return prediction. Subsequently, the predicted 31-day returns were incorporated into the Markowitz mean–variance optimization framework. Monte Carlo simulation with 100,000 admissible weight vectors was used to determine the optimal portfolio composition. Model performance was evaluated using MSE, RMSE, MAE, MAPE, and R² indices. The findings demonstrated that integrating technical indicators with investor sentiment features significantly improved prediction performance. The highest R² values were observed for KO and COST, with values of 0.8945 and 0.8915, respectively, whereas TSLA and BX showed comparatively weaker predictive performance. The BGWO–XGBoost framework successfully selected informative features and generated a stable low-redundancy predictive structure. In the portfolio optimization stage, only symbols with R² values above 0.70 were included in the Markowitz framework. Simulation results revealed that the optimal portfolio achieved an annual Sharpe ratio of 3.1585, an expected return of 0.7956, and volatility of 0.2424. The highest portfolio weights were assigned to CRM, PG, KO, and AAPL, indicating their superior risk–return balance. The results indicated that integrating machine learning algorithms with investor sentiment analysis and classical financial optimization frameworks can substantially enhance stock return prediction accuracy and investment decision quality. The proposed model successfully reduced the gap between theoretical financial analysis and real market behavior by generating a balanced, executable, and high-performing portfolio in terms of risk and return. These findings highlight the strong potential of behavioral data and text analytics in the development of intelligent investment management systems.

Downloads

Download data is not yet available.

References

Aghababaei, M. A. (2022). Investigating the Effect of Investor Sentiment on Market Liquidity and Its Volatility in the Tehran Stock Exchange. Financial Research, 25(2), 357-383.

Asghari, M., Yazdanian, N., Tabrizian, B., & Rahnamay Roudposhti, F. (2024). Stock Price Prediction Based on Fundamental, Technical, and Economic Factors. Investment Knowledge, 13(51), 1-22.

Dadgar, Y., Dargahi, H., & Gholizadeh, S. (2023). The Role of Investor Sentiment and Government Behavior in Tehran Stock Exchange Volatility: A Behavioral Economics Approach. Applied Theories of Economics, 10(1), 191-214.

Emary, E., Zawbaa, H. M., & Hassanien, A. E. (2016). Binary grey wolf optimization approaches for feature selection. Neurocomputing, 172, 371-381.

Eslami Bidgoli, G., & Kordlouie, H. (2010). Behavioral Finance: The Transition Stage from Standard Finance to Neurofinance. Financial Engineering and Securities Management, 1(1), 19-36.

Fessler, D. M. T., Pillsworth, E. G., & Flamson, T. J. (2004). Angry men and disgusted women: An evolutionary approach to the influence of emotions on risk taking. Organizational Behavior and Human Decision Processes, 95(1), 107-123. https://doi.org/10.1016/j.obhdp.2004.06.006

Gambetti, E., & Giusberti, F. (2012). The effect of anger and anxiety traits on investment decisions. Journal of Economic Psychology, 33(6), 1059-1069. https://doi.org/10.1016/j.joep.2012.07.001

Gu, W. J., Zhong, Y. H., Li, S. Z., Wei, C. S., Dong, L. T., Wang, Z. Y., & Yan, C. (2024). Predicting stock prices with FinBERT-LSTM: Integrating news sentiment analysis. Proceedings of the 2024 8th International Conference on Cloud and Big Data Computing,

Hosseini, A., & Morshedi, F. (2019). The Effect of Investor Sentiment on Trading Dynamics of the Tehran Stock Exchange. Financial Accounting and Auditing Research, 11(44), 1-22.

Li, J., Cheng, K., Wang, S., & Liu, H. (2017). Feature selection: A data perspective. Acm Computing Surveys, 50(6), 1-45.

Lin, C. Y., & Marques, J. A. L. (2024). Stock market prediction using artificial intelligence: A systematic review of systematic reviews. Social Sciences and Humanities Open, 9, 100864.

Liu, L., Li, L., Nian, H., Lu, Y., Zhao, H., & Chen, Y. (2023). Enhanced grey wolf optimization algorithm for mobile robot path planning. Electronics, 12(19), 4026.

Miao, J., & Niu, L. (2016). A survey on feature selection. Procedia Computer Science, 91, 919-926.

Pompian, M. M. (2009). Behavioral Finance and Wealth Management (A. Badri, Trans.). Kayhan.

Qiu, M., & Song, Y. (2016). Predicting the direction of stock market index movement using an optimized artificial neural network model. PLoS One, 11(5), e0155133.

Raei, R., & Fallahpour, S. (2004). Behavioral Finance: A Different Approach in Finance. Financial Research, 6(2), 77-106.

Ramirez-Gallego, S., Lastra, I., & Alonso-Betanzos, A. (2017). Fast-mRMR. International Journal of Intelligent Systems, 32(2), 134-152.

Rezaei-Kalidbari, H. R., Davari, A., Pournaserani, A., & Mohammadi-Almani, A. (2013). The Effect of Corporate Social Responsibility and Environmental Awareness on Enhancing Green Intellectual Capital: A Case Study of Industrial Units in Rasht Industrial City. Public Management Perspective(15), 119-138.

Rezaeian, S., Taleghani, M., & Sharj Sharifi, A. (2024). Developing a Comprehensive Model for Stock Price Prediction in the Stock Exchange Market Using Interpretive Structural Modeling. Asset Management and Financing, 12(2), 39-58. https://doi.org/10.22108/amf.2024.138983.1821

Salehi Chegni, J., Saba, & Salehi. (2025). Deep Learning in Sentiment Analysis of Users of Smart Investment Networks. Intelligent Information Systems Quarterly, 3(6), 21-36.

Saravanos, C., & Kanavos, A. (2025). Forecasting stock market volatility using social media sentiment analysis. Neural Computing and Applications, 37(17), 10771-10794.

Vakilifard, H. R., Saeedi, A., & Eftekhari-Aliabadi, A. (2013). Investigation and Analysis of Behavioral Reactions in the Tehran Stock Exchange. Investment Knowledge, 3(9), 223-244.

Xiang, X. (2022). Investor sentiment, R&D spending and firm performance. Economic Research-Ekonomska Istraživanja, 35(1), 6257-6278. https://doi.org/10.1080/1331677X.2022.2048193

Xing, F. Z., Cambria, E., & Welsch, R. E. (2018). Intelligent asset allocation via market sentiment views. IEEE Computational intelligence magazine, 13(4), 25-34.

Yu, L., & Liu, H. (2003). Feature selection for high-dimensional data. ICML,

Yun, K. K., Yoon, S. W., & Won, D. (2021). Prediction of stock price direction using a hybrid GA-XGBoost. Expert Systems with Applications, 186, 115716.

Zare Bahman-Miri, M. J., Nazari Shams-Abadi, M. J., & Beikri, A. (2022). Social Responsibility and Investor Sentiment with a Simultaneous Equations Approach. Financial Accounting Research, 12(1), 61-80.

Downloads

Published

1406-04-01

Submitted

1404-10-01

Revised

1405-02-14

Accepted

1405-02-21

Issue

Section

Articles

How to Cite

Ghasemi Kian, A., & Najafi, A. . (1406). Providing a Portfolio Optimization Model Based on Prediction Considering Investment Sentiment. Accounting, Finance and Computational Intelligence, 1-23. https://www.jafci.com/index.php/jafci/article/view/426

Similar Articles

1-10 of 196

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