Skip to main content
Log in

Convolutional neural network for stock trading using technical indicators

  • Published:
Automated Software Engineering Aims and scope Submit manuscript

Abstract

Stock market prediction is a very hot topic in financial world. Successful prediction of stock market movement may promise high profits. However, an accurate prediction of stock movement is a highly complicated and very difficult task because there are many factors that may affect the stock price such as global economy, politics, investor expectation and others. Several non-linear models such as Artificial Neural Network, fuzzy systems and hybrid models are being used for forecasting stock market. These models have limitations like slow convergence and overfitting problem. To solve the aforementioned issues, this paper intends to develop a robust stock trading model using deep learning network. In this paper, a stock trading model by integrating Technical Indicators and Convolutional Neural Network (TI-CNN) is developed and implemented. The stock data investigated in this work were collected from publicly available sources. Ten technical indicators are extracted from the historical data and taken as feature vectors. Subsequently, feature vectors are converted into an image using Gramian Angular Field and fed as an input to the CNN. Closing price of stock data are manually labelled as sell, buy, and hold points by determining the top and bottom points in a sliding window. The duration considered over a period from January 2009 to December 2018. Prediction ability of the developed TI-CNN model is tested on NASDAQ and NYSE data. Performance indicators such as accuracy and F1 score are calculated and compared to prove effectiveness of the proposed stock trading model. Experimental results demonstrate that the proposed TI-CNN achieves high prediction accuracy than that of the earlier models considered for comparison.

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

Similar content being viewed by others

References

  • Atsalakis, G.S., Valavanis, K.P.: Surveying stock market forecasting techniques–Part II: Soft computing methods. Expert Syst. Appl. 36, 5932–5941 (2009). https://doi.org/10.1016/j.eswa.2008.07.006

    Article  Google Scholar 

  • Bao, W., Yue, J., Rao, Y.: A deep learning framework for financial time series using stacked autoencoders and long-short term memory. PLoS One (2017). https://doi.org/10.1371/journal.pone.0180944

    Article  Google Scholar 

  • Caley, J.A.: A survey of systems for predicting stock market movements, combining market indicators and machine learning classifiers. Dissertations and Theses (2013)

  • Chandar, S.K.: Fusion model of wavelet transform and adaptive neuro fuzzy interference system for stock market prediction. J. Ambient Intell. Humaniz. Comput. (2019). https://doi.org/10.1007/s12652-019-01224-2

    Article  Google Scholar 

  • Chandar, S.K., Sumathi, M., Sivanandam, S.N.: Prediction of stock market using hybrid of wavelet transform and artificial neural network. Indian J. Sci. Technol. (2016). https://doi.org/10.17485/ijst/2016/v9i8/87905

    Article  Google Scholar 

  • Chen, S., He, H.:Stock prediction using convolutional neural network. In: IOP Conference Series in Material Science and Engineering,435 (2018)

  • Chen, J.L., Lai, K.L.: Deep convolution neural network model for credit-card fraud detection and alert. J. Artif Intell 3(02), 101–112 (2021)

    Google Scholar 

  • Chung, H., Shin, K.S.: Genetic algorithm-optimized long short-term memory network for stock market prediction. Sustainability MDPI 10(10), 3765 (2018)

    Article  Google Scholar 

  • Damaševicius, R., Maskeliunas, R., ozniak, M., Polap, D.: Visualization of physiologic signals based on Hjorth parameters and gramian angular fields. In: IEEE 16th World Symposium on Applied Machine Intelligence and Informatics. (2018)

  • Dhaya, R.: Hybrid machine learning approach to detect the changes in SAR images for salvation of spectral constriction problem. J. Innov. Image Process. (JIIP) 3(02), 118–130 (2021a)

    Article  Google Scholar 

  • Dhaya, R.: Light weight CNN based robust image watermarking scheme for security. J. Inf. Technol. Digit World 3(2), 118–132 (2021b)

    Article  Google Scholar 

  • Gao, T., Chai, Y.: Improving stock closing price prediction using recurrent neural networks and technical indicators. Neural Comput. 30(10), 2833–2854 (2018). https://doi.org/10.1162/neco_a_01124

    Article  MathSciNet  MATH  Google Scholar 

  • Graves, A., Mohamed, A.R., Hinton, G.: Speech recognition with deep recurrent neural networks. In Proceedings of the IEEE International Conference on Acoustics, Speech and Signal Processing (icassp). pp. 6645–6649 (2013)

  • Hiransha, M., Gopalakrishanan, E.A., Menon, V.K., Soman, K.P.: NSE stock market prediction using deep learning models. Procedia Comput. Sci. 132, 1351–1362 (2018). https://doi.org/10.1016/j.procs.2018.05.050

    Article  Google Scholar 

  • https://finance.yahoo.com/

  • Kara, Y., Boyacioglu, M.A., Baykan, Ö.K.: Predicting direction of stock price index movement using artificial neural networks and support vector machines: The sample of the istanbul stock exchange. Expert Syst. Appl. 38, 5311–5319 (2011). https://doi.org/10.1016/j.eswa.2010.10.027

    Article  Google Scholar 

  • Khalajzadeh, H., Manthouri, M., Teshnehlab, M.: Face recognition using convolutional neural networks and simple logistic classifier. Adv. Intell. Syst. Comput. 223, 197–207 (2014)

    Google Scholar 

  • Kim, Y.: Convolutional neural networks for sentence classification. arXiv preprint arXiv:1408.5882 (2014)

  • Kim, T., Kim, H.Y.: Forecasting stock prices with a feature fusion LSTM-CNN model using different representations of the same data. PloS ONE (2019). https://doi.org/10.1371/journal.pone.0212320

    Article  Google Scholar 

  • Majhi, B., Rout, M., Baghel, V.: On the development and performance evaluation of a multi objective GA based RBF adaptive model for the prediction of stock indices. J. King Saud Univ. Comput. Inf. Sci. 26, 319–331 (2014). https://doi.org/10.1016/j.jksuci.2013.12.005

    Article  Google Scholar 

  • Nelson, D.M.Q., Pereira, A.C.M., De Oliveira, R.A.: Stock market price movement prediction with LSTM neural networks. In: International Joint Conference on Neural Networks. Pp. 1419–1426 (2017). https://doi.org/10.1109/IJCNN.2017.7966019

  • Rout, M., Majhi, B., Majhi, R., Panda, G.: Forecasting currency exchange rates using an adaptive ARMA model with differential evolution-based training. J. King Saud Univ. Comput. Inf. Sci. 26, 7–18 (2014). https://doi.org/10.1016/j.jksuci.2013.01.002

    Article  Google Scholar 

  • Selvin, S., Vinayakumar, R., Gopalakrishnan, E.A., Menon, V.K Soman, K.P.:Stock price prediction using lstm,rnn and cnn-sliding window model. In: Proceedings of the International Conference on Advances in Computing, Communications and Informatics, IEEE, 2017. https://doi.org/10.1109/ICACCI.2017.8126078

  • Sezer, O.M., Ozbayoglu, A.M.: Algorithmic financial trading with deep convolutional neural networks: Time series to image conversion approach. Appl. Soft Comput. 70, 525–538 (2018). https://doi.org/10.1016/j.asoc.2018.04.024

    Article  Google Scholar 

  • Sungheetha, A., Sharma, R.: Design an early detection and classification for diabetic retinopathy by deep feature extraction based convolution neural network. J. Trends Comput. Sci. Smart Technol. (TCSST) 3(02), 81–94 (2021)

    Article  Google Scholar 

  • Tripathi, M.: Analysis of convolutional neural network based image classification techniques. J. Innov Image Process. (JIIP) 3(02), 100–117 (2021)

    Article  Google Scholar 

  • Vargas, M.R., de Lima, B.S., Evsukoff, A.G.:Deep learning for stock market prediction from financial news articles. In: Proceedings of the IEEE International Conference on Computational Intelligence and Virtual Environments for Measurement Systems and Applications. (2017). Doi: https://doi.org/10.1109/CIVEMSA.2017.7995302

  • Wadi, S.A., Ismail, M.T., Alkhahazaleh, M.H., Karim, S.A.A.: Selecting wavelet transforms model in forecasting financial time series data based on ARIMA Model. Appl. Math. Sci. 5(7), 315–326 (2011)

    MathSciNet  MATH  Google Scholar 

  • Xu, B., Zhang, D., Zhang, S., Li, H., Lin, H.: Stock market trend prediction using recurrent convolutional neural networks. In: Zhang, M., Ng, V., Zhao, D., Li, S., Zan, H. (eds.) Natural Language Processing and Chinese Computing NLPCC 2018 Lecture Notes in Computer Science. Springer, Cham (2019). https://doi.org/10.1007/978-3-319-99501-4_14

    Chapter  Google Scholar 

  • Xu, K., Ba, J., Kiros, R., Cho, K., Courville, A.C., Salakhutdinov, R., Zemel, R.S., Bengio, Y.:Show, attend and tell: Neural image caption generation with visual attention. In Proceedings of the International Conference on Machine Learning. vol. 14, pp. 77–81 (2015)

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to S. Kumar Chandar.

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

Chandar, S.K. Convolutional neural network for stock trading using technical indicators. Autom Softw Eng 29, 16 (2022). https://doi.org/10.1007/s10515-021-00303-z

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1007/s10515-021-00303-z

Keywords

Navigation