Application of machine learning algorithm to predict the behavior of stocks marketed in Brazil

Authors

  • Gabriel Donadio Costa Universidade Federal de Santa Catarina - UFSC

    Doutorando pela Universidade Federal de Santa Catarina - UFSC. Mestre em Contabilidade, Fiscalidade e Finanças Empresariais pela Universidade de Lisboa - ULISBOA.

  • Rogério João Lunkes Universidade Federal de Santa Catarina - UFSC

    Doutor e Mestre em Engenharia de Produção pela Universidade Federal de Santa Catarina - UFSC. Professor do Departamento de Ciências Contábeis, Universidade Federal de Santa Catarina, UFSC.

DOI:

https://doi.org/10.18800/contabilidad.2025ESP.002

Keywords:

Machine Learning, Portfolio Selection, Technical Analysis, Fundamental Analysis

Abstract

Modern economy offers several investment options, making capital assignments complex, slow and risky. In order to assist investors in the decision-making process, artificial intelligence tools aim at finding patterns hidden in data and providing useful, timely and accurate information. This work analyzes the application of machine learning algorithms in the selection of portfolios in the Brazilian market. Recent research intended to predict the stock market behavior implementing machine learning with conventional methods such as technical or fundamental analysis (Anghel, 2021; Kamara et al., 2022; Nti et al., 2020b); while few combine analyses in emerging and volatile markets like Brazil. Thus, three machine learning models were trained using variables from the technical and/or fundamental analysis. The sample included 40,562 observations from six companies listed on B3, from August 1994 to December 2021. Models trained only with fundamental or technical variables evidenced low accuracy, which was translated into low learning and generalization capacity of the algorithm. In contrast, the model including the combination of technical and fundamental variables revealed an average accuracy of 70,7 % on 5 folds, which was supported by the literature that indicates that hybrid models can provide greater accuracy and lower volatility. In addition, results exceed the accuracy of previous studies (e.g. Emir et al., 2012; Kim, 2003; Zhang & Zhao, 2009), which indicates that the Support Vector Machine - SVM can also be applied to emerging markets, even in crisis times, such as COVID-19 pandemic.

Downloads

Download data is not yet available.

Published

2025-07-03

How to Cite

Donadio Costa, G., & Lunkes, R. J. (2025). Application of machine learning algorithm to predict the behavior of stocks marketed in Brazil. Contabilidad Y Negocios, 48–70. https://doi.org/10.18800/contabilidad.2025ESP.002