Access to this full-text is provided by Wiley.
Content available from Mathematical Problems in Engineering
This content is subject to copyright. Terms and conditions apply.
Research Article
Stock Market Prediction on High-Frequency Data Using
Generative Adversarial Nets
Xingyu Zhou ,1Zhisong Pan ,1Guyu Hu ,1Siqi Tang,1and Cheng Zhao1,2
1Army Engineering University of PLA, Nanjing 210007, China
2Anhui Provincial Key Laboratory of Network and Information Security, Anhui Normal University, Wuhu 241003, China
Correspondence should be addressed to Zhisong Pan; hotpzs@hotmail.com
Received 6 November 2017; Revised 21 January 2018; Accepted 13 February 2018; Published 15 April 2018
Academic Editor: Qian Zhang
Copyright © Xingyu Zhou et al. is is an open access article distributed under the Creative Commons Attribution License,
which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.
Stock price prediction is an important issue in the nancial world, as it contributes to the development of eective strategies for
stock exchange transactions. In this paper, we propose a generic framework employing Long Short-Term Memory (LSTM) and
convolutional neural network (CNN) for adversarial training to forecast high-frequency stock market. is model takes the publicly
available index provided by trading soware as input to avoid complex nancial theory research and dicult technical analysis,
which provides the convenience for the ordinary trader of nonnancial specialty. Our study simulates the trading mode of the
actual trader and uses the method of rolling partition training set and testing set to analyze the eect of the model update cycle on
the prediction performance. Extensive experiments show that our proposed approach can eectively improve stock price direction
prediction accuracy and reduce forecast error.
1. Introduction
Predictingstockpricesisanimportantobjectiveinthe
nancial world [–], since a reasonably accurate prediction
has the possibility to yield high nancial benets and hedge
against market risks. With the rapid growth of Internet
and computing technologies, the frequency for performing
operations on the stock market had increased to fractions of
seconds [, ]. Since year of the BM&F Bovespa (the
Brazilian stock exchange) has worked in high-frequency, and
the number of high-frequency operations has grown from
.% in to .% in . Aldridge and Krawciw []
estimate that in high-frequency trading on average ini-
tiated %–% of trading volume in equities and %–%
of volume in foreign exchange and commodities. ese
percentages suggest that the high-frequency stock market is
aglobaltrend.
Inmostcases,theforecastresultsareassessedfromtwo
aspects: the rst is forecast error (chiey the RMSE (Root
Mean Square Error) or RMSRE (Root Mean Square Relative
Error)) between real price and forecast value; the second is
direction prediction accuracy, which means the percentage
of correct predictions of price series direction, as upward and
downward movements are what really matters for decision-
making. Even small improvements in predictive performance
can be very protable [, ].
However, predicting stock prices is not an easy work, due
to the complexity and chaotic dynamics of the markets and
the many nondecidable, nonstationary stochastic variables
involved []. Many researchers from dierent areas have
studied the historical patterns of nancial time series and
have proposed various methods for forecasting stock prices.
In order to achieve promising performance, most of these
ways require careful selection of input variables, establishing
predictive model with professional nancial knowledge, and
adopting various statistical methods for arbitrage analysis,
which makes it dicult for people outside the nancial eld
to use these methods to predict stock prices [–].
Generative adversarial network (GAN) was introduced
by Goodfellow et al. [], where images patches are generated
from random noise using two networks trained simultane-
ou sly. Sp e cica l ly, in GAN a d iscrim inat ive ne t learns to
distinguish whether a given data instance is real or not, and
a generative net learns to confuse by generating high
quality data. Although this approach has been successful and
applied to a wide range of elds, such as image inpainting,
Hindawi
Mathematical Problems in Engineering
Volume 2018, Article ID 4907423, 11 pages
https://doi.org/10.1155/2018/4907423
Mathematical Problems in Engineering
semantic segmentation, and video prediction [–], as far
as we know, it has not been used for stock forecasting.
is work uses basic technical index data as an input
variable, which can be acquired directly from trading so-
ware,sothatpeopleoutsidethenancialeldcanpredict
stock price through our method easily. is study introduces
forecast error loss and direction prediction loss and shows
that generative adversarial training [] may be successfully
employed for combining these losses to produce satisfying
predict results, and we call this prediction architecture GAN-
FD (GAN for minimizing forecast error loss and direction
predictionloss).Forthepurposeofconformingtothe
practice of actual transactions, this work carries out rolling
segmentation on training set and testing set of the raw data,
and we will illustrate it in detail in the experimental section.
Overall, our main contributions are twofold: () we
adapted generative adversarial network for the purpose of
price prediction, which constitutes to our knowledge the
rst application of adversarial training to stock market, and
extensive experiments show that our prediction model can
achieve remarkable results and () we carry out rolling
segmentation on training set and testing set of the raw data to
investigate the eect the of model parameter update cycle on
the stock forecast performance, and the experimental results
show that smaller model update cycle can advance prediction
performance.
In the remainder of this paper, we begin with a review
of the literature on which algorithms have been used for the
nancial market prediction. en we formulate the problem
and propose our general adversarial network framework.
Furthermore, in the experiments section, we presented the
experimental analysis with the proposed model, as well as a
comparison between the obtained results with those given by
classical prediction models. Finally, conclusions and possible
extensions are discussed.
2. Related Work
is section introduce the related work from the stock market
prediction method and the generative adversarial network.
2.1. Stock Market Prediction Method. According to the re-
search developed in this eld, we can classify the techniques
used to solve the stock market prediction problems to
twofold.
e rst category of related work is econometric models,
which includes classical econometric models for forecasting.
Common methods are the autoregressive method (AR), the
moving average model (MA), the autoregressive moving
average model (ARMA), and the autoregressive integrated
moving average (ARIMA) [–]. Roughly speaking, these
models take each new signal as a noisy linear combination of
the last few signals and independent noise terms. However,
most of them rely on some strong assumptions with respect
to the noise terms (such as i.i.d. assumption, -distribution)
and loss functions, while real nancial data may not fully
satisfy these assumptions. By introducing a generalized
autoregressive conditional heteroscedastic (GARCH) model
for conditional variances, Pellegrini et al. [] apply ARIMA-
GARCH model to the prediction of nancial time series.
e second category involves so computing based mod-
els. So computing is a term that covers articial intelligence
which mimics biological processes. ese techniques include
articial neural networks (ANN) [, ], fuzzy logic (FL)
[], support vector machines (SVM) [, ], particle swarm
optimization (PSO) [], and many others. Many authors
have tried to deal with fuzziness along with randomness in
option pricing models [, ]. Carlsson and Full´
er [] were
the rst to study the fuzzy real options and avaneswaran
et al. [] demonstrated the superiority of the fuzzy fore-
casts and then derived the membership function for the
European call price by fuzzifying the interest rate, volatility,
and the initial value of the stock price. Recently there has
been a resurgence of interest in deep learning, whose basic
structure is best described as a multilayer neural network
[]. Some literatures have established various models based
on deep neural networks to improve the prediction ability
of high-frequency nancial time series [, ]. e ability
of deep neural networks to extract abstract features from
data is also attractive, Chong et al. [] applied a deep
feature learning-based stock market prediction model, which
extract information from the stock return time series without
relying on prior knowledge of the predictors and tested
it on high-frequency data from the Korean stock market.
Chen et al. [] proposed a double-layer neural network for
high-frequency forecasting, with links specially designed to
capture dependence structures among stock returns within
dierent business sectors. ere also exist a few studies
that apply deep learning to identication of the relationship
betweenpastnewseventsandstockmarketmovements[–
].
However,toourknowledge,mostofthesemethods
require expertise to impose specic restrictions on the input
variables, such as combining related stocks together as entry
data [], inputting dierent index data to dierent layers
of the deep neural network [], and converting news text
into structured representation as input []. In contrast, our
proposed forecasting model directly uses the data provided
by the trading soware as input, which reduce the barrier for
ordinary investors.
2.2. Generative Adversarial Network. Generative adversarial
network (GAN) is a framework for estimating generative
modelsviaanadversarialprocess,inwhichwesimultane-
ously train two models: a generative model that capturesthe
data distribution and a discriminative model that estimates
the probability that a sample came from the training data
rather than . e training procedure for is to maximize
the probability of making a mistake. is framework
corresponds to a minimax two-player game. In the space of
arbitrary functions and D, a unique solution exists, with
recovering the training data distribution and equal to
. everywhere []. While and are dened by multilayer
perceptrons in [], most researches recently constructed
and on the basis of Long Short-Term Memory (LSTM)
[] or convolutional neural network (CNN) [] for a large
variety of application.
Mathematical Problems in Engineering
XG
YY
Y
X1,X2,...,XT
LSTM
internal
unit
LSTM
internal
unit
LSTM
internal
unit
Y
1,Y
2,...,Y
T,
Y
T+1
Y
1,Y
2,...,Y
TY
1,Y
2,...,Y
T,Y
T+1
D
Input
sequence Conv.
Conv. Conv. FC
FC
Real
Predicted
F : GAN-FD architecture. e generator ()is founded on LSTM, which applies to predicting
𝑇+1. e discriminator ()is based on
CNN for the purpose of estimating the probability whether a sequence is real (Y)or being predicted (
Y).Conv. means convolutional layer,
FC is an abbreviation for fully connected layer. e structure of and can be adjusted according to the specic application.
LSTM is a basic deep learning model and capable of
learning long-term dependencies. A LSTM internal unit is
composed of a cell, an input gate, an output gate, and a
forget gate. LSTM internal units have hidden state augmented
with nonlinear mechanisms to allow state to propagate
withoutmodication,beupdated,orbereset,usingsimple
learned gating functions. LSTM work tremendously well on
various problems, such as natural language text compression,
handwriting recognition, and electric load forecasting.
CNN is a class of deep, feed-forward articial neural net-
works that has successfully been applied to analyzing visual
imagery. A CNN consists of an input layer and an output
layer, as well as multiple hidden layers. e hidden layers of a
CNN typically consist of convolutional layers, pooling layers,
fully connected layers, and normalization layers. CNN also
has many applications such as image and video recognition,
recommender systems, and natural language processing.
Although there are a lot of literatures forecast stock price
by using LSTM model, to the best of our knowledge, this
paper is the rst to adopt GAN to predict stock prices.
e experimental part (Section .) compares the prediction
performances between GAN-FC and LSTM.
3. Forecasting with High-Frequency Data
In this section, we illuminate the details of the generative
adversarial network framework for stock market forecasting
with high-frequency data.
3.1. Problem Statement. Under the high-frequency trading
environment, high-quality one-step forecasting is usually
of great concern to algorithmic traders, providing signi-
cant information to market makers for risk assessment and
management. In this article, we aim to forecast the price
movement of individual stocks or the market index one step
ahead, based solely on their historical price information. Our
problem can be mathematically formalized as follows.
Let X𝑡represent a set of basic indicators and 𝑡denote
the closing price of one stock for a -minute interval at
time ( = 1,2,...,),whereis the maximum lag
of time. Given the historical basic indicators information
X(X={X1,X2,...,X𝑇})and the past closing price Y(Y=
{1,2,...,𝑇}), our goal is to predict the closing price 𝑇+1
for the next -minute time interval. ere are literatures that
examined the eects of dierent [, , ], but, in this work,
we just set to because each trading day contains -
minute intervals in the China stock exchanges.
3.2. Prediction Model. e deep architecture of the proposed
GAN-FD model is illustrated as in Figure . Since the stock
dataisatypicaltimeseries,wechooseLSTMmodel,which
is widely applied to time series prediction, as the generative
model to predict output
𝑇+1 based on the input data X;
that is,
𝑇+1 =(X).()
e discriminative model is based on the CNN
architecture and performs convolution operations on the
one-dimensional input sequence in order to estimate the
probability whether a sequence comes from the dataset (Y=
{1,2,...,𝑇,𝑇+1 }) or being produced by a generative
model (
Y={1,2,...,𝑇,
𝑇+1}).
Our main intuition on why to use an adversarial loss
is that it can simulate the operating habits of nancial
traders. An experienced trader usually predicts stock price
through the available indicator data, which is the work of the
generative model , and then judges the correct probability
of his own forecast with the previous stock price, as the
discriminative model does.
It is noteworthy that the structure of and in GAN-
FD can be adjusted according to specic application, and
the experimental part in this paper just proposed simple
and framework (Section .) for stock prediction. It is
reasonable to believe that ne-tuning the structure of and
can improve the predictive performance.
3.3. Adversarial Training. e training of the pair (,)
consists of two alternated steps, described below. For the sake
of clarity, we assume that we use pure SGD (minibatches of
size ), but there is no diculty to generalize the algorithm
to minibatches of size by summing the losses over the
samples.
Training (let (X,Y)be a sample from the dataset). In order
to make the discriminative model as “confused” as possible,
the generative model should reduce the adversarial loss in
the sense that will not discriminate the prediction correctly.
Classifying Yinto class and
Yinto class , the adversarial
loss for is 𝐺
adv
Y=sce
Y,1, ()
Mathematical Problems in Engineering
where sce is the sigmoid cross-entropy loss, dened as
sce (A,B)=−
𝑖𝑖log sigmoid 𝑖
+1−𝑖log 1−sigmoid 𝑖. ()
However, in practice, minimizing adversarial loss alone
cannot guarantee satisfying predictions. Imagine that could
generate samples to “confuse” ,withoutbeingcloseto
𝑇+1,
and then will learn to discriminate these samples, leading
to generate other “confusing” samples, and so on. To address
this problem, the generative model ought to decrease the
forecast error loss; that is, 𝑝loss
𝑝Y,
Y=Y−
Y𝑝()
where =1or =2.
Furthermore, as mentioned above, stock price direction
prediction is crucial to trading, so we dene direction pre-
diction loss function dpl:
dpl Y,
Y=sgn
𝑇+1 −𝑇−sgn 𝑇+1 −𝑇()
where sgn represents sign function.
Combining all these losses previously dened with dier-
ent parameters adv,𝑝,anddpl ,weachievethenallosson
:
𝐺(X,Y)=adv 𝐺
adv
Y+𝑝𝑝Y,
Y
+dpl dpl Y,
Y. ()
en we perform one SGD iteration on to minimize
𝐺(X,Y)whilekeepingtheweightsofxed.
Training (let (X,Y)be a dierent data sample). Since the
role of is just to determine whether the input sequence is
Yor
Y, the target loss is equal to the adversarial loss on D.
Whilekeepingtheweightsofxed, we perform one SGD
step on to minimize the target loss:
𝐷(X,Y)=𝐷
adv Y,
Y
=sce
Y,0+sce Y,1. ()
We train the generator and discriminator iteratively. e
entire process is summarized in Algorithm , with minibatch-
es of size .
() Set the learning rates 𝐷and 𝐺, and parameters
adv,𝑝,dpl ;
() Initialize weights 𝐷and 𝐺.
() while not converged do
() Update the generator :
() Get new data samples (X(1),Y(1)), (X(2),
Y(2)),...,(X(𝐾),Y(𝐾))
() 𝐺=𝐺−𝐺
𝐾
𝑖𝐺(X(𝑖),Y(𝑖))
𝐺
() Update the discriminator :
() Get new data samples (X(1),Y(1) ), (X(2),
Y(2)),...,(X(𝐾),Y(𝐾))
() 𝐷=𝐷−𝐷
𝐾
𝑖𝐷(X(𝑖),Y(𝑖))
𝐷
() end while
A : Training GAN-FD.
4. Experiments
4.1. Dataset. Next, we evaluate the performance of the pro-
posed method based on the China stock market, ranging
from January , , to December , . ere are totally
trading days and each day contains -minute intervals,
corresponding to time points. ese stocks selected
for the experiment should conform to three criteria: rst,
they should be the constituent stock of (the CSI
is a capitalization-weighted stock market index designed
to replicate the performance of stocks traded in the
Shanghai and Shenzhen stock exchanges); second, they were
not suspended during the period we just mentioned, in case
accidentaleventsbringaboutsignicantimpactontheirprice
and aect forecast results; third, their closing prices in the
start time, that is, January , , are above to ensure
the volatility for high-frequency exchange. is leaves
stocks in the sample, which are listed in Table . e number
of increasing directions and decreasing directions for each
stock’s closing price per minute is also shown in Table , and
their numbers are relatively close. e historical data was
obtained from the Wind Financial Terminal, produced by
Wind Information Inc. (the Wind Financial Terminal can be
downloaded from http://www.wind.com.cn).
Many fund managers and investors in the stock market
generally accept and use certain criteria for technical indi-
cators as the signal of future market trends [, ]. is
work selects technical indicators as feature subsets by
the review of domain experts and prior researches; that is,
the input data Xat each moment (e.g., X𝑇)consistsof
basic indicators that can be obtained directly from almost all
trading soware. ese basic indicators are listed in Table ,
and their parameters are using the default value of the Wind
Financial Terminal. As mentioned above, Yis dened as the
closing price at each moment.
Mostoftherelatedarticlesusethetraditionaldata
partitioning method; that is, the entire dataset is directly split
into training set and testing set [, , , ]. However,
Mathematical Problems in Engineering
T : e sample stocks and their number of increasing direc-
tions and decreasing directions.
ID Stock code Increase Decrease
.SZ
.SZ
.SZ
.SZ
.SZ
.SZ
.SZ
.SZ
.SZ
.SZ
.SZ
.SZ
.SZ
.SZ
.SZ
.SZ
.SZ
.SZ
.SZ
.SZ
.SZ
.SZ
.SZ
.SZ
.SH
.SH
.SH
.SH
.SH
.SH
.SH
.SH
.SH
.SH
.SH
.SH
.SH
.SH
.SH
.SH
.SH
.SH
the trading style of the stock market changes frequently;
for example, investors sometimes prefer stocks with high
volatility and sometimes tend to invest in technology stocks.
erefore, we should update the model parameters regularly
to adapt to the change of market style. In order to make
experiments closer to real transactions, we carry out rolling
T : Basic indicators for prediction.
Indicators
Opening price
Maximum price
Minimum price
Trading volume
Turnov e r
Bias
Bollinger bands
Directional movement index
Exponential moving averages
Stochastic index
Moving averages
MACD
Relative strength index
Dataset
M
M
M
N
N
N
F : Rolling segmentation on training set and testing set. e
green bar represents the entire dataset, the blue bar represents the
training set for a round experiment, and the yellow bar represents
the corresponding testing set.
segmentation on training set and testing set of the experi-
mental data. As Figure shows, in the beginning, we select
the rst days as training set, and the next days play the
role of testing set. Aer the rst round of experiments, we
roll forward the time window for days, that is, choosing
the (+1)th day to the (+)th day as training set and the
(++1)th day to the (+2)th day as testing set. Repeat
until all the data has been experimented. In other words, this
can be regarded as the model update cycle, and is the
size of the corresponding training data.
4.2. Network Architecture. Given that the LSTM generator
takes on the role of prediction and requires more accurate
calculations of values than the CNN discriminator, we set the
learning rate 𝐺to . and 𝐷to .. e LSTM cell in
contains internal (hidden) units and the parameters
are initialized following the normal distribution N(0,1).
e architecture of discriminative model is presented in
Table . We train GAN-FD with =2weighted by adv =
𝑝=dpl =1.
4.3. Benchmark Methods. To e v a l u a t e t h e p erformanc e of
our proposed method, we include three baseline meth-
ods for comparison. e rst model is ARIMA (1,1,1)-
GARCH(1,1), a tted ARIMA model that forecasts future
Mathematical Problems in Engineering
T : Network architecture of discriminative model .
Layer Conguration
Convolution Filter 32×4×1, strides 2,LReLU
Convolution Filter 64×4×1, strides 2,LReLU,BN
Convolution Filter 128×4×1, strides 2,LReLU,BN
FC , leaky ReLU
FC , sigmoid
Optimizer: SGD; batch size: ; iterations: ; LReLU slope: ..
T : Summary of RMSRE with dierent (M,N). ese gures are the average values over the stocks.
=5 =10 =20
=10 =20 =60 =10 =20 =60 =10 =20 =60
ARIMA-GARCH . . . . . . . . .
ANN . . . . . . . . .
SVM . . . . . . . . .
GAN-F . . . . . . . 0.0313 .
GAN-D . . . . . . . . .
LSTM-FD . . . . . . 0.0321 . .
GAN-FD 0.0098 0.0079 0.0101 0.0218 0.0111 0.0144 . . 0.0296
values of stock time series and the GARCH model forecasts
future volatilities []. e second one is articial neural
networks (ANN). e parameter optimization method and
modelarchitecturalissettingasin[],exceptthattheinput
layernodeischangedtoandthenetworkoutputsthe
predicted value instead of two patterns ( or ). e third one
issupportvectormachines(SVM).AnRBFkernelisusedand
the parameter is setting as in [].
We also inspect our GAN-FD model from several ways.
e GAN-F model is using a GAN architectural for mini-
mizing forecast error loss, with adv =
𝑝=1and dpl
=0. e GAN-D model is using a GAN architectural for
minimizing direction prediction loss, with adv =dpl =1
and 𝑝=0. e LSTM-FD model is a LSTM model aiming
at minimizing forecast error loss and direction prediction
loss, with internal units in LSTM. Obviously, the main
dierence between LSTM-FD and GAN-FD is the presence
of adversarial training.
4.4. Evaluation Metrics. For each stock at each time ,a
prediction is made for the next time point +1based on
a specic method. Assume the total number of time points
being tested is 0; we used the following criteria to evaluate
the performance of dierent models.
(1) Root Mean Squared Relative Error (RMSRE)
RMSRE =1
0
𝑇0
𝑡=1
𝑡+1 −𝑡+1
𝑡+1 2.()
RMSREisemployedasanindicatorforthepredictivepower
or prediction agreement. A low RMSRE indicates that the
prediction agrees with the real data (the reason why this paper
uses RMSRE instead of RMSE is that RMSRE facilitates a
uniform comparison of the results of stocks).
(2) Direction Prediction Accuracy (DPA)
DPA =100
0
𝑇0
𝑡=1𝑡,()
where
𝑡=
1if 𝑡+1 −𝑡
𝑡+1 −𝑡>0
0otherwise .()
DPA measures the percentage of accuracy relating to the
series trend. A high DPA promises more winning trades.
4.5. Results. In order to investigate the eect of the model
update cycle on the predictive performance, let ∈{10,20,
60}and ∈ {5,10,20}.InChinastockexchangemarket,
{5,10,20,60} days represent one week, two weeks, one
month, and one quarter.
Tables and show the average values of RMSRE and
DPA with dierent (,). e numbers clearly indicate that
GAN-FD and its related methods perform better than three
baseline methods in terms of RMSRE and DPA. is targeted
method GAN-F brings some improvement in RMSRE, but
it does not outperform three baseline methods in DPA.
Contrary to GAN-F, GAN-D achieves better results in DPA
but failed in RMSRE. LSTM-FD improves the results, since
it combines forecast error loss with direction prediction loss
for training. Finally the combinationof the forecast error loss,
direction prediction loss, and adversarial training, that is,
GAN-FD, achieves the best RMSRE and DPA in the majority
of scenarios.
Letustakealookattheeectsofdierent(M,N)onthe
experiment. GAN-FD obtains the maximum average DPA
(.) and the minimum average RMSRE (.) when
Mathematical Problems in Engineering
T : Summary of DPA with dierent (M,N). ese gures are the average values over the stocks.
=5 =10 =20
=10 =20 =60 =10 =20 =60 =10 =20 =60
ARIMA-GARCH . . . . . . . . .
ANN . . . . . . . . .
SVM . . . . . . . . .
GAN-F . . . . . . . . .
GAN-D . . . . . . . . .
LSTM-FD . . . . . . 0.5546 0.5635 .
GAN-FD 0.6761 0.6956 0.6793 0.6233 0.6651 0.6687 . . 0.5753
T : e number of times about the minimum RMSRE.
=5 =10 =20
=10 =20 =60 =10 =20 =60 =10 =20 =60
ARIMA-GARCH
ANN
SVM
GAN-F 18
GAN-D
LSTM-FD 16
GAN-FD 31 40 33 30 33 35 19
T : e number of times about the maximum DPA.
=5 =10 =20
=10 =20 =60 =10 =20 =60 =10 =20 =60
ARIMA-GARCH
ANN
SVM
GAN-F
GAN-D
LSTM-FD 18 15
GAN-FD 41 38 32 26 37 35 19
(M,N) is (, ). It is interesting to note that all these
methods work better when is than when is or ,
with smaller RMSRE and higher DPA. is implies that very
short-term trends are best for predicting the next minute’s
price. erefore, a shorter model update cycle (e.g., is )
is preferred. On the other hand, for the same , dierent
will bring about some changes to the prediction results.
From the experimental results, we suggest that should take
the value greater than . is makes intuitive sense. If the
training sample is inadequate, it would fail to train the model,
especially in the volatile stock markets. We should also notice
that when the training set is small while the testing set is
large (i.e., (M,N) is (, )), most of these methods perform
the worst, and the DPA of these methods are no better than
random guessing (i.e., %).
Table shows the number of times for each method
to achieve the minimum RMSRE over the stocks. It is
noticeable that the results of these three baseline methods are
all zero. GAN-FD with its related methods is obviously better
than these three baseline methods in RMSRE. Meanwhile,
GAN-FD obtains the minimum RMSRE times, account-
ing for .% in these scenarios ( stocks and groups
(M,N)). e best performance appeared when (M,N)is(,
), with stocks’ minimum RMSRE coming from GAN-FD.
Table shows the number of times for each method to
achieve the maximum DPA over the stocks. Compared
with the other six methods, GAN-FD achieves the maximum
DPA times, accounting for .% in all scenarios. When
(M,N) is (, ), the maximum DPA of stocks in all
stocks comes from GAN-FD. Even when (M,N)is(,),
that is, the worst performance of GAN-FD cases, GAN-FD
still obtains maximum DPA in stocks. From the above
analyses, the performance of the GAN-FD is signicantly
better than the other six ways.
e results of each representation are reported in Figures
–. We just focus on GAN-FD. As shown in Figures –,
the DPA of GAN-FD ranges around .%–.% when
is , and it slumps to .%–.% when is , which
is presented in Figures –. When is , the RMSRE of
GAN-FD over the stocks varies between .% and .%,
Mathematical Problems in Engineering
0 0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
DPA
ARIMA-GARCH
ANN
SVM
GAN-F
GAN-D
LSTM-FD
GAN-FD
0.01
0.02
0.03
0.04
0.05
0.06
0.07
0.08
0.09
0.1
RMSRE
ARIMA-GARCH
ANN
SVM
GAN-F
GAN-D
LSTM-FD
GAN-FD
1
2
4
6
8
3
5
7
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
1
2
4
6
8
3
5
7
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
F : DPA and RMSRE of each stock when (M,N)is(,)and-axisrepresentsthestockID.
ARIMA-GARCH
ANN
SVM
GAN-F
GAN-D
LSTM-FD
GAN-FD ARIMA-GARCH
ANN
SVM
GAN-F
GAN-D
LSTM-FD
GAN-FD
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
DPA
0
0.01
0.02
0.03
0.04
0.05
0.06
0.07
0.08
0.09
0.1
RMSRE
1
2
4
6
8
3
5
7
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
1
2
4
6
8
3
5
7
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
F : DPA and RMSRE of each stock when (M,N)is(,)and-axis represents the stock ID.
ARIMA-GARCH
ANN
SVM
GAN-F
GAN-D
LSTM-FD
GAN-FD ARIMA-GARCH
ANN
SVM
GAN-F
GAN-D
LSTM-FD
GAN-FD
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
DPA
0
0.01
0.02
0.03
0.04
0.05
0.06
0.07
0.08
0.09
0.1
RMSRE
1
2
4
6
8
3
5
7
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
1
2
4
6
8
3
5
7
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
F : DPA and RMSRE of each stock when (M,N)is(,)and-axisrepresentsthestockID.
ARIMA-GARCH
ANN
SVM
GAN-F
GAN-D
LSTM-FD
GAN-FD ARIMA-GARCH
ANN
SVM
GAN-F
GAN-D
LSTM-FD
GAN-FD
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
DPA
0.01
0
0.02
0.03
0.04
0.05
0.06
0.07
0.08
0.09
0.1
RMSRE
1
2
4
6
8
3
5
7
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
1
2
4
6
8
3
5
7
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
F : DPA and RMSRE of each stock when (M,N)is(,)and-axis represents the stock ID.
Mathematical Problems in Engineering
ARIMA-GARCH
ANN
SVM
GAN-F
GAN-D
LSTM-FD
GAN-FD ARIMA-GARCH
ANN
SVM
GAN-F
GAN-D
LSTM-FD
GAN-FD
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
DPA
0
0.01
0.02
0.03
0.04
0.05
0.06
0.07
0.08
0.09
0.1
RMSRE
1
2
4
6
8
3
5
7
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
1
2
4
6
8
3
5
7
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
F : DPA and RMSRE of each stock when (M,N)is(,)and-axisrepresentsthestockID.
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
DPA
0
0.01
0.02
0.03
0.04
0.05
0.06
0.07
0.08
0.09
0.1
RMSRE
ARIMA-GARCH
ANN
SVM
GAN-F
GAN-D
LSTM-FD
GAN-FD ARIMA-GARCH
ANN
SVM
GAN-F
GAN-D
LSTM-FD
GAN-FD
1
2
4
6
8
3
5
7
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
1
2
4
6
8
3
5
7
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
F : DPA and RMSRE of each stock when (M,N)is(,)and-axisrepresentsthestockID.
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
DPA
0
0.01
0.02
0.03
0.04
0.05
0.06
0.07
0.08
0.09
0.1
RMSRE
ARIMA-GARCH
ANN
SVM
GAN-F
GAN-D
LSTM-FD
GAN-FD ARIMA-GARCH
ANN
SVM
GAN-F
GAN-D
LSTM-FD
GAN-FD
1
2
4
6
8
3
5
7
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
1
2
4
6
8
3
5
7
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
F : DPA and RMSRE of each stock when (M,N)is(,)and-axisrepresentsthestockID.
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
DPA
0
0.01
0.02
0.03
0.04
0.05
0.06
0.07
0.08
0.09
0.1
RMSRE
ARIMA-GARCH
ANN
SVM
GAN-F
GAN-D
LSTM-FD
GAN-FD ARIMA-GARCH
ANN
SVM
GAN-F
GAN-D
LSTM-FD
GAN-FD
1
2
4
6
8
3
5
7
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
1
2
4
6
8
3
5
7
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
F : DPA and RMSRE of each stock when (M,N)is(,)and-axisrepresentsthestockID.
Mathematical Problems in Engineering
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
DPA
0
0.01
0.02
0.03
0.04
0.05
0.06
0.07
0.08
0.09
0.1
RMSRE
ARIMA-GARCH
ANN
SVM
GAN-F
GAN-D
LSTM-FD
GAN-FD ARIMA-GARCH
ANN
SVM
GAN-F
GAN-D
LSTM-FD
GAN-FD
1
2
4
6
8
3
5
7
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
1
2
4
6
8
3
5
7
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
F : DPA and RMSRE of each stock when (M,N)is(,)and-axisrepresentsthestockID.
which is lower than other six methods in most cases, while
the volatility is smaller. However, the RMSRE of GAN-FD
increases dramatically and uctuates violently when is ,
and it varies between .% and .%. is further shows
that we should reduce the model update cycle and revise
the model parameters regularly to adapt to the change of
market style.
5. Conclusion
In this paper, we propose an easy-to-use stock forecasting
model called GAN-FD, to assist more and more nonnancial
professional ordinary investors making decisions. GAN-FD
adopts simple technical indexes as input data to avoid
complicated input data preprocessing. Based on the deep
learning network, this model achieves prediction ability supe-
rior to other benchmark methods by means of adversarial
training, minimizing direction prediction loss, and forecast
error loss. Moreover, the eects of the model update cycles on
the predictive capability are analyzed, and the experimental
resultsshowthatthesmallermodelupdatecyclecanobtain
better prediction performance. In the future, we will attempt
to integrate predictive models under multiscale conditions.
Conflicts of Interest
e authors declare that there are no conicts of interest
regarding the publication of this paper.
Acknowledgments
isworkissupportedbytheNationalKeyResearch
Development Program of China (YFB) and
the National Natural Science Foundation of China (no.
).
References
[] R. Al-Hmouz, W. Pedrycz, and A. Balamash, “Description and
prediction of time series: a general framework of Granular
Computing,” Expert Systems with Applications,vol.,no.,
pp. –, .
[] S. Barak and M. Modarres, “Developing an approach to eval-
uate stocks by forecasting eective features with data mining
methods,” Expert Systems with Applications,vol.,no.,pp.
–, .
[] A.Booth,E.Gerding,andF.McGroarty,“Automatedtrading
with performance weighted random forests and seasonality,”
Expert Systems with Applications,vol.,no.,pp.–,
.
[] A. Bagheri, H. Mohammadi Peyhani, and M. Akbari, “Financial
forecasting using ANFIS networks with Quantum-behaved Par-
ticle Swarm Optimization,” Expert Systems with Applications,
vol.,no.,pp.–,.
[] Y. Son, D.-J. Noh, and J. Lee, “Forecasting trends of high-
frequency KOSPI index data using learning classiers,”
Expert Systems with Applications,vol.,no.,pp.–,
.
[] I. Aldridge and S. Krawciw, “Real-Time Risk: What Investors
Should Know About FinTech,” in High-Frequenc y Trading, and
Flash Crashes,JohnWiley&Sons,Inc.,Hoboken,NJ,USA,.
[]F.A.DeOliveira,C.N.Nobre,andL.E.Z
´
arate, “Applying
Articial Neural Networks to prediction of stock price and
improvement of the directional prediction index - Case study
of PETR, Petrobras, Brazil,” Expert Systems with Applications,
vol.,no.,pp.–,.
[] J. H. Ni˜
no-Pe˜
naandG.J.Hern
´
andez-P´
erez, “Price direction
prediction on high frequency data using deep belief networks,”
Communications in Computer and Information Science,vol.,
pp.–,.
[] A. Marszałek and T. Burczyn’ski, “Modeling and forecasting
nancial time series with ordered fuzzy candlesticks,” Informa-
tion Sciences,vol.,pp.–,.
[] X.Li,X.Huang,X.Deng,andS.Zhu,“Enhancingquantitative
intra-day stock return prediction by integrating both market
news and stock prices information,” Neurocomputing,vol.,
pp. –, .
[] X. Wang, S. Bao, and J. Chen, “High-frequency stock linkage
and multi-dimensional stationary processes,” Physica A: Statis-
tical Mechanics and its Applications,vol.,pp.–,.
[] E. Chong, C. Han, and F. C. Park, “Deep learning networks for
stock market analysis and prediction: Methodology, data repre-
sentations, and case studies,” Expert Systems with Applications,
vol. , pp. –, .
[] I. J. Goodfellow, J. Pouget-Abadie, M. Mirza et al., “Generative
adversarial nets,” in Proceedings of the 28th Annual Conference
Mathematical Problems in Engineering
on Neural Information Processing Systems 2014, NIPS 2014,pp.
–, can, December .
[] S. Iizuka, E. Simo-Serra, and H. Ishikawa, “Globally and locally
consistent image completion,” ACM Transactions on Graphics,
vol. , no. , article no. , .
[] P. Luc, C. Couprie, S. Chintala, and J. Verbeek, Semantic
segmentation using adversarial networks, arXiv preprint,arXiv,
., , arXiv:..
[] M. Mathieu, C. Couprie, and Y. LeCun, Deep multi-scale video
prediction beyond mean square error, arXiv preprint,arXiv,
., , arXiv:..
[] J. D. Hamilton, Time Seri es Analysis , vol. , Princeton University
Press, .
[] R. H. Shumway and D. S. Stoer, Time series analysis and its
applications, Springer Texts in Statistics, Springer, New York,
NY, USA, rd edition, .
[] P. J. Brockwell and R. A Davis, TimE Ser ie s: eory and Method s,
Springer Science & Business Media, .
[] S. Pellegrini, E. Ruiz, and A. Espasa, “Prediction intervals
in conditionally heteroscedastic time series with stochastic
components,” International Journal of Forecasting,vol.,no.,
pp.–,.
[] Y. Kara, M. Acar Boyacioglu, and ¨
O. K. Baykan, “Predicting
direction of stock price index movement using articial neural
networks and support vector machines: e sample of the
Istanbul Stock Exchange,” Expert Systems with Applications,vol.
,no.,pp.–,.
[] M. Ghiassi, J. Skinner, and D. Zimbra, “Twitter brand sentiment
analysis: a hybrid system using n-gram analysis and dynamic
articial neural network,” Expert Systems with Applications,vol.
, no. , pp. –, .
[] M. R. Hassan, “A combination of hidden Markov model and
fuzzy model for stock market forecasting,” Neurocomputing,vol.
,no.-,pp.–,.
[] W. Huang, Y. Nakamori, and S.-Y. Wang, “Forecasting stock
market movement direction with support vector machine,”
Computers & Operations Research,vol.,no.,pp.–,
.
[] A. F., S. Elsir, and H. Faris, “A Comparison between Regres-
sion, Articial Neural Networks and Support Vector Machines
for Predicting Stock Market Index,” International Journal of
Advanced Research in Articial Intelligence,vol.,no.,.
[]R.Majhi,G.Panda,G.Sahoo,A.Panda,andA.Choubey,
“Prediction of S&P and DJIA stock indices using particle
swarm optimization technique,” in Proceedings of the Proceeding
of the IEEE Congress on Evolutionary Computation (CEC ’08),
pp.–,HongKong,China,June.
[] S. S. Appadoo, Pricing Financial Derivatives with Fuzzy Alge-
braic Models: A eoretical and Computational Approach [Ph.D.
thesis], University of Manitoba, Winnipeg, .
[] A. avaneswaran, K. iagarajah, and S. S. Appadoo, “Fuzzy
coecient volatility (FCV) models with applications,” Mathe-
matical and Computer Modelling,vol.,no.-,pp.–,
.
[] C. Carlsson and R. Full´
er, “On possibilistic mean value and
variance of fuzzy numbers,” Fuzzy Sets and Systems,vol.,no.
, pp. –, .
[] A. avaneswaran, S. S. Appadoo, and A. Paseka, “Weighted
possibilistic moments of fuzzy numbers with applications to
GARCH modeling and option pricing,” Mathematical and
Computer Modelling,vol.,no.-,pp.–,.
[] N. Srivastava, G. Hinton, A. Krizhevsky, I. Sutskever, and R.
Salakhutdinov, “Dropout: a simple way to prevent neural net-
works from overtting,” Journal of Machine Learning Research,
v
ol.,no.,pp.–,.
[] A. M. Rather, A. Agarwal, and V. N. Sastry, “Recurrent neural
network and a hybrid model for prediction of stock returns,”
Expert Systems with Applications,vol.,no.,pp.–,
.
[] R. D. A. Ara´
ujo, A. L. I. Oliveira, and S. Meira, “A hybrid model
for high-frequency stock market forecasting,” Expert Systems
with Applications,vol.,no.,pp.–,.
[] H. Chen, K. Xiao, J. Sun, and S. Wu, “A double-layer neu-
ral network framework for high-frequency forecasting,” ACM
Transactions on Management Information Systems (TMIS),vol.
, no. , article no. , .
[] A. Yoshihara, K. Fujikawa, K. Seki, and K. Uehara, “Predicting
Stock Market Trends by Recurrent Deep Neural Networks,” in
PRICAI 2014: Trends in Articial Intelligence,vol.ofLecture
Notes in Computer Science, pp. –, Springer International
Publishing, Cham, .
[] X.Ding,Y.Zhang,T.Liu,andJ.Duan,“Deeplearningforevent-
driven stock prediction,” in Proceedings of the 24th International
Joint Conference on Articial Intelligence, IJCAI 2015,pp.–
, arg, July .
[] Z. Zhou, J. Zhao, and K. Xu, “Can online emotions predict
the stock market in China?” in Proceedings of the International
Conference on Web Information Systems Engineering,pp.–
, .
[] S. Hochreiter and J. Schmidhuber, “Long short-term memory,”
Neural Computation,vol.,no.,pp.–,.
[] Y. LeCun, L. Bottou, Y. Bengio, and P. Haner, “Gradient-based
learning applied to document recognition,” Proceedings of the
IEEE, vol. , no. , pp. –, .
[] A. Ar´
evalo, J. Ni˜
no, G. Hern´
andez, and J. Sandoval, “High-
frequency trading strategy based on deep neural networks,”
in Proceedings of the International conference on intelligent
computing, pp. –, .
[] K.-J. Kim, “Financial time series forecasting using support
vector machines,” Neurocomputing,vol.,no.-,pp.–,
.
[] S. Madge, Predicting Stock Price Direction using Support
Vector Machines, Independent Work Report Spring, .
Available via license: CC BY 4.0
Content may be subject to copyright.