Predicting Bullish Reversals with LightGBM: A Systematic Trading Strategy for Brazilian Equities
Resumo
Predicting stock market behavior is a complex challenge. This article presents an automated trading system based on machine learning, focused on identifying bullish reversals in the Brazilian financial market. The methodology combines technical and sectoral indicators, the LightGBM classifier, signal post-processing with non-maximum suppression, and backtesting with ATR-based risk management. Evaluated on assets representing different sectors of the economy (ABEV3, GGBR4, ITUB4, and VIVT3), the approach achieved PR-AUC values ranging from 0.955 to 0.979, win rates between 54.8% and 78.6%, and average returns per trade between 2.20% and 5.08%, consistently outperforming the buy-and-hold benchmark.
Referências
Bailey, D. H., Borwein, J. M., De Prado, M. L., and Zhu, Q. J. (2014). Pseudomathematics and financial charlatanism: The effects of backtest over fitting on out-of-sample performance. Notices of the AMS, 61(5):458–471.
Bergmeir, C., Hyndman, R. J., and Koo, B. (2018). A note on the validity of cross-validation for evaluating autoregressive time series prediction. Computational Statistics & Data Analysis, 120:70–83.
Brandi, V. R. (2021). Predictability of stock market indexes following large drawdowns and drawups. Brazilian Review of Finance, 19(1):1–23.
Chan, E. P. (2026). Quantitative trading: how to build your own algorithmic trading business. John Wiley & Sons.
Davis, J. and Goadrich, M. (2006). The relationship between precision-recall and roc curves. In Proceedings of the 23rd international conference on Machine learning, pages 233–240.
De Prado, M. L. (2018). Advances in financial machine learning. John Wiley & Sons.
Edwards, R. D., Magee, J., and Bassetti, W. C. (2018). Technical analysis of stock trends. CRC press.
Fawcett, T. (2006). An introduction to roc analysis. Pattern recognition letters, 27(8):861–874.
Guo, Y., Li, Y., and Xu, Y. (2021). Study on the application of lstm-lightgbm model in stock rise and fall prediction. In MATEC Web of Conferences, volume 336, page 05011. EDP Sciences.
Gupta, V. and Kumar, E. (2023). H3o-lgbm: hybrid harris hawk optimization based light gradient boosting machine model for real-time trading. Artificial Intelligence Review, 56(8):8697–8720.
Hancock, J., Johnson, J. M., and Khoshgoftaar, T. M. (2022). A comparative approach to threshold optimization for classifying imbalanced data. In 2022 IEEE 8th International Conference on Collaboration and Internet Computing (CIC), pages 135–142. IEEE.
Ke, G., Meng, Q., Finley, T., Wang, T., Chen, W., Ma, W., Ye, Q., and Liu, T.-Y. (2017). Lightgbm: A highly efficient gradient boosting decision tree. Advances in neural information processing systems, 30.
Lopes de Amorim, T., Callou, G., and Sena dos Santos, A. (2024). Compra e venda de ações negociadas na b3 utilizando lstm: análise de tendência e stop. GESTÃO. Org: Revista Eletrônica de Gestão Organizacional, 22(1).
Neubeck, A. and Van Gool, L. (2006). Efficient non-maximum suppression. In 18th international conference on pattern recognition (ICPR’06), volume 3, pages 850–855. Ieee.
Provost, F. and Fawcett, T. (2001). Robust classification for imprecise environments. Machine learning, 42(3):203–231.
Sharpe, W. F. (1966). Mutual fund performance. The Journal of business, 39(1):119–138.
Vezeris, D., Kyrgos, T., and Schinas, C. (2018). Take profit and stop loss trading strategies comparison in combination with an macd trading system. Journal of risk and financial management, 11(3):56.
Wilder, J. W. (1978). New concepts in technical trading systems. Greensboro, NC.
Yang, Y., Wu, Y., Wang, P., and Jiali, X. (2021). Stock price prediction based on xgboost and lightgbm. In E3s web of conferences, volume 275, page 01040. EDP Sciences.
Yuvaraj, S., Kumaran, J. C., Benschwartz, R., and Pradeepa, M. (2025). Technical indicator-driven stock prediction: A lightgbm and arima perspective. In 2025 3rd International Conference on Intelligent Data Communication Technologies and Internet of Things (IDCIoT), pages 46–52. IEEE.
Zhao, X., Liu, Y., and Zhao, Q. (2023). Cost harmonization lightgbm-based stock market prediction. Ieee Access, 11:105009–105026.
Zhao, X., Liu, Y., and Zhao, Q. (2024). Improved lightgbm for extremely imbalanced data and application to credit card fraud detection. IEEE Access, 12:159316–159335.
Zhou, W., Jumahong, H., Cui, R., Wu, Y., Jing, C., and Lin, L. (2024). Predicting stock trends using web semantics and feature fusion. International Journal on Semantic Web and Information Systems (IJSWIS), 20(1):1–25.
