Research Article Open Access

Stock price prediction using Generative Adversarial Networks

HungChun Lin1, Chen Chen1, GaoFeng Huang1 and Amir Jafari2
  • 1 The George Washington University, United States
  • 2 Carina Medical LLC, Maryland, United States
Journal of Computer Science
Volume 17 No. 3, 2021, 188-196


Submitted On: 3 December 2020 Published On: 2 April 2021

How to Cite: Lin, H., Chen, C., Huang, G. & Jafari, A. (2021). Stock price prediction using Generative Adversarial Networks. Journal of Computer Science, 17(3), 188-196.


Deep learning is an exciting topic. It has been utilized in many areas owing to its strong potential. For example, it has been widely used in the financial area which is vital to the society, such as high-frequency trading, portfolio optimization, fraud detection and risk management. Stock market prediction is one of the most popular and valuable areas in finance. In this paper, it proposes a stock prediction model using Generative Adversarial Network (GAN) with Gated Recurrent Units (GRU) used as a generator that inputs historical stock price and generates future stock price and Convolutional Neural Network (CNN) as a discriminator to discriminate between the real stock price and generated stock price. Different from the traditional methods, which limited the forecasting on one-step-ahead only, by contrast, using the deep learning algorithm is possible to conduct the multi-step ahead prediction more accurately. In this study, it chose the Apple Inc. stock closing price as the target price, with features such as S&P 500 index, NASDAQ Composite index, U.S. Dollar index, etc. In addition, FinBert has been utilized to generate a news sentiment index for Apple Inc. as an additional predicting feature. Finally, this paper compares the proposed GAN model results with the baseline model.

  • 0 Citations



  • Stock price prediction
  • GAN
  • NLP