Skip to main content
Log in

StockGAN: robust stock price prediction using GAN algorithm

  • Original Research
  • Published:
International Journal of Information Technology Aims and scope Submit manuscript

Abstract

Stock market predictions help investors benefit in the financial markets. Various papers have proposed different techniques in stock market forecasting, but no model can provide accurate predictions. In this study, we show how to accurately anticipate stock prices using a prediction model based on the Generative Adversarial Networks (GAN) method. We collect the dataset, preprocess it, extract features, evaluate the model, and then deploy the GAN method to develop a stock price prediction model. The GAN comprises two parts: a generator and a discriminator that are both trained using adversarial learning processes. In this study, we utilize features including date, open, high, low, close, and volume to train our model. The results of the experiments gain good accuracy and a low error rate, so it can be a promising solution for dealing with accurate and dynamic stock prices. Moreover, the proposed model can achieve the results obtained are a metric score r2 with real predictions = 0.811166 and synthetic predictions = 0.674971. The MAE function produces real predictions = 0.020665, and synthetic predictions = 0.042406. The MRLE gains real = 0.001087 and synthetic = 0.002479.

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

Similar content being viewed by others

References

  1. Lin H, Chen C, Huang G, Jafari A (2021) Stock price prediction using generative adversarial networks. J Comput Sci 17(3):188–196

    Article  Google Scholar 

  2. Nabipour M, Nayyeri P, Jabani H, Mosavi A, Salwana E, Shahab S (2020) Deep learning for stock market prediction. Entropy 22(8):840

    Article  Google Scholar 

  3. Saud AS, Shakya S (2020) Analysis of lookback period for stock price prediction with RNN variants. A case study on banking sector of NEPSE. Procedia Comput Sci 167:788–798

    Article  Google Scholar 

  4. Ta V-D, Liu C-M, Tadesse DA (2020) Portofolio optimization-based stock prediction using long-short term memory network in quantitative trading. Appl Sci 10(2):437

    Article  Google Scholar 

  5. Polamuri SR, Srinivas DK, Krishna Mohan DA (2021) Multi-Model Generative Adversarial Network Hybrid Prediction Algorithm (MMGAN-HIPA) for stock market prices prediction. J King Saud Univ Comput Inf Sci. https://doi.org/10.1016/j.jksuci.2021.07.001

    Article  Google Scholar 

  6. Feng F, He X, Wang X, Luo C, Liu Y, Chua T-S (2019) Temporal relational ranking for stock prediction. ACM Trans Inf Syst 37(2):1–30

    Article  Google Scholar 

  7. Zhang K, Zhong G, Dong J, Wang S, Wang Y (2019) Stock market prediction based on generative adversarial network. Procedia Comput Sci 147:400–406

    Article  Google Scholar 

  8. Usmani S, Shamsi JA (2021) News sensitive stock market prediction: literature review and suggestions. PeerJ Comput Sci 7:e490

    Article  Google Scholar 

  9. Sim HS, Kim HI, Ahn JJ (2019) Is deep learning for image recognition applicable to stock market prediction? Complexity 2019:1–10

    Article  Google Scholar 

  10. Kelotra A, Pandey P (2020) Stock market prediction using optimized deep- ConvLSTM model. Big Data 8(1):5–24

    Article  Google Scholar 

  11. Wang Y, Liu H, Guo Q, Xie S, Zhang X (2019) Stock volatility prediction by hybrid neural network. IEEE Access 1–1:2019

    Google Scholar 

  12. Lee J, Kim R, Koh Y, Kang J (2019) Global stock market prediction based on stock chart images using deep Q-network. IEEE Access 2019:1–1

    Article  Google Scholar 

  13. Zhang Y, Li J, Wang H, Choi SCT (2021) Sentiment-guided adversarial learning for stock price prediction. Front Appl Math Stat 2021:7

    Google Scholar 

  14. Zhu Y (2020) Stock price prediction using the RNN model. J Phys Conf Ser 1650:032103

    Article  Google Scholar 

  15. Moghar A, Hamiche M (2020) Stock market prediction using LSTM recurrent neural network. Procedia Comput Sci 170:1168–1173

    Article  Google Scholar 

  16. Wanda P, Hiswati ME, Diqi M, Herlinda R (2021) “Re-Fake: Klasifikasi Akun Palsu di Sosial Media Online menggunakan Algoritma RNN. Pros Semin Nas Sains Teknol dan Inov Indones. 3:191–200

    Google Scholar 

  17. Ronaldo AD (2021) Effective Soil type classification using convolutional neural network. Int J Inform Comput 3(1):20

    Google Scholar 

  18. Jie HJ, Wanda P (2020) Runpool: a dynamic pooling layer for convolution neural network. Int J Comput Intell Syst 13(1):66–76

    Article  Google Scholar 

  19. Wanda P, Jie HJ (2019) URLDeep: continuous prediction of malicious URL with dynamic deep learning in social networks. Int J Netw Secur 21(6):971–978

    Google Scholar 

  20. Liu B, Wu Q, Cao Q (2020) An improved Elman network for stock price prediction service. Secur Commun Netw 2020:1–9

    Google Scholar 

  21. Kartono A, Fatmawati VW, Wahyudi ST, Irmansyah G (2020) Numerical solution of nonlinear Schrodinger approaches using the fourth-order Runge-Kutta method for predicting stock pricing. J Phys Conf Ser 1491:012021

    Article  Google Scholar 

  22. Bhattacharjee I, Bhattacharja P (2019) Stock price prediction: a comparative study between traditional statistical approach and machine learning approach. In: 2019 4th international conference on electrical information and communication technology (EICT)

  23. Kumar D, Sarangi PK, Verma R (2021) A systematic review of stock market prediction using machine learning and statistical techniques. Mater Today Proc 2021:5

    Google Scholar 

  24. Vohra AA, Tanna PJ (2021) A survey of machine learning techniques used on Indian stock market. IOP Conf Ser: Mater Sci Eng 1042:1

    Article  Google Scholar 

  25. Wang X, Yang K, Liu T (2021) Stock Price prediction based on morphological similarity clustering and hierarchical temporal memory. IEEE Access 9(67241–67248):2021

    Google Scholar 

  26. Cao H, Lin T, Li Y, Zhang H (2019) Stock price pattern prediction based on complex network and machine learning. Complexity 2019:1–12

    Google Scholar 

  27. Vijh M, Chandola D, Tikkiwal VA, Kumar A (2020) Stock closing price prediction using machine learning techniques. Procedia Comput Sci 167:599–606

    Article  Google Scholar 

  28. Kaur R, Sharma DYK, Bhatt DP (2021) Measuring Accuracy of stock price prediction using machine learning-based classifiers. IOP Conf Ser Mater Sci Eng 1099(1):012049

    Article  Google Scholar 

  29. Wu JM-T, Li Z, Herencsar N, Vo B, Lin JC-W (2021) A graph-based CNN- LSTM stock price prediction algorithm with leading indicators. Multimedia Syst 8:1

    Article  Google Scholar 

  30. Nti IK, Adekoya AF, Weyori BA (2021) A novel multi-source information- fusion predictive framework based on deep neural networks for accuracy enhancement in stock market prediction. J Big Data 8:1

    Article  Google Scholar 

  31. Matsubara T, Akita R, Uehara K (2018) Stock price prediction by deep neural generative model of news articles. IEICE Trans Inf Syst E101D(4):901–908

    Article  Google Scholar 

  32. Shahriar MH, Haque NI, Rahman MA, Alonso M (2020) G-IDS: generative adversarial networks assisted intrusion detection system

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Mohammad Diqi.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Diqi, M., Hiswati, M.E. & Nur, A.S. StockGAN: robust stock price prediction using GAN algorithm. Int. j. inf. tecnol. 14, 2309–2315 (2022). https://doi.org/10.1007/s41870-022-00929-6

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s41870-022-00929-6

Keywords

Navigation