Skip to main content
Log in

1D convolutional neural networks for chart pattern classification in financial time series

  • Published:
The Journal of Supercomputing Aims and scope Submit manuscript

Abstract

This paper proposes a novel deep learning-based approach for financial chart patterns classification. Convolutional neural networks (CNNs) have made notable achievements in image recognition and computer vision applications. These networks are usually based on two-dimensional convolutional neural networks (2D CNNs). In this paper, we describe the design and implementation of one-dimensional convolutional neural networks (1D CNNs) for the classification of chart patterns from financial time series. The proposed 1D CNN model is compared against support vector machine, extreme learning machine, long short-term memory, rule-based and dynamic time warping. Experimental results on synthetic datasets reveal that the accuracy of 1D CNN is highest among all the methods evaluated. Results on real datasets also reveal that chart patterns identified by 1D CNN are also the most recognized instances when they are compared to those classified by other methods.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12

Similar content being viewed by others

Availability of data and material

Not applicable

Notes

  1. finance.yahoo.com

References

  1. Berndt DJ, Clifford J (1994) Using dynamic time warping to find patterns in time series. In: KDD workshop, 10, 359–370. Seattle, WA

  2. Boser BE, Guyon IM, Vapnik VN (1992) A training algorithm for optimal margin classifiers. In: Proceedings of the fifth annual workshop on Computational learning theory, pp 144–152. ACM

  3. Bai S, Kolter JZ, Koltun V (2018) An empirical evaluation of generic convolutional and recurrent networks for sequence modeling. arXiv preprint arXiv:1803.01271

  4. Bulkowski TN (2011) Encyclopedia of chart patterns, 2nd edn. John Wiley & Sons

  5. Cohen N, Balch T, Veloso M (2020) Trading via image classification. In: Proceedings of the First ACM International Conference on AI in Finance, ICAIF ’20, New York, NY, USA. Association for Computing Machinery

  6. Cheng C-S, Ho Y, Chiu T-C (2021) End-to-end control chart pattern classification using a 1d convolutional neural network and transfer learning. Processes, 9(9)

  7. Cristianini Nello, Ricci Elisa (2008) Support vector machines: 1992; boser, guyon, vapnik. Encyclopedia of Algorithms, pp 928–932

  8. Chen J-H Tsai Y-C 2020) Encoding candlesticks as images for pattern classification using convolutional neural networks. Financial Innovation 6

  9. Cortes C, Vapnik V (June 17 1997). Soft margin classifier. US Patent 5,640,492

  10. Fu Tak-chung, Chung Fu-lai, Luk Robert, Ng Chak-man (2007) Stock time series pattern matching: template-based vs. rule-based approaches. Eng Appl Artif Intell 20(3):347–364

    Article  Google Scholar 

  11. Fawaz HI, Forestier G, Weber J, Idoumghar L, Muller PA (2019) Deep learning for time series classification: a review. Data Min Knowl Discov 33(4):917–963

    Article  MathSciNet  Google Scholar 

  12. Graves A (2012) Supervised sequence labelling with recurrent neural networks. 2012. URL http://books.google.com/books

  13. Graves Alex, Schmidhuber Jürgen (2005) Framewise phoneme classification with bidirectional lstm and other neural network architectures. Neural netw 18(5–6):602–610

    Article  Google Scholar 

  14. Gong Xueyuan, Si Yain-Whar, Fong Simon, Biuk-Aghai Robert P (2016) Financial time series pattern matching with extended ucr suite and support vector machine. Expert Syst Appl 55:284–296

    Article  Google Scholar 

  15. Gu Jiuxiang, Wang Zhenhua, Kuen Jason, Ma Lianyang, Shahroudy Amir, Shuai Bing, Liu Ting, Wang Xingxing, Wang Gang, Cai Jianfei et al (2018) Recent advances in convolutional neural networks. Pattern Recognit 77:354–377

    Article  Google Scholar 

  16. Hussain M, Haque MA et al. (2018) Swishnet: a fast convolutional neural network for speech, music and noise classification and segmentation. arXiv preprint arXiv:1812.00149

  17. Hochreiter S, Schmidhuber J (1997) Lstm can solve hard long time lag problems. In: Advances in neural information processing systems, pp 473–479

  18. Hu W, Si YW, Fong S, Lau RYK (2019) A formal approach to candlestick pattern classification in financial time series. Appl Soft Comput 84:105700

    Article  Google Scholar 

  19. Huang GB, Zhu QY, Siew CK et al (2004) Extreme learning machine: a new learning scheme of feedforward neural networks. Neural Netw 2:985–990

    Google Scholar 

  20. Kiranyaz S, Avci O, Abdeljaber O, Ince T, Gabbouj M, Inman DJ (2019) 1D convolutional neural networks and applications: a survey. arXiv preprint arXiv:1905.03554

  21. Krizhevsky A, Sutskever I, Hinton GE (2012) Imagenet classification with deep convolutional neural networks. In: Advances in neural information processing systems, pp 1097–1105

  22. Kaya C, Yilmaz A, Uzun GN, Kilimci ZH (2020) Stock pattern classification from charts using deep learning algorithms. In: 8th International symposium on innovative technologies in engineering and science, pp 445–454

  23. LeCun Y et al. (2015) Lenet-5, convolutional neural networks. URL: http://yann.lecun.com/exdb/lenet, 20:5

  24. LeCun Y, Bengio Y et al (1995) Convolutional networks for images, speech, and time series. Handbook Brain Theory Neural Netw 3361(10):1995

  25. Lin Y, Liu S, Yang H, Wu H, Jiang B (2021) Improving stock trading decisions based on pattern recognition using machine learning technology. PLOS ONE 16(8):1–25

    Google Scholar 

  26. Murphy JJ (1999) Technical analysis of the financial markets: a comprehensive guide to trading methods and applications. Penguin

  27. Moghaddam AH, Momtazi S (2021) Image processing meets time series analysis: predicting forex profitable technical pattern positions. Appl Soft Comput 108:107460

    Article  Google Scholar 

  28. Oord AVD, Dieleman S, Zen H, Simonyan K, Vinyals O, Graves A, Kalchbrenner N, Senior A, Kavukcuoglu K (2016) Wavenet: a generative model for raw audio. arXiv preprintarXiv:1609.03499

  29. Rakthanmanon T, Campana B, Mueen A, Batista G, Westover B, Zhu Q, Zakaria J, Keogh E (2012) Searching and mining trillions of time series subsequences under dynamic time warping. In: Proceedings of the 18th ACM SIGKDD international conference on Knowledge discovery and data mining, pp 262–270. ACM

  30. Supratak A, Dong H, Wu C, Guo Y (2017) Deepsleepnet: a model for automatic sleep stage scoring based on raw single-channel eeg. IEEE Trans Neural Syst Rehabil Eng 25(11):1998–2008

    Article  Google Scholar 

  31. Szegedy C, Liu W, Jia Y, Sermanet P, Reed S, Anguelov D, Erhan D, Vanhoucke V, Rabinovich A (2015) Going deeper with convolutions. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp 1–9

  32. Simonyan K, Zisserman A (2014) Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556

  33. Ulyanov D, Vedaldi A, Lempitsky V (2016) Instance normalization: the missing ingredient for fast stylization. arXiv preprint arXiv:1607.08022

  34. Wang Z, Oates T (2015) Encoding time series as images for visual inspection and classification using tiled convolutional neural networks. In: Workshops at the Twenty-Ninth AAAI Conference on Artificial Intelligence

  35. Wan Y, Si YW (2017) Adaptive neuro fuzzy inference system for chart pattern matching in financial time series. Appl Soft Comput 57:1–18

    Article  Google Scholar 

  36. Wan Y, Si YW (2017) A formal approach to chart patterns classification in financial time series. Inf Sci 411:151–175

    Article  Google Scholar 

  37. Wan Y, Yw Si (2018) A hidden semi-markov model for chart pattern matching in financial time series. Soft Comput 22(19):6525–6544

    Article  Google Scholar 

  38. www.tradingview.com. Tradingview. Accessed January 23, 2021

  39. Xu C (2021) Image-based candlestick pattern classification with machine learning. In: 2021 6th International Conference on Machine Learning Technologies, ICMLT 2021, pp 26-33, New York, NY, USA. Association for Computing Machinery

  40. Zhang Z, Jiang J, Liu X, Lau R, Wang H, Zhang R (2010) A real time hybrid pattern matching scheme for stock time series. In Proceedings of the Twenty-First Australasian Conference on Database Technologies-Volume 104, pp 161–170. Australian Computer Society, Inc

Download references

Funding

This research was funded by the University of Macau (File no. MYRG2019-00136-FST).

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Yain-Whar Si.

Ethics declarations

Conflict of interest

The authors declare that there are no conflicts of interest.

Code availability

Not applicable

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Liu, L., Si, YW. 1D convolutional neural networks for chart pattern classification in financial time series. J Supercomput 78, 14191–14214 (2022). https://doi.org/10.1007/s11227-022-04431-5

Download citation

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11227-022-04431-5

Keywords

Navigation