Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
. 2023 Jul;9(7):e17577.
doi: 10.1016/j.heliyon.2023.e17577. Epub 2023 Jun 22.

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

Affiliations

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

Maricar M Navarro et al. Heliyon. 2023 Jul.

Erratum in

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.

PubMed Disclaimer

Conflict of interest statement

The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

Figures

Fig. 1
Fig. 1
Flowchart of the proposed TAKMV methodology.
Fig. 2
Fig. 2
Trading rules for MACD (12, 26, 9) and MACD (4,22,3). (Upper: Candlestick; Middle: MACD and Signal Line of (12, 26, 9) Window; Lower: MACD and Signal Line of (4,22,3) Window).
Fig. 3
Fig. 3
Trading rules for MACD-ALMA (12, 26, 9) and MACD-ALMA (4,22,3) (Upper: Candlestick and ALMA Line; Middle: MACD and Signal Line of (12, 26, 9) Window; Lower: MACD and Signal Line of (4,22,3) Window).
Fig. 4
Fig. 4
Sample stock data and daily return (Upper: Candlestick; Lower: Daily Return).
Fig. 5
Fig. 5
No. Of companies with positive Ri in different technical investment strategies.
Fig. 6
Fig. 6
Cluster assignments and centroid for 2018 data (upper: Macd (12, 26, 9); lower: Macd (4,22,3)).
Fig. 7
Fig. 7
Cluster assignments and centroid for 2018 data (upper: MACD-ALMA (12, 26, 9); lower: MACD-ALMA (4,22,3)).
Fig. 8
Fig. 8
Cluster assignments and centroid for 2020 data (upper: Macd (12, 26, 9); lower: Macd (4,22,3)).
Fig. 9
Fig. 9
Cluster assignments and centroid for 2020 data (upper: MACD-ALMA (12, 26, 9); lower: MACD-ALMA (4,22,3)).
Fig. 10
Fig. 10
RP and sigma of MACD (12, 26, 9), elbow method 4 (upper: Positive and negative weights; lower: Positive weights).
Fig. 11
Fig. 11
Portfolio risk and return results comparison per clustered portfolio (upper: 2018 data; lower: 2019 data).
Fig. 12
Fig. 12
Portfolio risk and return results comparison per clustered portfolio (upper: 2020 data; lower: 2021 data).

References

    1. Gherghina Ș.C.a., Joldeș C.C. Stock market reactions to COVID-19 pandemic outbreak: quantitative evidence from ARDL bounds tests and granger causality analysis. Int. J. Environ. Res. Publ. Health. 2020;17(18):6729. doi: 10.3390/ijerph17186729. - DOI - PMC - PubMed
    1. Elsayed A., Abdelrhim M. 2020. The Effect of COVID-19 Spread on Egyptian Stock Market Sectors. Available at: SSRN 3608734.
    1. Al-Awadhi A.M., Alsaifi K., Ahmad A., Alhammadi S. Death and contagious infectious diseases: impact of the COVID-19 virus on stock market return. J. Behav. Experimen. Finan. 2020;27 doi: 10.1016/j.jbef.2020.100326. - DOI - PMC - PubMed
    1. Kartal M.T., Depren S.K., Depren Ö. How main stock exchange indices react to covid-19 pandemic: daily evidence from east asian countries. Global Econ. Rev. 2021;50(1):54–71. doi: 10.1080/1226508X.2020.1869055. - DOI
    1. Xu D. Canadian stock market volatility under COVID-19. Int. Rev. Econ. Finance. 2022;77:159–169.

LinkOut - more resources