2019 7th Iranian Joint Congress on Fuzzy and Intelligent Systems (CFIS)
Forecasting Stock Market Price Using Deep Neural
Networks
1
st
Nima Gozalpour
dept. of Electrical Engineering
K. N. Toosi University of Technology
Tehran, Iran
nimagozalpour@email.kntu.ac.ir
2
nd
Mohammad Teshnehlab
dept. of Electrical Engineering
K. N. Toosi University of Technology
Tehran, Iran
teshnehlab@eetd.kntu.ac.ir
Abstract—Investors in the stock market expect to make their
profits, meaning they are looking for a profit by buying a share at
low prices and selling it to the highest level, which requires stock
price prediction. Significant challenges arise due to the non-linear
and chaotic nature of stock markets when predicting prices in
time series. In this research, unsupervised methods were used
for the reduction of the input dimension and creating indicators.
In the next step, the output of the unsupervised model was fed
as input into the Jordan Recursive Neural Network(JRNN) to
predict the closing price of the upcoming day. To illustrate the
functionality and superiority of the proposed algorithm, data
from three different and challenging stock symbols of Nasdaq
were used. Ultimately, the model was evaluated with mean square
error and mean absolute percentage error.
Index Terms—Forecasting, Principal Component Analysis,
Auto-encoder, Jordan Recursive Neural Network.
I. I NTRODUCTION
The necessity of investment for the development of each
country is indisputable. Directing and administering funds,
liquid assets and personal savings towards productive invest-
ments will increase the production and growth of the gross
national income and ultimately create jobs and increase per
capita income and welfare. In this process, the stock market
can play an important role. If we have a precise prediction
of each company, then the market capital can be leveraged
towards these productive companies, so that the investors get
the best profit with the least risk. In recent decades, with the
advent of statistics and artificial intelligence, there are many
ways to predict the stock market. However, the problem with
these methods is the high dimensionality of data due to the
different methods of calculating technical indicators or finding
the sufficent length of the days that effect on next day price. To
solve this problem, decision tree [1], genetic algorithm [2], and
delay coordinate embedding [3] methods are used, however,
in recent years, with the introduction of deep neural networks
[4] with its undeniably impressive results in the field of image
and audio recognition [5], [6] as a dimensionality reduction
978-1-7281-0673-1/19/$31.00 ©2019 IEEE
and feature extraction method, we sought to use deep neural
networks to reduce the dimensionality and creating indicators
without human intervention whatsoever.
II. DATASET
In order to test the proposed system, data of three NAS-
DAQ symbols, Microsoft Corporation, Intel Corporation and
National Bankshares Inc. were used between 2007 and 2017,
where each day’s data includes five variables, such as closing
price, opening price, highest Price, lowest price and volume of
the stock transaction. Time series systems depend heavily on
the data of previous days [7]. For this reason, after normalizing
any of the variables between zero and one, the input data to
the system should include the information of past days, it was
concluded by trial and error that 30 previous days of data
are sufficient enough. Due to having 5 variables for each day,
the qualities of each sample will be 150 and according to the
availability of the data for the last 10 years, we will have
2489 samples for each symbol, of which 80% will be given
as training data, 10% Validation and the remaining 10% were
used as test data.
III. Methodology
A. Principal Component Analysis
Principal component analysis is a technique that is used
extensively to reduce the dimension and noise of data [8].
This technique finds the input data model with maximal
variance. The algorithm was originally introduced by Pearson
[9]. However, the modern model was formulated by Hotelling
[10]. The analysis of the principal components was followed
by a linear combination of data that had the maximum variance
and could be separated into the main components, so that the
highest variance was in the highest component, in other words,
the most critical information could be extracted from the data.
The algorithm is used in a variety of areas, including gene
analysis and face detection. Figure 1 shows the model process.
As seen in Figure 1, PCA reduces the number of features from