0% found this document useful (0 votes)
354 views31 pages

Visualizing and Forecasting Stocks: Submitted in Partial Fulfillment of The Requirement of For The Degree of

This document presents a mini project report on visualizing and forecasting stocks. It discusses developing a stock prediction model using machine learning algorithms on historical stock data. The model will be integrated into an interactive dashboard using Streamlit for real-time stock analysis. The dashboard aims to help investors uncover insights and implement predictions to guide investment decisions. The report outlines the background, objectives, methodology, design, results and future scope of the project.

Uploaded by

Ainul Alam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
354 views31 pages

Visualizing and Forecasting Stocks: Submitted in Partial Fulfillment of The Requirement of For The Degree of

This document presents a mini project report on visualizing and forecasting stocks. It discusses developing a stock prediction model using machine learning algorithms on historical stock data. The model will be integrated into an interactive dashboard using Streamlit for real-time stock analysis. The dashboard aims to help investors uncover insights and implement predictions to guide investment decisions. The report outlines the background, objectives, methodology, design, results and future scope of the project.

Uploaded by

Ainul Alam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 31

Visualizing and forecasting stocks 1|Page

A Min i Project Report On

Visualizing and forecasting stocks

Submitted in partial fulfillment of the requirement of


University of Mumbai
For the Degree of
Bachelor of Engineering (SE)
in
COMPUTER ENGINEERING

Submitted by
Alex Mathew
Joel James
Kris Godwin
Vinayak Patkar

Supervised by
Prof. Abhijeet Pasi

Department of Computer Engineering


Fr. Conceicao Rodrigues Institute of Technology
Sector 9A, Vashi, Navi Mumbai - 400703

UNIVERSITY OF MUMBAI
2021-2022

Fr.C. Rodrigues Institute of Technology, Vashi, Computer Engineering Department


Visualizing and forecasting stocks 2|Page

APPROVAL SHEET

This is to certify that the Mi n i project entitled


“Visualizing and forecasting stocks”

Submitted by

Alex Mathew 1020209


Joel James 1020210
Kris Godwin 1020212
Vinayak Patkar 1020226

Supervisors:

Project Coordinator: Mrs. Dakshayani R

Examiners: 1.

2.

Head of Department: D r . Lata Ragha

Date:
Place:

Fr.C. Rodrigues Institute of Technology, Vashi, Computer Engineering Department


Visualizing and forecasting stocks 3|Page

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.

Project Group Members:

1. Alex Mathew, 1020209

2. Joel James, 1020210

3. Kris Godwin, 1020212

4. Vinayak Patkar, 1020226

Fr.C. Rodrigues Institute of Technology, Vashi, Computer Engineering Department


Visualizing and forecasting stocks 4|Page

Contents
Abstract iii
List of Figures vii
List of Tables ix
1 Introduction 11
1.1 Background 12

1.2 Motivation 12

1.3 Aim and Objective 13


1.4 Report Outline 13

2 Study Of the System 15


2.1 Literature Review 16
2.1.1 Stock prediction using RNN 16

2.1.2 Stock prediction using LSTM and 16


visualization
2.1.3 Stock prediction using RNN 16
2.1.4 Stock prediction using data visualization 16

2.2 Existing System 19


2.2.1 National stock exchange 19

2.2.2 Bombay stock exchange 19

2.2.3 Parabolic SAR 20

3 Proposed System 23
3.1 Problem Statement 24

3.2 Scope 24

3.3 Software Requirements 24

Fr.C. Rodrigues Institute of Technology, Vashi, Computer Engineering Department


Visualizing and forecasting stocks 5|Page
4 Design Of the System 26
4.1 Approach 26

4.1.1 Flow Chart 26

4.2 System Architecture 27

4.2.1 Block Diagram 27

5 Results and discussions 28


5.1 Observations 28

5.2 Step by step working


5.2.1 Screenshots of each steps 28

5.3 Important algorithms 29

6 Conclusion & Future Scope 30


References 31

Appendix A: Timeline Chart

Appendix B: Publication Details

Fr.C. Rodrigues Institute of Technology, Vashi, Computer Engineering Department


Visualizing and forecasting stocks 6|Page

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.

Fr.C. Rodrigues Institute of Technology, Vashi, Computer Engineering Department


Visualizing and forecasting stocks 7|Page

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

Fr.C. Rodrigues Institute of Technology, Vashi, Computer Engineering Department


Visualizing and forecasting stocks 8|Page

List of Tables

2.1 Research comparison

2.2 Existing System Comparison

Fr.C. Rodrigues Institute of Technology, Vashi, Computer Engineering Department


Visualizing and forecasting stocks 9|Page

Chapter 1

Introduction

Fr.C. Rodrigues Institute of Technology, Vashi, Computer Engineering Department


Visualizing and forecasting stocks 10 | P a g e
1.1 Background
Developing this project using Python we can predict financial data by using the tabular data
provided by the historical data. We can use a machine learning algorithm to predict the
upcoming stock prices.Stock cost prediction model and build an interactive dashboard for
stock analysis that provides a real-time data and it helps the investors uncover valuable
insights and for implementing stock market prediction we will be using various libraries like
plotly,streamlit python framework for building the dashboards.We will be using a national
stock index and money control Index to develop the dashboard for stock analysis

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.

Fr.C. Rodrigues Institute of Technology, Vashi, Computer Engineering Department


Visualizing and forecasting stocks 11 | P a g e
1.3 Aim and Objective
Aim is to visualize and forecast stocks and our objective is to help an organization to predict
certain outcomes and help them to tackle it certain procedures. Giving a brief knowledge of
all the basic terms involved in the process. Helping the user to analyse how stocks work and
how to gain profits. Our first focuses on researching company data and to determine whether
it has growth potential in the medium to long term.

1.4 Report Outline


The prediction of stock value is a complex task which needs a robust algorithm background
in order to compute the longer-term share prices. Stock prices are correlated within the nature
of market; hence it will be difficult to predict the costs. The proposed algorithm using the
market data to predict the share price using machine learning techniques like recurrent neural
network named as Long Short-term Memory, in that process weights are corrected for each
data points using stochastic gradient descent. This system will provide accurate outcomes in
comparison to currently available stock price predictor algorithms. The network is trained
and evaluated with various sizes of input data to urge the graphical outcomes.

Fr.C. Rodrigues Institute of Technology, Vashi, Computer Engineering Department


Visualizing and forecasting stocks 12 | P a g e

Chapter 2

Study of the System

Fr.C. Rodrigues Institute of Technology, Vashi, Computer Engineering Department


Visualizing and forecasting stocks 13 | P a g e
2.1 Literature Survey
2.1.1 Stock prediction using RNN [6]
Input will be taken from the data set. Input will be applied complex computations using
randomly initialized variables for predictions. After finding the error it will go back and
through the same path to adjust the variables until they get the proper output.

2.1.2 Stock prediction using LSTM model and visualization [4]


We have to collect historical stock data in order to train our model. As an initialization
they used python libraries which will help them in mathematical function, operations to
array, visualization etc. Then data pre-processing takes place which involves
transformation, cleaning and integration of data. Then prediction of stock will be done in
the LSTM model and in the visualization during the analysis of stock market trends, it is
done by the average of stock values.

2.1.3 Stock prediction using ANN [2]


Artificial Neural Network can be best represented as a weighted directed graph, where
the artificial neurons form the nodes. The association between the neurons outputs and
neuron inputs can be viewed as the directed edges with weights. The Artificial Neural
Network receives the input signal from the external source in the form of a pattern and
image in the form of a vector and the output is generated.

2.1.4 Stock prediction using machine learning [1]


The model depends on visualization of data. As the price trend is uncertain, with the help
of this model we can make the predictions of stocks. Basically, it depends on the Python
language to Visually analyze, calculate, and predict each stock. Before analyzing the data,
the data must be obtained from any API. The data is visualized using the graph, as it is
feasible. During the analysis of stock market trends, it is done by moving the average of
stock values. The RMSE, MSE, Manhattan formula are used to build and test the model.

Fr.C. Rodrigues Institute of Technology, Vashi, Computer Engineering Department


Visualizing and forecasting stocks 14 | P a g e
2.1.5 Summary table

NAME AUTHOR ADVANTAGES DISADVANTAGES

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

2.2 Existing System


2.2.1 National stock exchange
NSE is India's apex exchange board prevalent in the country. It provides a modern and fully
automated trading system with national reach. This has brought about speed, efficiency,
safety, and market integrity. It has setup facilities that serve as a model for the industry in
terms of systems, practices and procedures. Several innovations have been made in products
and services viz. demutualization of settlement cycles, dematerialization and intensive use of
information tech.

1.4 National stock exchange

2.2.2 Bombay stock exchange


BSE is an Indian stock exchange located on Dalal Street in Mumbai (Bombay). It is the oldest
stock exchange in South Asia. The BSE has been instrumental in developing India's capital
markets by providing an efficient platform for the Indian corporate sector to raise investment
capital. The BSE is known for its electronic trading system that provides fast and efficient
trade execution. The BSE enables investors to trade in equities, currencies, debt instruments,
derivatives, and mutual funds.

1.5 Bombay stock exchange

Fr.C. Rodrigues Institute of Technology, Vashi, Computer Engineering Department


Visualizing and forecasting stocks 16 | P a g e
2.2.3 Parabolic SAR
The parabolic SAR attempts to give traders an edge by highlighting the direction an asset is
moving, as well as providing entry and exit points.The parabolic SAR is an indicator used by
traders to determine trend direction and potential reversals in price.The technical indicator
uses a method called "SAR," or stop and reverse, to identify suitable exit and entry
points. The parabolic SAR indicator appears on a chart as a series of dots, either above or
below an asset's price, depending on the direction the price is moving. A dot is placed below
the price when it is trending upward, and above the price when it is trending downward.

Fr.C. Rodrigues Institute of Technology, Vashi, Computer Engineering Department


Visualizing and forecasting stocks 17 | P a g e

Name Advantages Disadvantages

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.

2. The trading system provides 2. Investment in NSE is not as


high level of trade and easy as investing in a lottery as
post-trade information. The you have to complete many
best 5 buy and sell orders are formalities in the process and
displayed on the trading system hence is time consuming
and the total number of
securities available for buying
and selling is also displayed.

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.

Fr.C. Rodrigues Institute of Technology, Vashi, Computer Engineering Department


Visualizing and forecasting stocks 18 | P a g e

Chapter 3

Proposed System

Fr.C. Rodrigues Institute of Technology, Vashi, Computer Engineering Department


Visualizing and forecasting stocks 19 | P a g e

3.1 Problem Statement


Creating an automated user-friendly trading predictor system, which predicts stock price
upward/downward movements that is necessary in the Indian stock market, given the
explosion of algorithmic trading, being one of the most prominent trends in the global
financial industry over recent decades.We focus on predicting the stock values using machine
learning algorithms. We have predicted the stock market price using the NSE dataset. In this
system, we will be able to train the machine from the various data points from the past to make
a future prediction. We will take the data from the previous year stocks to train the model. We
will use machine-learning libraries to solve the problem. The first one will be numpy, which
will be used to clean and manipulate the data, and get it into a form ready for analysis. The data
set we will use was from the previous year's stock markets collected from the public database
available online, 80 % of data was used to train the machine and the rest 20 % to test the data.
The basic approach of the supervised learning model is to learn the patterns and relationships
in the data from the training set and then reproduce them for the test data. We have used the
python pandas library for data processing which combined different datasets into a data frame.
The tuned-up data frame will allow us to prepare the data for feature extraction. The data
frame features will be the date and the closing price for a particular day. We will use all these
features to train the model and predict the object variable, which is the price for a given day.
We will also quantify the accuracy by using the predictions for the test set and the actual
values.

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.

3.3 Software requirement


1. Python (Language) 3.9.0 or higher
2. Jupyter(platform)
3. Numpy
4. Pandas

5. Matplotlib

Fr.C. Rodrigues Institute of Technology, Vashi, Computer Engineering Department


Visualizing and forecasting stocks 20 | P a g e

Chapter 4

Design of the System

Fr.C. Rodrigues Institute of Technology, Vashi, Computer Engineering Department


Visualizing and forecasting stocks 21 | P a g e

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.

Fr.C. Rodrigues Institute of Technology, Vashi, Computer Engineering Department


Visualizing and forecasting stocks 22 | P a g e

4.2 System Architecture


4.2.1 Block Diagram

1.2 BLOCK DIAGRAM

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

Fr.C. Rodrigues Institute of Technology, Vashi, Computer Engineering Department


Visualizing and forecasting stocks 23 | P a g e

Chapter 5

Result and discussions

Fr.C. Rodrigues Institute of Technology, Vashi, Computer Engineering Department


Visualizing and forecasting stocks 24 | P a g e

5.1. Observations

DATE PREDICTED TRUE VALUE

16-03-22 160.24 159.59


17-03-22 159.34 160.62
18-03-22 158.91 163.98

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 $.

Fr.C. Rodrigues Institute of Technology, Vashi, Computer Engineering Department


Visualizing and forecasting stocks 25 | P a g e

5.2 Step by step working

The above picture shows us the dropdown in which we can select particular

companies for which we can predict the future prices

We can see the plot of the close data for the particular company

Fr.C. Rodrigues Institute of Technology, Vashi, Computer Engineering Department


Visualizing and forecasting stocks 26 | P a g e

These are the parameters of our model

These are the prediction for seven days from 15 march 2022

5.3 Important algorithms

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.

Fr.C. Rodrigues Institute of Technology, Vashi, Computer Engineering Department


Visualizing and forecasting stocks 27 | P a g e

Chapter 6

Conclusion and Future Scope

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.

Fr.C. Rodrigues Institute of Technology, Vashi, Computer Engineering Department


Visualizing and forecasting stocks 28 | P a g e

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.

Fr.C. Rodrigues Institute of Technology, Vashi, Computer Engineering Department


Visualizing and forecasting stocks 29 | P a g e

Acknowledgement

Success of a project like this involving high technical expertise, patience


and massive support of guides, is possible when team members work
to-gather. We take this opportunity to express our gratitude to those
who have been instrumental in the successful completion of this pro ject.
We would like to appreciate the constant interest and support of our
mentor guide in our project and aiding us in developing a flair for the
field of Your Domain. We would always cherish the journey of
transforming the idea of our project into reality. We would like to show
our appreciation to Guide for his/her tremendous support and help,
without whom this pro ject would have reached nowhere. We would also
like to thank our project coordinator Mrs. Dakshayani R for providing
us with regular inputs about documentation and project timeline. A big
thanks to our HOD Dr. Lata Ragha for all the encouragement given to
our team. We would also like to thank our principal, Dr. S. M. Khot,
and our college, Fr. C. Rodrigues Institute of Technology, Vashi,
for giving us the opportunity and the environment to learn and grow.

Project Group Members:

1020209-Alex Mathew

1020210-Joel Mathew

1020212-Kris Godwin

1020226-Vinayak Patkar

Fr.C. Rodrigues Institute of Technology, Vashi, Computer Engineering Department


Visualizing and forecasting stocks 30 | P a g e

Appendix A: Timeline Chart

Fr.C. Rodrigues Institute of Technology, Vashi, Computer Engineering Department


Visualizing and forecasting stocks 31 | P a g e

Appendix B: Publication Details

Fr.C. Rodrigues Institute of Technology, Vashi, Computer Engineering Department

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy