Stock market optimization amidst the COVID-19 pandemic: Technical analysis, K-means algorithm, and mean-variance model (TAKMV) approach

Heliyon. 2023 Jul;9(7):e17577. doi: 10.1016/j.heliyon.2023.e17577. Epub 2023 Jun 22.

Abstract

The Philippine stock market, just like most of its neighbors in the region, was seriously impacted by the global pandemic COVID-19. Investors remain hopeful while continuing to seek great ones in the damaged market. This paper developed a methodology for portfolio selection and optimization with the use of technical analysis, machine learning techniques, and portfolio optimization model. The combined methods of technical analysis, K-means clustering algorithm, and mean-variance portfolio optimization model will result in the development of the proposed TAKMV method. The study aims to integrate these three important analyses to identify portfolio investments. This paper uses the average annual risk and annual rate of return data for the years 2018 and 2020 to form the clusters and assessed the stocks that correspond to the investor's technical strategy such as Moving Average Convergence/Divergence (MACD) and Hybrid MACD with Arnaud Legoux Moving Average (ALMA). This paper solved the risk minimization problem on selected shares of the companies, based on the mean-variance portfolio optimization model. There are 230 and 239 companies for 2018 and 2020, respectively, listed in Philippine Stock Market, and all simulations were performed in MATLAB environment platform. Results showed that MACD strategy dominates the MACD-ALMA strategy in terms of the number of assets with a positive annual rate of return. The MACD works efficiently in the pre-COVID-19 condition while MACD-ALMA works efficiently during-COVID-19 condition, regardless of the number of assets with a positive annual rate of return. The results also show that the maximum expected portfolio return (RP) can be achieved using the MACD and MACD-ALMA in the pre-and during-COVID-19 conditions, respectively. The MACD-ALMA shows an advantage during high-risk market conditions and can also provide maximum RP. The performance of the TAKMV method was validated by applying its results and comparing it to the next year's historical price. The 2018 results were compared to 2019 data and the 2020 results were compared to 2021 data. For consistency, the comparison was applied to the same company per portfolio. Simulation results show that the MACD strategy is more effective compared to MACD-ALMA.

Keywords: COVID-19; Machine learning; Optimization; Stock market; Technical analysis.