YOLO-Based Detection of Buy and Sell Signals in Candlestick Charts with Moving Averages
Abstract
In stock trading, identifying trends is essential. Candlestick charts show price variations while moving averages help smooth these fluctuations and highlight trends. Some works focus on event detection in candlestick charts but without using moving averages. In this study, we investigate whether incorporating semantic information from moving averages into candlestick chart analysis can enhance the detection of buy and sell signals. The proposed approach includes image generation, data augmentation, labeling, and signal identification in short-term trading scenarios. We conducted experiments using four versions of YOLO (v3, v8, v9, and v11). Compared to previous work that did not use moving averages, our results were significantly better regarding F1-Score (up to 0.06 higher) and recall (up to 0.18 higher).References
Birogul, S., Temur, G., and Kose, U. (2020). Yolo object recognition algorithm and ’buy-sell decision’ model over 2d candlestick charts. Journal of Artificial Intelligence and Data Mining, 8(1):45–54.
Chen, J.-H. and Tsai, Y.-C. (2020). Encoding candlesticks as images for pattern classification using convolutional neural networks. Financial Innovation, 6(1):1–20.
Chen, L., Zhao, M., and Huang, R. (2024). Yolov11: Hybrid transformer-cnn architecture for robust object detection. arXiv preprint arXiv:2403.01987.
Cohen, G. (2021). Optimizing candlestick patterns for bitcoin trading strategies. Review of Quantitative Finance and Accounting, 57:987–1012.
Hu, Q., Xu, J., Luo, J., and Fan, Y. (2019). Formal specifications of candlestick patterns for technical analysis. Applied Soft Computing, 85:105700.
Koirala, A., Walsh, K. B., Wang, Z., and McCarthy, C. (2019). Deep learning–method overview and review of use for fruit detection and yield estimation. Computers and electronics in agriculture, 162:219–234.
Leal, I., Jayson, A., Lira, R., Veloso, R., Oseas, A., and Benjamin, M. (2024). Automatic cattle detection and counting system in aerial images using computer vision algorithms. In Encontro Nacional de Inteligência Artificial e Computacional (ENIAC), pages 472–483. SBC.
Marshall, B. R., Young, E., and Cahan, R. H. (2006). Candlestick technical trading strategies: Can they create value for investors? The Journal of Financial Research, 29(3):305–316.
Neto, A. F. L., de Medeiros Santos, A., and Fernandes, S. (2023). Leaf detection using yolov4 for phytopathogenic diagnosis. In Encontro Nacional de Inteligência Artificial e Computacional (ENIAC), pages 866–879. SBC.
Pires, V. C., Palmeira, E. S., and dos Santos, F. A. (2023). Application of deep learning techniques to depth images for person tracking and detection. In Encontro Nacional de Inteligência Artificial e Computacional (ENIAC), pages 272–284. SBC.
Redmon, J., Divvala, S., Girshick, R., and Farhadi, A. (2016). You only look once: Unified, real-time object detection. In IEEE conference on computer vision and pattern recognition, pages 779–788.
Redmon, J. and Farhadi, A. (2018). Yolov3: An incremental improvement. arXiv preprint arXiv:1804.02767.
Sezer, O. B. and Ozbayoglu, A. M. (2020). Financial trading model with stock bar chart image time series with deep convolutional neural networks. Financial Innovation, 6(1):1–17.
Temur, G., Birogul, S., and Kose, U. (2024). Comparison of stock “trading” decision support systems based on object recognition algorithms on candlestick charts. IEEE Access, 12:35121–35132.
Thammakesorn, S. and Sornil, O. (2019). Candlestick pattern-based trading strategy using chaid. In Journal of Physics: Conference Series, volume 1195, page 012008. IOP Publishing.
Thomas, N. B. (2012). Encyclopedia of candlestick charts.
Ultralytics (2023). Yolov8 — ultralytics official documentation. Online; accessed 202505-14. [link].
Wang, C., Li, X., and Zhang, Y. (2023). Yolov9: Transformer-based label assignment for dense object detection. arXiv preprint arXiv:2310.12345.
Zhang, R., Zhao, C., and Lin, G. (2023). Interpretable image-based deep learning for price trend prediction in etf markets. Quantitative Finance.
Zhao, Z.-Q., Zheng, P., Xu, S.-t., and Wu, X. (2019). Object detection with deep learning: A review. IEEE transactions on neural networks and learning systems, 30(11):3212–3232.
Zou, Z., Chen, K., Shi, Z., Guo, Y., and Ye, J. (2023). Object detection in 20 years: A survey. Proceedings of the IEEE, 111(3):257–276.
Chen, J.-H. and Tsai, Y.-C. (2020). Encoding candlesticks as images for pattern classification using convolutional neural networks. Financial Innovation, 6(1):1–20.
Chen, L., Zhao, M., and Huang, R. (2024). Yolov11: Hybrid transformer-cnn architecture for robust object detection. arXiv preprint arXiv:2403.01987.
Cohen, G. (2021). Optimizing candlestick patterns for bitcoin trading strategies. Review of Quantitative Finance and Accounting, 57:987–1012.
Hu, Q., Xu, J., Luo, J., and Fan, Y. (2019). Formal specifications of candlestick patterns for technical analysis. Applied Soft Computing, 85:105700.
Koirala, A., Walsh, K. B., Wang, Z., and McCarthy, C. (2019). Deep learning–method overview and review of use for fruit detection and yield estimation. Computers and electronics in agriculture, 162:219–234.
Leal, I., Jayson, A., Lira, R., Veloso, R., Oseas, A., and Benjamin, M. (2024). Automatic cattle detection and counting system in aerial images using computer vision algorithms. In Encontro Nacional de Inteligência Artificial e Computacional (ENIAC), pages 472–483. SBC.
Marshall, B. R., Young, E., and Cahan, R. H. (2006). Candlestick technical trading strategies: Can they create value for investors? The Journal of Financial Research, 29(3):305–316.
Neto, A. F. L., de Medeiros Santos, A., and Fernandes, S. (2023). Leaf detection using yolov4 for phytopathogenic diagnosis. In Encontro Nacional de Inteligência Artificial e Computacional (ENIAC), pages 866–879. SBC.
Pires, V. C., Palmeira, E. S., and dos Santos, F. A. (2023). Application of deep learning techniques to depth images for person tracking and detection. In Encontro Nacional de Inteligência Artificial e Computacional (ENIAC), pages 272–284. SBC.
Redmon, J., Divvala, S., Girshick, R., and Farhadi, A. (2016). You only look once: Unified, real-time object detection. In IEEE conference on computer vision and pattern recognition, pages 779–788.
Redmon, J. and Farhadi, A. (2018). Yolov3: An incremental improvement. arXiv preprint arXiv:1804.02767.
Sezer, O. B. and Ozbayoglu, A. M. (2020). Financial trading model with stock bar chart image time series with deep convolutional neural networks. Financial Innovation, 6(1):1–17.
Temur, G., Birogul, S., and Kose, U. (2024). Comparison of stock “trading” decision support systems based on object recognition algorithms on candlestick charts. IEEE Access, 12:35121–35132.
Thammakesorn, S. and Sornil, O. (2019). Candlestick pattern-based trading strategy using chaid. In Journal of Physics: Conference Series, volume 1195, page 012008. IOP Publishing.
Thomas, N. B. (2012). Encyclopedia of candlestick charts.
Ultralytics (2023). Yolov8 — ultralytics official documentation. Online; accessed 202505-14. [link].
Wang, C., Li, X., and Zhang, Y. (2023). Yolov9: Transformer-based label assignment for dense object detection. arXiv preprint arXiv:2310.12345.
Zhang, R., Zhao, C., and Lin, G. (2023). Interpretable image-based deep learning for price trend prediction in etf markets. Quantitative Finance.
Zhao, Z.-Q., Zheng, P., Xu, S.-t., and Wu, X. (2019). Object detection with deep learning: A review. IEEE transactions on neural networks and learning systems, 30(11):3212–3232.
Zou, Z., Chen, K., Shi, Z., Guo, Y., and Ye, J. (2023). Object detection in 20 years: A survey. Proceedings of the IEEE, 111(3):257–276.
Published
2025-09-29
How to Cite
SANTOS, Marco Antonio Sousa; SILVA, Adriano Rivolli da; ORTONCELLI, André Roberto.
YOLO-Based Detection of Buy and Sell Signals in Candlestick Charts with Moving Averages. In: NATIONAL MEETING ON ARTIFICIAL AND COMPUTATIONAL INTELLIGENCE (ENIAC), 22. , 2025, Fortaleza/CE.
Anais [...].
Porto Alegre: Sociedade Brasileira de Computação,
2025
.
p. 403-414.
ISSN 2763-9061.
DOI: https://doi.org/10.5753/eniac.2025.12471.
