Visualizing and Forecasting Stocks: Submitted in Partial Fulfillment of The Requirement of For The Degree of
Visualizing and Forecasting Stocks: Submitted in Partial Fulfillment of The Requirement of For The Degree of
Submitted by
Alex Mathew
Joel James
Kris Godwin
Vinayak Patkar
Supervised by
Prof. Abhijeet Pasi
UNIVERSITY OF MUMBAI
2021-2022
APPROVAL SHEET
Submitted by
Supervisors:
Examiners: 1.
2.
Date:
Place:
Declaration
We declare that this written submission for S.E. M i n i P r o j e c t entitled “Visualizing
and forecasting stocks using dash” represent our ideas in our own words and where
others’ ideas or words have been included. We have adequately cited and referenced
the original sources. We also declared that we have adhere to all principles of
academic honesty and integrity and have not misrepresented or fabricated or falsified
any ideas / data / fact / source in our submission. We understand that any violation of
the above will cause for disciplinary action by institute and also evoke penal action
from the sources which have thus not been properly cited or from whom paper
permission have not been taken when needed.
Contents
Abstract iii
List of Figures vii
List of Tables ix
1 Introduction 11
1.1 Background 12
1.2 Motivation 12
3 Proposed System 23
3.1 Problem Statement 24
3.2 Scope 24
Abstract
Stock investments provide one of the highest returns in the market. Even though they are
volatile in nature, one can visualize share prices and other statistical factors which helps the
keen investors carefully decide on which company they want to spend their earnings on.
Developing this project idea using streamlit we can predict financial data of a specific
company by using the tabular data provided and we can analyse them. On top of it, we can use
a machine learning algorithm to predict the upcoming stock prices.
List of Figures
1.1 Flow chart
1.2 Block Diagram
1.3 Recurrent neural network
1.4 National stock exchange
1.5 Bombay stock exchange
1.6 Parabolic SAR
List of Tables
Chapter 1
Introduction
1.2 Motivation
Making money is important but also knowing how to invest it is also essential. To invest in
stocks are coming into greater and greater importance around the world. This is where we
come into picture where our predictive analytics of data aims at making predictions about
future outcomes based on data using ML.To widen the horizon of investment in stocks To
increase the knowledge of financial statement.Investment can help in meeting our long term
and short-term financial goals.
Chapter 2
Stock prediction using Jingyi Shen 1-RNN can model a 1-Taking more time to
RNN M Omair Shafig collection of records process
so that each pattern can 2-RNN's cannot be
be assumed to stacked up
be dependent on 3-Slow and complex
previous ones. training
2-They have the ability procedures
to learn by
themselves and produce
the output that is
not limited to the input
provided to them.
Stock prediction using Anjali Sunil 1-It provide us with a 1-Vanishing gradients
LSTM model and large range of 2-Requires alot of
visualization parameters such as resources and
learning rates, and time
input and output biases.
2-Forecasting models
using LSTM can
predict future values
based on previous,
sequential data which
can provide greater
accuracy.
Stock prediction using Gareja Pradip 1-ANN also has some 1-Duration of the
ANN Chitrak Bari significant network
J. Shiva Nandhini capabilities when it 2-No assurance of
comes to speed proper
and short-term plans. network structure
2-It can explore a vast
amount of data
and generate more
outcomes.
Stock prediction using Ashutosh Sharma 1-Data visualization can 1-While the data is
visualization help to convert vast data accurate in predicting
into the pictorial the situations, the
form which is easily visualization of the
understood. same just gives the
2-Having the excel estimation.
sheet data presented in 2-The basic formation
the forms of pie charts of data visualization
having the excel sheet happens with the human
data in the form of interface, meaning the
graph help the decision data that happens to be
maker to understand the the base of visualization
situation well can be
biased.
Fr.C. Rodrigues Institute of Technology, Vashi, Computer Engineering Department
Visualizing and forecasting stocks 15 | P a g e
National stock exchange 1. The sheer volume of trading 1. Every time an investor buys
activity ensure that the impact or sells his shares, he has to pay
cost is lower on the Exchange some amount as a brokerage
which in turn reduces the cost commission to the broker,
of trading to the investor. which kills the profit margin.
Bombay stock exchange 1. The BSE enables investors to 1. The majority of stock brokers
trade in equities, currencies, lack professionalism. They lack
debt instruments, derivatives, proper education, business
and mutual funds. skills, infra-structural facilities
etc. which inhibits them to
2 The BSE provides other provide proper service to
important capital market clients.
trading services such as risk
management, clearing, 2. There is a scarcity of floating
settlement, and investor stock in Indian stock
education. exchanges. The shares and
debentures offered for sale are a
small portion of total stocks.
Parabolic SAR 1. The advantage of the 1. The main drawback of this
indicator is that, during a strong indicator is that it doesn’t
trend, the indicator will provide good trade signals
highlight that strong trend, during sideways market
keeping the trader in the conditions.
trending move Without a clear trend, the
indicator constantly flip-flops
2. The indicator also gives an above and below the price
exit when there is a move
against the trend, which could 2. Parabolic SAR can give a
signal a reversal. false signal that is the wrong
signal. This indicator moves
from top to bottom and vice
versa while the market is in a
consolidated state. This means
that when the market is not
good, it can move upwards.
Chapter 3
Proposed System
3.2 Scope
Analysing stock data: We need to provide data of a particular company, and its Monthly Sales
/ Profit report with Months High and Low points of its Stock.
Analysing the factors: We will get the ‘demand and supply’ data entered by the user through
which we will declare their performance results and profit at the end.
If any news about a company is about to come and is it bad or good.
We will analyse the variations in the stock value of the companies with respect to these factors
using some data science algorithms.
5. Matplotlib
Chapter 4
4.1 Approach
4.1.1 Flow Chart
1.1 FLOWCHART
The process starts with accessing the data from the given API with the api key. After accessing the
data we pre process the data from by using the inbuilt python libraries. The machine learning
algorithm which we would be using is the LSTM model. The LSTM model works by using the
previous memory of the useful data. The processed data is given to the the model and trained for it.
The model is check for any faults or discrepancy. The model is then tested using the testing data.
The predictions are made after it.
Data from the historical data is collected for the specific company which we want. The attribute which
are not required are removed from the original dataset. The data is then divided into two parts the
training and testing data. The training dataset is provided to the algorithm which we would be using for
the prediction. Then we analyze the the prediction of the training and testing data and see for the errors
and faults. If the model is perfect then we can analyze that the model is working fine for us and can be
used for further predictions
Chapter 5
5.1. Observations
In the above table we can see the predictions for for the company APPLE. The
predictions were made for three consecutive days and was started on 15th
March 2022. The prediction for the next day was 160.24 $ and the observed
value was 159.59 $. Similarly for the next day the predicted value was 159.34
$ and the observed value was 160.62 $. For the last day the predicted value was
158.91 $ and the observed value was 163.98 $.
The above picture shows us the dropdown in which we can select particular
We can see the plot of the close data for the particular company
These are the prediction for seven days from 15 march 2022
LSTM:
Long Short-Term Memory (LSTM) networks are type of recurrent neural
network capable of learning order dependence in sequence prediction
problems. This is a behavior required in complex problem domains like
machine translation, speech recognition, and more. LSTMs are a complex area
of deep learning. It can be hard to get your hands around what LSTMs are, and
how terms like bidirectional and sequence-to-sequence relate to the field.
Chapter 6
We can say that with the help of our site a user will be able to visualize share prices and other statistical
factors which helps the keen investors carefully decide on which company they want to spend their
earning.At this point of time with adequate literature survey, we can say the proposed system will be
implemented with 80% accuracy and can suggest top 5 shares where a people/investor can invest in
near future probably for the period of 3 months.
References
[1] K. Pahwa and N. Agarwal, “Stock market analysis using supervised machine learning,” in 2019
International Conference on Machine Learning, Big Data, Cloud and Parallel Computing
(COMITCon). IEEE, 2019, pp. 197–200.
[2] Poonam Somani, Shreyas Talele, Suraj Sawant, (2014) “Stock market prediction using Hidden
Markov Model,”. IEEE 7th Joint International Information Technology and Artificial Intelligence
Conference
[3] W. E.-H. M. Mokalled and M. Jaber, “Automated stock price prediction using machine learning,”
in Proceedings of the Second Financial Narrative Processing Workshop (FNP 2019), 2019, pp. 16–24.
[4] U. JuHyok, P. Lu, C. Kim, U. Ryu, and K. Pak, ‘‘A new LSTM based reversal point prediction
method using upward/downward reversal point feature sets,’’ Chaos, Solitons Fractals, vol. 132,
Mar. 2020, Art. no. 109559.
[5] A. Kelotra and P. Pandey, ‘‘Stock market prediction using optimized deepConvLSTM
model,’’ Big Data, vol. 8, no. 1, pp. 5–24, Feb. 2020.
[6] C.-Y. Lee and V.-W. Soo, ‘‘Predict stock price with financial news based on recurrent
convolutional neural networks,’’ in Proc. Conf. Technol. Appl. Artif. Intell. (TAAI), Dec. 2017,
pp. 160–165.
[7] B. Labiad, A. Berrado, and L. Benabbou, ‘‘Short term prediction framework for Moroccan
stock market using artificial neural networks,’’ in Proc. 12th Int. Conf. Intell. Syst., Theories Appl.
(SITA), 2018, pp. 1–6.
Acknowledgement
1020209-Alex Mathew
1020210-Joel Mathew
1020212-Kris Godwin
1020226-Vinayak Patkar