Brazilian Stock Market Forecast with Heterogeneous Data Integration for a Set of Stocks

Authors

Keywords:

Financial market, Heterogeneous data, Natural Language Processing, Stock Exchange

Abstract

The significant growth of the Brazilian stock market, coupled with the increase in investors in riskier assets, has generated a demand for automated forecasting tools. This research investigated the behavior and movement of stocks in the Brazilian market by integrating historical price series and textual data extracted from sentiments in X old Twitter messages and news collected from Google News. The analysis used natural language processing techniques for sentiment analysis, enabling an efficient fusion between numerical and textual information. Experiments were carried out with the assets PETR4, VALE3, BBDC4, and ITUB4, applying the Long Short Term Memory, Deep Neural Network, and Linear Regression models to predict the behavior of these assets. The results indicated that the LSTM models, especially Model 2, presented the best performance in terms of predictive capacity, with the lowest values of RMSE 0.0171 and high values of coefficint of determination ranging from 0.9707 to 0.9873. The study concludes that integrating numerical and textual data, combined with deep learning techniques, offers a promising approach to stock market forecasting, increasing forecasting gains.

 

Downloads

Download data is not yet available.

Author Biographies

Michele Jackeline Andressa Rosa, Universidade do Vale do Rio dos Sinos - UNISINOS

Michele Jackeline Andressa Rosa received a PhD in Applied Computing from the University of Vale do Rio dos Sinos. Bachelor of Economic Sciences from the State University of Mato Grosso. Master’s degree in Regional Development and Agribusiness from the Federal University of Mato Grosso. MBA in Finance with emphasis on Capital Markets, Pitágoras University Unopar Anhanguera. Professor at State University of Mato Grosso and Economist.

Marcos Roberto Souza, Universidade do Vale do Rio dos Sinos - UNISINOS

Marcos Roberto Souza received a Bachelor in Computer Science from the University of Vale do Rio dos Sinos.

Carlos Leandro Silva Machado , Universidade do Vale do Rio dos Sinos - UNISINOS

Carlos Leandro Silva Machado received a Bachelor in Computer Science from the University of Vale do Rio dos Sinos.

Sandro José Rigo, Universidade do Vale do Rio dos Sinos - UNISINOS

Sandro José Rigo bachelor’s in computer science from the Pontifical Catholic University of Rio Grande do Sul. Master’s degree in computer science from the Federal University of Rio Grande do Sul. PhD in Computer Science from the Federal University of Rio Grande do Sul. Postdoctoral fellow at the Friedrich Alexander University in Erlangen-Nuremberg Germany. Professor at the University of Vale do Rio dos Sinos and researcher at the Graduate Program in Applied Computing.

Jorge Luis Victória Barbosa, Universidade do Vale do Rio dos Sinos - UNISINOS

Jorge Luis Victória Barbosa received MSc and a PhD in computer science from the Federal University of Rio Grande do Sul, Porto Alegre, Brazil. He conducted post-doctoral studies at Sungkyunkwan University, Suwon, South Korea. Jorge is a full professor at the Applied Computing Graduate Program of the University of Vale do Rio dos Sinos, head of the university’s Mobile Computing Lab, and a researcher at the Brazilian Council for Scientific and Technological Development. His main research interests are mobile and ubiquitous computing, context prediction using context histories, mainly through similarity and pattern analysis, and ubiquitous computing applications mainly in health, accessibility, and learning.

References

F. S. Alzazah e X. Cheng, “Chapter Recent Advances in Stock Market Prediction Using Text Mining: A Survey”, em E-Business - Higher Education and Intelligence Applications, London, United Kingdom: IntechOpen, 2020 [Online], 2021. doi: 10.5772/intechopen.92253.

F. Lemos, Technical Analysis of Financial Markets: A Complete and Definitive Guide to Asset Trading Methods, 3o ed. São Paulo, 2022.

A. Assaf Neto, financial market, 15o ed, vol. 15. Barueri: SP, 2021.

J. L. Pinheiro, Capital markets, 9o ed. São Paulo: Atlas, 2019.

H. F. Knight, Risk, uncertainty and profit. Hart, Schaffner and Marx, 1921.

P. da J. Silva, financial analysis of companies, 13o ed. São Paulo: Atlas, 2016.

G. Sismanoglu, M. A. Onde, F. Kocer, e O. K. Sahingoz, “Deep Learning Based Forecasting in Stock Market with Big Data Analytics”, em 2019 Scientific Meeting on Electrical-Electronics & Biomedical Engineering and Computer Science (EBBT), IEEE, abr. 2019, p. 1–4. doi: 10.1109/EBBT.2019.8741818.

L. Werner, C. Bisognin, e C. W. Araujo, “Analysis of forecasting techniques: a case study for the volume of Petrobras shares”, Brazilian Journal of Development, vol. 6, no 1, p. 1103–1115, 2020, doi: 10.34117/bjdv6n1-078.

B. Kaczorowski, M. Kleina, M. Augusto Mendes Marques, e W. de Assis Silva, “Artificial Intelligence and The Multivariate Approach In Predictive Analysis Of The Small Cap Index Of The Brazilian Stock Exchange”, IEEE Latin America Transactions, vol. 19, no 11, p. 1924–1932, nov. 2021, doi: 10.1109/TLA.2021.9475626.

S. Du, D. Hao, e X. Li, “Research on stock forecasting based on random forest”, em 2022 IEEE 2nd International Conference on Data Science and Computer Application (ICDSCA), IEEE, out. 2022, p. 301–305. doi: 10.1109/ICDSCA56264.2022.9987903.

B. Albaooth, “The Role of Artificial Intelligence Prediction in Stock Market Investors Decisions”, em 2023 IEEE Asia-Pacific Conference on Computer Science and Data Engineering (CSDE), IEEE, dez. 2023, p. 1–5. doi: 10.1109/CSDE59766.2023.10487719.

M. Korablyov, O. Fomichov, D. Antonov, S. Dykyi, I. Ivanisenko, e S. Lutskyy, “Hybrid stock analysis model for financial market forecasting”, em 2023 IEEE 18th International Conference on Computer Science and Information Technologies (CSIT), IEEE, out. 2023, p. 1–4. doi: 10.1109/CSIT61576.2023.10324069.

A. Carosia, “Using Machine Learning to Prevent Losses in the Brazilian Stock Market During the Covid-19 Pandemic”, IEEE Latin America Transactions, vol. 21, no 8, p. 867–873, ago. 2023, doi: 10.1109/TLA.2023.10246342.

A. Ruke, S. Gaikwad, G. Yadav, A. Buchade, S. Nimbarkar, e A. Sonawane, “Predictive Analysis of Stock Market Trends: A Machine Learning Approach”, em 2024 4th International Conference on Data Engineering and Communication Systems (ICDECS), IEEE, mar. 2024, p. 1–6. doi: 10.1109/ICDECS59733.2023.10503557.

I. K. Nti, A. F. Adekoya, e B. A. Weyori, “Predicting Stock Market Price Movement Using Sentiment Analysis: Evidence From Ghana”, Applied Computer Systems, vol. 25, no 1, p. 33–42, maio 2020, doi: 10.2478/acss-2020-0004.

G. Vargas, L. Silvestre, L. Rigo Júnior, e H. Rocha, “B3 Stock Price Prediction Using LSTM Neural Networks and Sentiment Analysis”, IEEE Latin America Transactions, vol. 20, no 7, p. 1067–1074, jul. 2022, doi: 10.1109/TLA.2021.9827469.

I. K. Nti, A. F. Adekoya, e B. A. Weyori, “A novel multi-source information-fusion predictive framework based on deep neural networks for accuracy enhancement in stock market prediction”, J Big Data, vol. 8, no 1, p. 17, dez. 2021, doi: 10.1186/s40537-020-00400-y.

J. Maqbool, P. Aggarwal, R. Kaur, A. Mittal, e I. A. Ganaie, “Stock Prediction by Integrating Sentiment Scores of Financial News and MLP-Regressor: A Machine Learning Approach”, Procedia Comput Sci, vol. 218, p. 1067–1078, 2023, doi: 10.1016/j.procs.2023.01.086.

L. Shi, Z. Teng, L. Wang, Y. Zhang, e A. Binder, “DeepClue: Visual interpretation of text-based deep stock prediction”, IEEE Trans Knowl Data Eng, vol. 31, no 6, p. 1094–1108, jun. 2019, doi: 10.1109/TKDE.2018.2854193.

X. Ding, Y. Zhang, T. Liu, e J. Duan, “Using Structured Events to Predict Stock Price Movement: An Empirical Investigation”, em Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), Stroudsburg, PA, USA: Association for Computational Linguistics, 2014, p. 1415–1425. doi: 10.3115/v1/D14-1148.

X. Ding, Y. Zhang, T. Liu, e J. Duan, “Deep Learning for Event-Driven Stock Prediction”, 24th. International Joint Conferences on Artificial Intelligence Organization - IJCAI, p. 2327–2333, 2015.

Y. Peng e H. Jiang, “Leverage Financial News to Predict Stock Price Movements Using Word Embeddings and Deep Neural Networks”, em Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Stroudsburg, PA, USA: Association for Computational Linguistics, 2016, p. 374–379. doi: 10.18653/v1/N16-1041.

X. Zhang, Y. Zhang, S. Wang, Y. Yao, B. Fang, e P. S. Yu, “Improving stock market prediction via heterogeneous information fusion”, Knowl Based Syst, vol. 143, p. 236–247, mar. 2018, doi: 10.1016/j.knosys.2017.12.025.

I. K. Nti, A. F. Adekoya, e B. A. Weyori, “Efficient Stock-Market Prediction Using Ensemble Support Vector Machine”, Open Computer Science, vol. 10, no 1, p. 153–163, jul. 2020, doi: 10.1515/comp-2020-0199.

X. Zhang, S. Qu, J. Huang, B. Fang, e P. Yu, “Stock Market Prediction via Multi-Source Multiple Instance Learning”, IEEE Access, vol. 6, p. 50720–50728, 2018, doi: 10.1109/ACCESS.2018.2869735.

X. Zhang, Y. Li, S. Wang, B. Fang, e P. S. Yu, “Enhancing stock market prediction with extended coupled hidden Markov model over multi-sourced data”, Knowl Inf Syst, vol. 61, no 2, p. 1071–1090, nov. 2019, doi: 10.1007/s10115-018-1315-6.

Q. Zhang, L. Yang, e F. Zhou, “Attention enhanced long short-term memory network with multi-source heterogeneous information fusion: An application to BGI Genomics”, Inf Sci (N Y), vol. 553, p. 305–330, abr. 2021, doi: 10.1016/J.INS.2020.10.023.

C. M. Bishop, Pattern recognition and machine learning. 2006.

M. Nabipour, P. Nayyeri, H. Jabani, S. S., e A. Mosavi, “Predicting Stock Market Trends Using Machine Learning and Deep Learning Algorithms Via Continuous and Binary Data; a Comparative Analysis”, IEEE Access, vol. 8, p. 150199–150212, 2020, doi: 10.1109/ACCESS.2020.3015966.

K. Joshi, B. H. N, e J. Rao, “Stock Trend Prediction Using News Sentiment Analysis”, International Journal of Computer Science and Information Technology, vol. 8, no 3, p. 67–76, jun. 2016, doi: 10.5121/ijcsit.2016.8306.

J. Briggs, “Sentiment Analysis for Stock Price Prediction in Python”, Towards Data Science. Accessed: June 10, 2024. [Online]. Available at: https://towardsdatascience.com/sentiment-analysis-for-stock-price-prediction-in-python-bed40c65d178

R. P. Schumaker e H. Chen, “Textual analysis of stock market prediction using breaking financial news”, ACM Trans Inf Syst, vol. 27, no 2, p. 1–19, fev. 2009, doi: 10.1145/1462198.1462204.

M. Honnibal e I. Montani, “spaCy 2: Natural language understanding with Bloom embeddings, convolutional neural networks and incremental parsing”. Accessed: August 10, 2024. [Online]. Available at: https://spacy.io/

R. J. A. Almeida, “LeIA - Léxico para Inferência Adaptada”, GitHub. Accessed: August 10, 2024. [Online]. Available at: https://github.com/rafjaa/LeIA

C. Hutto e E. Gilbert, “VADER: A Parsimonious Rule-Based Model for Sentiment Analysis of Social Media Text”, Proceedings of the International AAAI Conference on Web and Social Media, vol. 8, no 1, p. 216–225, maio 2014, doi: 10.1609/icwsm.v8i1.14550.

K. G. Kim, “Book Review: Deep Learning”, Healthc Inform Res, vol. 22, no 4, p. 351, 2016, doi: 10.4258/hir.2016.22.4.351.

H. Liu e Z. Long, “An improved deep learning model for predicting stock market price time series”, Digit Signal Process, vol. 102, p. 102741, jul. 2020, doi: 10.1016/j.dsp.2020.102741.

E. F. Fama, “Efficient Capital Markets: A Review of Theory and Empirical Work”, J Finance, vol. 25, no 2, p. 383, maio 1970, doi: 10.2307/2325486.

E. F. Fama, “Random Walks in Stock Market Prices”, Financial Analysts Journal, p. 55–59, 1965, Acessado: 5 de março de 2022. [Online]. Disponível em: https://www.jstor.org/stable/4469865

M. Statman, “Behavioral Finance versus Standard Finance”, AIMR Conference Proceedings, vol. 1995, no 7, p. 14–22, dez. 1995, doi: 10.2469/cp. v1995.n7.4.

R. H. Thaler, “Behavioral Economics: Past, Present, and Future”, American Economic Review, vol. 106, no 7, p. 1577–1600, jul. 2016, doi: 10.1257/aer.106.7.1577.

B. G. Malkiel e E. F. Fama, “Efficient Capital Markets: A Review of Theory and Empirical Work”, J Finance, vol. 25, no 2, p. 383–417, maio 1970, doi: 10.1111/j.1540-6261. 1970.tb00518. x.

E. F. Fama, “Efficient Capital Markets: II”, J Finance, vol. 46, no 5, p. 1575–1617, dez. 1991, doi: 10.1111/j.1540-6261. 1991.tb04636. x.

Y. Juwono, R. Sarno, R. N. E. Anggraini, A. T. Haryono and A. F. Septiyanto, “Comparative Study on Stock Price Forecasting Using Deep Learning Method Based on Combination Dataset,” IEEE International Conference on Artificial Intelligence, 2024, doi: 10.1109/AIMS61812.2024.10513288.

S. Russell, P. Norvig. Artificial intelligence. Translation: Regina Célia Simille. Rio de Janeiro: Elsevier, 2013.

Hochreiter, S., Schmidhuber, J., Long Short-Term Memory, Neural Computation (1997) 9 (8): 1735–1780. 1997. doi: 10.1162/neco.1997.9.8.1735

Published

2025-06-12

How to Cite

Rosa, M. J. A., Souza, M. R. ., Silva Machado , C. L. ., Rigo, S. J. ., & Barbosa, J. L. V. . (2025). Brazilian Stock Market Forecast with Heterogeneous Data Integration for a Set of Stocks. IEEE Latin America Transactions, 23(7), 572–583. Retrieved from https://latamt.ieeer9.org/index.php/transactions/article/view/9184