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.












Similar content being viewed by others
Availability of data and material
Not applicable
Notes
finance.yahoo.com
References
Berndt DJ, Clifford J (1994) Using dynamic time warping to find patterns in time series. In: KDD workshop, 10, 359–370. Seattle, WA
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
Bai S, Kolter JZ, Koltun V (2018) An empirical evaluation of generic convolutional and recurrent networks for sequence modeling. arXiv preprint arXiv:1803.01271
Bulkowski TN (2011) Encyclopedia of chart patterns, 2nd edn. John Wiley & Sons
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
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)
Cristianini Nello, Ricci Elisa (2008) Support vector machines: 1992; boser, guyon, vapnik. Encyclopedia of Algorithms, pp 928–932
Chen J-H Tsai Y-C 2020) Encoding candlesticks as images for pattern classification using convolutional neural networks. Financial Innovation 6
Cortes C, Vapnik V (June 17 1997). Soft margin classifier. US Patent 5,640,492
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
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
Graves A (2012) Supervised sequence labelling with recurrent neural networks. 2012. URL http://books.google.com/books
Graves Alex, Schmidhuber Jürgen (2005) Framewise phoneme classification with bidirectional lstm and other neural network architectures. Neural netw 18(5–6):602–610
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
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
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
Hochreiter S, Schmidhuber J (1997) Lstm can solve hard long time lag problems. In: Advances in neural information processing systems, pp 473–479
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
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
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
Krizhevsky A, Sutskever I, Hinton GE (2012) Imagenet classification with deep convolutional neural networks. In: Advances in neural information processing systems, pp 1097–1105
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
LeCun Y et al. (2015) Lenet-5, convolutional neural networks. URL: http://yann.lecun.com/exdb/lenet, 20:5
LeCun Y, Bengio Y et al (1995) Convolutional networks for images, speech, and time series. Handbook Brain Theory Neural Netw 3361(10):1995
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
Murphy JJ (1999) Technical analysis of the financial markets: a comprehensive guide to trading methods and applications. Penguin
Moghaddam AH, Momtazi S (2021) Image processing meets time series analysis: predicting forex profitable technical pattern positions. Appl Soft Comput 108:107460
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
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
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
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
Simonyan K, Zisserman A (2014) Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556
Ulyanov D, Vedaldi A, Lempitsky V (2016) Instance normalization: the missing ingredient for fast stylization. arXiv preprint arXiv:1607.08022
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
Wan Y, Si YW (2017) Adaptive neuro fuzzy inference system for chart pattern matching in financial time series. Appl Soft Comput 57:1–18
Wan Y, Si YW (2017) A formal approach to chart patterns classification in financial time series. Inf Sci 411:151–175
Wan Y, Yw Si (2018) A hidden semi-markov model for chart pattern matching in financial time series. Soft Comput 22(19):6525–6544
www.tradingview.com. Tradingview. Accessed January 23, 2021
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
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
Funding
This research was funded by the University of Macau (File no. MYRG2019-00136-FST).
Author information
Authors and Affiliations
Corresponding author
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
About this article
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
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s11227-022-04431-5