Investors can reduce the investment risk of stock investors and improve the investment return by accurately predicting stock price trends. It is difficult to predict the trend of stock prices due to high noise, nonlinearity and high volatility of stock data. In this paper, we propose a novel Wasserstein generative adversarial network with the temporal convolution module and the self-attention mechanism (TA-WGAN), which is based on the generative adversarial network (GAN), to predict the stock closing price of the next day. The key components of TA-WGAN are the generator and the discriminator, where the generator predicts the closing price of the stock and the discriminator evaluates the performance of the generator. The generator includes a temporal convolutional network and self-attention mechanism, and the discriminator is composed of a bidirectional long short-term memory network and temporal convolutional network. In the training process, TA-WGAN combines adversarial loss and square loss to improve its prediction performance by adversarial training of the generator and the discriminator. To demonstrate the effectiveness of TA-WGAN, we compare it with existing methods for two datasets: the CSI 300 Index and the Ping An Bank stock. The results demonstrate that TA-WGAN outperforms single-stage models, such as Long Short-Term Memory (LSTM), Bidirectional Long Short-Term Memory (BiLSTM) and Temporal Convolutional Network (TCN).