You are on page 1of 13

STOCK MARKET

ANALYSIS
NAME – AVINASH PANDEY
SUBJECT – CAPSTONE
PROJECT
STOCK MARKET ANALYSIS

• The given project is an attempt to design a system that predicts stock


price using the ARIMA model. It takes the past six years of data from
NSE and then uses this data to train the model and then uses the
trained model to predict the close price of a stock based on the live
stock data. The pages have an auto-refresh script of 8 seconds that
keeps updating the live data after every 8 seconds.
• WebInterFace is the file that has the web interface of the project
created using flask.

• GUI.py is the file that has a GUI interface designed using Tkinter.

• ProjTest is the research file that has a comaparative study of ARIMA,


LSTM and MLP. It uses the same stock for all three models over the same
period of time for same train and test data and compares the accuracy of
all three models.
Python Libraries used:
• ##### nsepy
• ##### nsetools
• ##### statsmodels
• ##### bokeh
• ##### rpy2
• ##### flask
• ##### ttkwidgets
R libraries used:

• nse2r
Steps to start the project:
• ### 1. Install python and its libraries mentioned above (to install the
python library use pip command: pip install <library_name>)
• ### 2. Install R and its libraries mentioned above (to install the R
packages use install.packages(): install.packages("<package_name>")
• ### 3. To start the web interface run ProjWeb.py and open the
deployment server URL in the browser
• ### 4. To start the GUI interface run the GUI.py file.
ABSTRACT
• In contrast to the sudden change in global scenario with respect to shifting of
things to online on a vast scale and unprecedented fluctuation of the global
market, stocks have gained a lot of attention. Market prediction has always been
an enigma for investors. Whether it be decodingthe way market repeats itself or
analyzing the trends that could help get better value for the investment, investors
have always been keen on finding an efficient solution that could predict the price
with utmost accuracy. This paper presents a study of different technologies that
are currently being used for analyzing and predicting the stock market trend. The
analysis of past trends has been done using the values for previous close,open,
high, low, and close of the stock for a period of six years from the data that has
been gathered from the stocks registered on the National Stock Exchange (NSE).
For handling such a huge dataset and analyzing the trend in it, Python and R
programming languages have been extensively used.
KEYWORD
• ARIMA, MLP, LSTM, nsepy, Stock Prediction,
NSE, Root Mean Squared Error, neural
network.
INTRODUCTION
• Stock market prediction has always been a conundrum for investors.
With the advancements in technologies variety of new ways have
emerged that focus on stock prediction. Machine learning with its
advantage of deep learning from data analysis is one of them that has
gained most of the attraction. There are various techniques in deep
learning that analyze and learn from the dataset about the past trend
and then predicting the future values. This paper focuses on three
major techniques namely Autoregressive Integrated Moving Average
(ARIMA) which works on time series analysis, Multilayer Perceptron
(MLP), and Long Short-Term Memory (LSTM).
ARIMA model
• Various researchers have studied the benefits of ARIMA model for
financial prediction especially for short-term predictions . Some of
them have also tried to build a system that uses this model to predict
the prices of stocks .
LSTM model:
• The Long Short-Term Memory (LSTM) is a special type of Recurrent Neural
Network (RNN) that has the capacity to learn from long term dependencies
in the data through blocks in contrast to traditional neural networks that
use simple feedback loop . Due to its complex structure, it is more
controllable for outputs but with the drawback of increased computational
cost. For any LSTM, the number of neurons, the number of layers, and the
density of the neural network play a vital role in the learning process of the
neural network. There is no such formula to calculate the exact number of
neurons that would be sufficient for the data . It must be adjusted manually
to get the optimal result meanwhile keeping in mind the time taken by the
machine to learn from training dataset.
LSTM and MLP model:
• Various literatures have tried to compare the different types of neural
networks and their capabilities to predict the values . Through all the
observations it can be clearly inferred that it is difficult to select a suitable
model that could work for all the stocks. Different stocks have considerably
significant results for different neural network models. On an observatory
comparison between LSTM and MLP of results obtained from different
researches it can be seen that there is a very minute difference in the values
that are obtained from LSTM and that are obtained from MLP. In a research
that uses a model selection algorithm to select a neural network model that
would accurately predict the value of stocks, it was concluded that using
this approach generated better results than that of ARIMA model .
METHODOLOGY
• ARIMA model
• MLP model

You might also like