0% found this document useful (0 votes)
8 views65 pages

Project

The project report focuses on stock market prediction and analysis using statistical and machine learning techniques to provide insights for investors. It aims to enhance prediction accuracy by identifying latent dynamics in stock data rather than fitting it to a specific model. The report outlines the project's objectives, methodologies, technologies used, and its structure, emphasizing the importance of informed investment decisions.
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)
8 views65 pages

Project

The project report focuses on stock market prediction and analysis using statistical and machine learning techniques to provide insights for investors. It aims to enhance prediction accuracy by identifying latent dynamics in stock data rather than fitting it to a specific model. The report outlines the project's objectives, methodologies, technologies used, and its structure, emphasizing the importance of informed investment decisions.
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

Stocks (Stock Market

Prediction &Analysis)
A Project Report

Submitted in partial fulfilment of the

Requirements for the award of the Degree of


BACHELOR OF SCIENCE (INFORMATION TECHNOLOGY)
By

Abhay Choubey

2106006

Shruti Diwale

2106067

Under the esteemed guidance of

Mr. Sumeet Rathod

Assistant Professor

DEPARTMENT OF INFORMATION TECHNOLOGY

Thakur Ramnarayan College Of Arts And Commerce

(Affiliated to University of Mumbai)


MUMBAI, 400056
MAHARASHTRA
2022 – 2023
PROFORMA FOR THE APPROVAL PROJECT PROPOSAL

PNR No.: …………………… Roll no: …………………

1. Name of the Student

2. Title of the Project

Stock (stock market prediction & analysis)

3. Name of the Guide

4. Teaching experience of the Guide _

5. Is this your first submission? Yes No

Signature of the Student Signature of the Guide

Date: ………………… Date: …………………….

Signature of the
Coordinator Date:
…………………
ABSTRACT

The main purpose of Stocks is to forecast the future behavior of the stock market by
using various statistical and machine learning techniques. The primary goal is to provide
investors with insights into the market trends and future values of stocks, which can help them
make informed investment decisions.

A user can access the account with valid details. Researchers have been studying
different methods to effectively predict the stock market price. Useful prediction systems allow
traders to get better insights about data such as: future trends. Also, investors have a major
benefit since the analysis give future conditions of the market. One such method is to use
machine learning algorithms for forecasting.

This project’s objective is to improve the quality of output of stock market predicted
by using stock value. A number of researchers have come up with various ways to solve this
problem, mainly there are traditional methods so far, such as artificial neural network is a way
to get hidden patterns and classify the data which is used in predicting stock market. This
project proposes a different method for pronating stock market prices. It does not fit the data
to a specific model; rather we are identifying the latent dynamics existing in the data using
machine learning architectures.

i
ACKNOWLEDGEMENT

For the success of this project, we would like to appreciate the assistance of everyone
who has been a part of the development or who has been the source of motivation for us.

To start with we would love to appreciate the efforts put up by our teacher in charge
Mr. Sumeet Rathod Without your guidance and key element, we do not think it was possible
to build the project. She always mentoring us and guiding us with all the affections and care.

Not to forget we would like to thank our teaching and non-teaching staff of the college
without whose support it was not even possible to think this big. We would like to thank our
fellow students and our friends for helping us carry out the testing procedures.

I am thankful and fortunate to get constant encouragement, support and guidance from
all the teaching staff of the [Link].(I.T.) Department of Thakur Ramnarayan College of
Arts and Commerce, which helped me in successfully completing my project work.

Lastly not to forget but maybe above all we would love to thank our parents for allowing us to
do this for being there as a backbone to us. It was really an unimaginable task without your
support.

ii
DECLARATION

I hereby declare that the project entitled, “Stocks(Stock Market Analysis & Prediction)”
done at MUMBAI, has not been in any case duplicated to submit to any other university for
the award of any degree. To the best of my knowledge other than me, no one has submitted to
any other university.

The project is done in partial fulfilment of the requirements for the award of degree of
BACHELOR OF SCIENCE (INFORMATION TECHNOLOGY) to be submitted as final
semester project as part of our curriculum.

ABHAY CHOUBEY
SHRUTI DIWALE

iii
TABLE OF CONTENTS

Sr. No. Title Page No.


1 Abstract i
2 Acknowledgement ii
3 Declaration iii
4 List of Tables vii
5 List of Figures viii
Chapter 1: Introduction 1-4
1 1.1 Background 1
1.2 Objectives 2
1.3 Purpose, Scope & Applicability 2
1.3.1 Purpose 2
1.3.2 Scope 2
1.3.3 Applicability 3
1.4 Achievements 3
1.5 Organization of Report 4
Chapter 2: Survey of Technologies 5-9
2 2.1 Survey of Technologies 5
2.2 Technologies used in current Project 5
2.2.1 Python 5
2.2.2 Comparing Technologies 6
2.2.3 HTML, CSS and JavaScript 7
2.2.4 Machine Learning 7
2.2.5 API Used 8
2.2.6 Framework used 9
Chapter 3: Requirement Analysis 11-16
3 3.1 Problem Definition 11
3.1.1 Problem Solution 11
3.2 Requirement Specification 12
3.2.1 Existing System 12
3.2.2 Proposed System 12

iv
3.3 Planning and Scheduling 13
3.3.1 Gantt Chart 14
3.4 Hardware & Software Requirements 15
3.4.1 Hardware Requirements 15
3.4.2 Software Requirements 15
3.5 Preliminary Product Description 16
Chapter 4: System Design 17-31
4 4.1 Basic Modules 17
4.2 Procedural Design 17
4.2.1 Class Diagram 19
4.2.2 Flow Chart Diagram 20
4.2.3 Use Case Diagram 21
4.2.4 Activity Diagram 22
4.2.5 Sequence Diagram 23
4.2.6 Data Flow Diagram 24
4.4 User Interface Design 25
4.5 Security Issues 28
4.6 Test Cases Design 29
Chapter 5: Implementation and Testing 32-44
5 5.1 Implementation Approaches 32
5.2 Coding Details and Code Efficiency 33
5.2.1 Code Efficiency 43
5.3 Testing Approach 44
5.3.1 Unit Testing 44
5.3.2 Integration Testing 44
5.3.3 Acceptance Testing 44
5.3.4 System Testing 44
5.3.5 Usability Testing 44
Chapter 6: Results and Discussion 45-52
6 6.1 Test Reports 45
6.2 User Documentation 48
6.2.1 Home Page 48

v
6.2.2 Ticker Information Page 49
6.2.3 Predict Page 50
6.2.4 Data Representation Page 51
6.2.5 Tools 51
Chapter 7: Conclusion 53-54
7 7.1 Conclusion 53
7.1.1 Significance of the System 53
7.2 Limitations of the System 53
7.3 Future Scope of the Project 54
References 55

vi
LIST OF TABLES

Table No. Table Name Page No.

Technologies Used in the Current Project


2.1 5
Comparing Bootstrap and Wordpress
2.2 6
Preliminary Product Description
3.1 16
Test cases design
4.1 30
Test Report Summary
6.1 45
Test Reports
6.2 46

vii
LIST OF FIGURES

Page No.
Figure No. Table Figure

2.1 HTML, CSS & JavaScript 7


2.2 Bootstrap 9
3.1 Spiral Model 13
3.2 Gantt Chart 14
4.1 Class Diagram 19
4.2 Flow Chart 20
4.3 Use Case Diagram 21
4.4 Activity Diagram 22
4.5 Sequence Diagram 23
4.6 Data Flow Diagram 24
4.7 Home Page 25
4.8 Predict Page 26
4.9 Graphical Visuals 27
4.10 Ticker Info Page 27
5.1 Agile Methodology 32
6.1 Home Page 48
6.2 Ticker information Page 49
6.3 Yahoo Finance Page 49
6.4 Predict Data 50
6.5 Data Representation 51
6.6 Graphical Visual 51
6.7 Enhancing Tools 51

viii
Chapter 1:
Introduction
1.1 Background
Most people around the world dream of having more money in their pockets. The trick, however, is
not to work harder, but to work smarter. One way to make more money is to invest on the stock exchange,
but due to its seemingly random and unpredictable nature, people are reluctant to do so. At first glance the
stock exchange may seem random and unpredictable, but that is not the entire truth. If the stock exchange
is carefully analysed a pattern will slowly emerge and it will be evident that there are a number of variables
that contributes to a company’s share price. Such variables are positive and negative news, price target,
conjuncture, oil price and other economic influential country’s stock exchange just to name a few.

One of the most common share analysis tool used today is the so called regression channel.
These regression models are often sole based on the closing price vs. time and is more reminiscent of a
technical analysis rather than a prediction of the shares closing price. This project aims to take it a step
further by predicting a closing price for each day. The approach is to determine which variables that has
an influence on company’s share price, design a multiple linear regression model and perform prediction
using Microsoft Excel 2010’s[18] built-in function LINEST to predict the closing price of 44 companies
listed on the OMX Stockholm stock exchange’s Large Cap list. The Large Cap list was at the time made
up of 62 companies, but sufficient information was only found for 44 of them. Unlike the regression
channels that can be used for forecasting the direction of shares for several days ahead, even weeks, this
model will be used to analyse share prices on a daily basis for what resembles day trading. The goal with
the final model is to maximize the profit and minimize the losses based on a daily analysis during the
time period 2012-02-22 to 2013-02-20.

Page | 1
1.2 Objective
In the current emerging competitive market, predicting the stock returns as well as the company's
financial status in advance will provide more benefits for the investors in order to invest confidently. Stock
prediction can be done by using the current and previous data available on the market

 To Predict Stock Price Efficiently.


 To overcome the difficulty for beginners in stock market investment.
 To enhance the work for analysts.
 To get the information of the company (Last sale, net change, percent change, Market Capital,
Country, IPO year, Volume, Sector, Industry).

1.3 Purpose, scope and application

1.3.1 : Purpose

Stock market prediction aims to determine the future movement of the stock value of a financial
exchange. The accurate prediction of share price movement will lead to more profit investors can
make.

1.3.2 : Scope
As this software aims to predict the future movement of the stock value it has a wide scope in
future. As it its accuracy is well defined and trusted as you can compare it on the graph the person
using it will gain the confidence and clarity in the mind and able to make decision properly.
 Conduct stock market analysis. Find out stocks with low PE ratios.

 Once you do that, compare with historical PE ratios and share prices.

 Read up about the company, its financial performance and future outlook. If you are satisfied
that the company is inherently worthy, select the stock.

 Wait for the prices to decline. Buy at lows.

Page | 2
1.3.3 Applicability

Stock market prediction and analysis has a wide range of applicability across various industries and
stakeholders, including:
1. Investors: Stock market prediction and analysis can help investors make informed investment
decisions by providing insights into market trends and future stock values.
2. Financial Institutions: Financial institutions can use stock market prediction and analysis to
manage risk, monitor market trends, and identify potential threats to financial stability.
3. Companies: Companies can use stock market prediction and analysis to make strategic decisions
regarding their operations, expansion plans, and financial investments.
4. Regulators: Regulators can use stock market prediction and analysis to monitor market activities
and detect any irregularities or fraud.
5. Academia: Academics can use stock market prediction and analysis to study the behavior of
financial markets and develop new models and theories.
6. Government Agencies: Government agencies can use stock market prediction and analysis to
inform policy decisions related to the economy and financial markets.
Overall, stock market prediction and analysis can be applied across various industries and
stakeholders, and it has become an essential tool for making informed decisions related to investments
and financial management

1.4 Achievements

Stock market prediction and analysis is used to analysis stock price and on the basis of analysis
prediction is done. This is efficient for individuals, teams and organization to help them gather
information about the particular stock and thereby makes a profit out of it.

 Provides data in a graphical format.


 You can get the predicted values till 1 years as well.
 How accurate the value is also shown on the same graph so that you can compare it with the
current stock value.
 User can get data on phone as well.

Page | 3
1.5 Organization of report
This report is structured as follows:

Chapter 2: Explores different technologies that can be used to bring the project to life. The chapter also
examines the existing system of the related project and presents the proposed system to improve upon
the existing system.

Chapter 3: The requirements of the project are gathered, and the plans for its implementation are
discussed. Moreover, this chapter also outlines the software and hardware requirements for the project.

Chapter 4: Is dedicated to the data design and various models used in the project. It also discusses how
the data is handled and addresses the security issues related to the project.

Chapter 5: Details the implementation and testing of the project. This chapter outlines how the project
was tested and implemented and highlights the challenges faced during the implementation process.

Chapter 6: Summarizes the project by discussing its future enhancements and limitations. This chapter
is dedicated to the conclusion of the project and provides insights into future improvements.

Chapter 7: Contains the references and bibliography used in the report. The references are included to
provide further resources for readers who are interested in the topic.

Page | 4
Chapter 2
Survey Of Technologies
2.1 Technologies Used

Table 2.1: Technologies used in Current Project

Technologies used in current Project

HTML, CSS, JavaScript, Bootstrap, Python

2.2 Languages Used

2.2.1 Python

Python is a high-level, interpreted, interactive and object-oriented scripting language. Python is designed
to be highly readable. It uses English keywords frequently where as other languages use punctuation, and
it has fewer syntactical constructions than other languages.

 Python is Interpreted − Python is processed at runtime by the interpreter. You do not need to
compile your program before executing it. This is similar to PERL and PHP.
 Python is Interactive − You can actually sit at a Python prompt and interact with the interpreter
directly to write your programs.
 Python is Object-Oriented − Python supports Object-Oriented style or technique of programming
that encapsulates code within objects.
 Python is a Beginner's Language − Python is a great language for the beginner-level
programmers and supports the development of a wide range of applications from simple text
processing to WWW browsers to games.

Python's features include −

 Easy-to-read − Python code is more clearly defined and visible to the eyes.
 Easy-to-maintain − Python's source code is fairly easy-to-maintain.

Page | 5
 A broad standard library − Python's bulk of the library is very portable and cross-platform
compatible on UNIX, Windows, and Macintosh.
 Interactive Mode − Python has support for an interactive mode which allows interactive testing
and debugging of snippets of code.
 GUI Programming − Python supports GUI applications that can be created and ported to many
system calls, libraries and windows systems, such as Windows MFC, Macintosh, and the X
Window system of Unix.
 Scalable − Python provides a better structure and support for large programs than shell scripting.

2.2.2 Comparing Technologies

Table 2.2: Comparing Bootstrap and WordPress

Bootstrap WordPress

WordPress is also free open-source Content


Bootstrap is free open-source CSS framework
Management System (CMS), which is used to
which is used to develop responsive Websites.
develop dynamic website.

Bootstrap written in HTML, CSS & JavaScript. WordPress written only on PHP.

Bootstrap is front-end framework which is used


WordPress used both front-end and back-end for
for designing and user interface of Static
creating Dynamic websites.
website.

In Bootstrap there is no features of pre-existing In WordPress lots of pre-existing themes which is


theme. used to create dynamic website.

To develop website on Bootstrap, you must In WordPress you must know the customization
know coding and strong of HTML, CSS. of site and drag and drop

In Bootstrap there is grid system to adjust the In WordPress we use drag and drop system for
webpages on different section of website. creating website.

SEO is not provided by Bootstrap. WordPress is SEO friendly.

Page | 6
2.2.3 HTML, CSS, and JavaScript

These three languages are the root of any website or web app as HTML builds the basic structure or
skeleton of a website then to give proper representation to that skeleton CSS comes into picture, but to
make your website or web app interactive we need to add JavaScript.

Fig 2.1 – HTML, CSS, JS

2.2.4 Machine Learning

Machine learning (ML) is a type of artificial intelligence (AI) that allows software applications to
become more accurate at predicting outcomes without being explicitly programmed to do so. Machine
learning algorithms use historical data as input to predict new output values

Recommendation engines are a common use case for machine learning. Other popular uses include
fraud detection, spam filtering, malware threat detection, business process automation (BPA) and
Predictive maintenance. We are using ML mainly for Predictive maintenance in project on the
basis of Past & Present data.

Machine learning is important because it gives enterprises a view of trends in customer behaviour and
business operational patterns, as well as supports the development of new products. Many of today's
leading companies, such as Facebook, Google and Uber, make machine learning a central part of their
operations. Machine learning has become a significant competitive differentiator for many companies.

Page | 7
2.2.5 API Used

YFinance API

yfinance is a popular Python library that provides a simple way to access historical market data from
Yahoo! Finance. It is a free, open-source library that allows users to download data for stocks, ETFs,
mutual funds, and currencies.

Some key features of the yfinance library include:

1. Historical Data: The library allows users to download historical market data for a specified time
period.

2. Ticker Information: Users can get information about a specific ticker, including its name, sector,
and industry.

3. Financial Statements: The library provides access to a company's financial statements, including
balance sheets, income statements, and cash flow statements.

4. Technical Indicators: yfinance also supports technical analysis by providing a wide range of
technical indicators such as moving averages, relative strength index (RSI), and Bollinger Bands.

The yfinance library can be installed using pip, and it is compatible with Python 3.x. It provides an
easy-to-use interface that makes it simple to access financial data and perform analysis. With its rich
set of features and ease of use, yfinance is a popular choice among developers and analysts who
work with financial data.

Page | 8
2.2.6 Framework used

1. Bootstrap

Fig 2.2 – Bootstrap

Bootstrap is a popular front-end development framework that was originally developed by Twitter. It
is an open-source framework that provides developers with a set of pre-designed HTML, CSS, and
JavaScript components and templates that can be used to create responsive and mobile-first web
applications.

Some key features of Bootstrap include:

1. Responsive Design: Bootstrap makes it easy to create responsive web designs that adapt to
different screen sizes and devices.

2. CSS Preprocessing: Bootstrap uses the LESS preprocessor for CSS, which allows developers to
write more efficient and maintainable CSS code.

3. Cross-Browser Compatibility: Bootstrap is designed to work with all modern web browsers,
including Chrome, Firefox, Safari, and Internet Explorer.

4. Component Library: Bootstrap includes a large library of pre-designed UI components, such as


forms, buttons, dropdowns, and navigation menus, that can be easily customized and used in web
applications.

Page | 9
5. JavaScript Plugins: Bootstrap includes a set of JavaScript plugins, such as modals, carousels, and
tooltips, that can be used to add interactive features to web applications.

Its popularity and large community of developers mean that there are many resources available,
including documentation, tutorials, and support forums, that can help developers learn and use the
framework effectively.

2. DJANGO

Django is a high-level, open-source web framework written in Python. It is designed to help


developers build scalable and maintainable web applications quickly and efficiently.

Some key features of Django include:-

1. Model-View-Controller (MVC) architecture: Django follows a Model-View-Controller (MVC)


architecture, which separates the application logic into three components: the model, the view,
and the controller.
2. Object-Relational Mapping (ORM): Django provides an Object-Relational Mapping (ORM)
layer, which makes it easy to interact with databases and perform CRUD (Create, Read, Update
and Delete) operations.
3. Built-in Administration Interface: Django comes with a built-in administration interface that
makes it easy to manage application data and perform administrative tasks.
4. URL Routing: Django provides a powerful URL routing system that makes it easy to map URLs
to specific views.
5. Templeton Engine: Django includes a built-in templating engine that allows developers to create
dynamic HTML pages.
6. Scalability: Django is highly scalable and can handle large traffic volumes.

Django has a large and active community of developers, which means that there are many resources
available, including documentation, tutorials, and support forums. Django is widely used for building a
variety of web applications, including social networks, content management systems, and e-commerce
websites.

Page | 10
Chapter 3
Requirements And Analysis
3.1 Problem Definition:

Investors are familiar with the saying, “buy low, sell high” but this does not provide enough context
to make proper investment decisions. Before an investor invests in any stock, he needs to be aware how
the stock market behaves. Investing in a good stock but at a bad time can have disastrous results, while
investment in a mediocre stock at the right time can bear profits. Financial investors of today are facing
this problem of trading as they do not properly understand as to which stocks to buy or which stocks to
sell in order to get optimum profits. Predicting long term value of the stock is relatively easy than
predicting on day-‐to-‐day basis as the stocks fluctuate rapidly every hour based on world events.

3.1.1 Problem Solution:

The solution to this problem could be the development of a reliable stock market prediction and
analysis system that can assist investors in making informed investment decisions. The system should
incorporate machine learning algorithms to predict stock prices and identify potential trends. It should
also provide a user-friendly interface that allows investors to visualize stock market data, including
historical prices, trading volume, company financials, news articles, and other relevant information.

The system should also include a performance evaluation module that measures the accuracy of the
prediction models and provides metrics such as mean squared error, root mean squared error, and
accuracy scores. Additionally, the system should offer portfolio management features that enable users
to manage their investments by providing recommendations on which stocks to buy or sell based on the
prediction models.

By providing accurate predictions and assisting investors in making informed investment decisions, the
stock market prediction and analysis system can help investors optimize their profits and reduce the risk
of financial losses.

Page | 11
3.2 Requirement Specification

Requirement specification for this project is quiet simple as there is no login module. Its quit simple.
First of all user needs to enthusiast for the US stock exchange. Second of all user should have the basic
knowledge of stock market like how it works and like the process. Thirdly user should ready to take risk
and trust this web app.

1. The user must input a valid stock ticker symbol in the designated field to retrieve the analyzed
data along with predicted patterns.

2. The user must specify the number of days for which they want the stock pattern to be predicted.

3. The specified number of days should not exceed 1.5 years.

4. The stock ticker symbol must match the information listed in the official list of all stock tickers.

3.2.1 Existing System:

The stock market facilitates the buying and selling of securities, with participants including
investors, traders, brokers, exchanges, and regulators. Economic conditions, company performance,
news and events, and investor sentiment all influence stock prices and market performance

3.2.2 Proposed System:

These few features are proposed by this system:

1. Use historical data, technical analysis, and machine learning to predict stock prices and trends.

2. Include a backtesting feature to evaluate and refine the algorithms.

3. Focus on providing accurate and reliable predictions for informed decision making.

4. Continuously improve the system with new data and algorithms.

Page | 12
3.3 Planning and Scheduling

System design is the process of defining the architecture, components, modules, interfaces, and
data for a system to satisfy specified requirements through system modelling. One could see it as the
application of systems theory to produce development. The design of this system will be user friendly.

It shall be designed in such a way that employees will be able to navigate easily through the
information supplied on the system. In other words, system design consists of design activities that
produce system specifications satisfying the functional requirements that were developed in the system
analysis process. System design specifies how the system will accomplish. System design is the structural
implementation of the system analysis.

Figure 3.1: Spiral Model Diagram

Page | 13
3.3.1 Gantt Chart

A Gantt chart is a commonly used graphical depiction of a project schedule. It's a type of bar chart
showing the start and finish dates of a project's elements such as resources, planning and dependencies. In
most instances, the charts displayed as a horizontal bar chart. Horizontal bars of different lengths represent
the project timeline, which can include task sequences, duration, and the start and end dates for each task.
A Gantt chart helps in scheduling, managing, and monitoring specific tasks and resources in a project. The
chart shows the project timeline, which includes scheduled and completed work over a period. The Gantt
chart aids project managers in communicating project status or plans and also helps ensure the project
remains on track.

Fig 3.2 - Gantt chart

Page | 14
KEY TAKEAWAYS

 A Gantt chart is a visualization that helps in scheduling, managing, and monitoring specific tasks
and resources in a project.
 It consists of a list of tasks and bars depicting each task's progress.
 It's the most widely used chart in project management.

Gantt charts are used in heavy industries for projects like building dams, bridges, and highways, as well
as software development and building out of other goods and services.

3.4 Hardware and Software Requirements.

3.4.1 Software requirements:

 Visual Studio Code , pycharm

 Coding Languages: Python, [Link]

 Backend: Yahoo Finance API

 Google Chrome/Microsoft Edge/Mozilla Firefox/Brave/Safari etc.


 Windows/Mac/Linux(Ubuntu).
3.4.2 Hardware requirements:

 RAM: 4 GB
 Storage: 500 GB
 CPU: 2 GHz or faster
 Architecture: 32-bit or 64-bit

Page | 15
3.5 Preliminary Product Description

Preliminary Product Description is to identify the requirements and objectives of the new system and to
define the functions and operation of the application.
Following is a list of functions and operations performed by the system for users.

Table 3.1 Preliminary Product Description


MAJOR TECHNIQUE USER
OF PROJECT
Sign up/login NO
Change Time frame YES
Change Stock Company YES
Create Portfolio NO
Settings YES
Is graph study possible ? YES

Page | 16
Chapter 4
System Design
4.1 Basic Modules:

1. Data Collection: The system should be able to obtain stock market data from reliable sources,
such as Bloomberg, Yahoo Finance, and Google Finance. The data should include historical
prices, trading volume, company financials, news articles, and other relevant information.

2. Data Preprocessing: The system should have the capability to clean and preprocess the obtained
data to remove any inconsistencies, inaccuracies, or missing values.

3. Data Visualization: The system should provide a user-friendly interface to visualize the
processed data, including graphs, charts, and other interactive displays. This will enable the user
to analyze trends and patterns, and identify potential opportunities.

4. Prediction Models: The system should incorporate machine learning algorithms that can predict
stock prices and identify potential future trends. The models should be able to handle both short-
term and long-term predictions.

4.2 Procedural Models:


UML Approach:

A UML diagram is a partial graphical representation (view) of a model of a system under design,
implementation, or already in existence. UML diagram contains graphical elements (symbols) - UML
nodes connected with edges (also known as paths or flows) - that represent elements in the UML model
of the designed system. The UML model of the system might also contain other documentation such as
use cases written as templated texts.

The kind of the diagram is defined by the primary graphical symbols shown on the diagram. For
example, a diagram where the primary symbols in the contents area are classes is class diagram. A diagram

Page | 17
which shows use cases and actors is use case diagram. A sequence diagram shows sequence of message
exchanges between lifelines.

UML specification does not preclude mixing of different kinds of diagrams, e.g. to combine
structural and behavioral elements to show a state machine nested inside a use case. Consequently, the
boundaries between the various kinds of diagrams are not strictly enforced. At the same time, some UML
Tools do restrict set of available graphical elements which could be used when working on specific type
of diagram.

UML specification does not preclude mixing of different kinds of diagrams, e.g. to combine
structural and behavioral elements to show a state machine nested inside a use case. Consequently, the
boundaries between the various kinds of diagrams are not strictly enforced. At the same time, some UML
Tools do restrict set of available graphical elements which could be used when working on specific type
of diagram. UML specification defines two major kinds of UML diagram: structure diagrams and behavior
diagrams.

Structure diagrams show the static structure of the system and its parts on different abstraction and
implementation levels and how they are related to each other. The elements in a structure diagram
represent the meaningful concepts of a system, and may include abstract, real world and implementation
concepts.

Behavior diagrams show the dynamic behavior of the objects in a system, which can be described
as a series of changes to the system over time.

Page | 18
4.2.1 Class Diagram:

Class diagrams can also be used for data modeling. The classes in a class diagram represent both the main
elements, interactions in the application, and the classes to be programmed. In the diagram, classes are
represented with boxes that contain three compartments: The top compartment contains the name of the
class.
 Here there are 4 classes which are connected with each other and showing us how the OUR System
Works. From where its fetching the information and how its providing it to the end user.
 The class User has attribute is name whose operation is to get stock information and visualizations
from the class Stock through yahoo finance API and WebApp.
 So once User add the stock information through WebApp, yahoo finance finds for that particular
stock.
 After fetching the data it gives to web and then finally user gets the required data.

Fig 4.1- Class Diagram

Page | 19
4.2.2 Flow Chart Diagram:

A flowchart is a type of diagram that represents a workflow or process. A flowchart can also be
defined as a diagrammatic representation of an algorithm, a step-by-step approach to solving a task. The
flowchart shows the steps as boxes of various kinds, and their order by connecting the boxes with
arrows.

Fig 4.2- Flow Chart

Page | 20
4.2.3 Use case Diagram:

In the Unified Modelling Language (UML), a use case diagram cansummarize the
details of your system's users (also known as actors) and their interactions with the system.
To build one, you'll use a set of specialized symbols and connectors. An effective use case
diagram can help your team discuss and represent:

 Scenarios in which your system or application interacts with people,


organizations,or external systems.
 Goals that your system or application helps those entities (known as
actors)achieve.
 The scope of your system.

Fig 4.3 - Use Case Diagram

Page | 21
4.2.4 Activity Diagram:

An activity diagram is a behavioral diagram i.e. it depicts the behavior of a system.


An activity diagram portrays the control flow from a start point to a finish point
showingthe various decision paths that exist while the activity is being executed.

Fig 4.4 - Activity Diagram

Page | 22
4.2.6 Sequence Diagram

A sequence diagram is a type of interaction diagram because it describes how and


in what order a group of objects works together. These diagrams are used by software
developers and business professionals to understand requirements for a new system or to
document an existing process. Sequence diagrams are sometimes knownas event diagrams
or event scenarios.

Sequence diagrams can be useful references for businesses and otherorganizations.


Try drawing a sequence diagram to:

 Represent the details of a UML use case.


 Model the logic of a sophisticated procedure, function, or operation.
 See how objects and components interact with each other to complete a process.
 Plan and understand the detailed functionality of an existing or future scenario.

Fig 4.5 - Sequence Diagram

Page | 23
4.2.7 Data Flow Diagram

A data flow diagram shows the way information flows through a process or system. It
includes data inputs and outputs, data stores, and the various sub processes the data
moves through. DFDs are built using standardized symbols and notation to describe
various entities and their relationships.

Data flow diagram levels:


Data flow diagrams are also categorized by level. Starting with the most basic, level 0,
DFDs get increasingly complex as the level increases.

Fig 4.6 - Data Flow Diagram

Page | 24
4.3 System Data design:

4.4 User Interface

Fig 4.7- Home Page

Page | 25
Fig 4.8- predict page

Page | 26
fig 4.9 – Graphical visuals

Fig 4.10- Ticker info page

Page | 27
4.5 Security Issues
There are several security issues that can arise in stock market prediction and analysis.
Some of these issues include:

1. Data Breaches: A stock market prediction and analysis platform may collect and
store sensitive user information, including financial data. If the platform is not
secured properly, it may be vulnerable to data breaches, which can result in the
theft of user information and financial loss.

2. Insider Trading: Insider trading is the use of non-public information to make


trades on the stock market. A prediction and analysis platform that provides
users with access to insider information could be used for insider trading. This is
illegal and can result in significant fines and criminal charges.

3. Malware Attacks: A prediction and analysis platform may be targeted by


malware attacks, which can compromise the system and steal user information.
Malware can also be used to manipulate data and provide false predictions,
which can lead to financial loss.

4. Hacking: A platform that is not secured properly can be vulnerable to hacking.


Hackers may be able to gain access to the system, steal data, or manipulate data
to their advantage.

5. Unauthorized Access: Without a login requirement, anyone can access the platform,
including unauthorized individuals who could potentially exploit the platform or access
sensitive information.

To mitigate these security issues, stock market prediction and analysis platforms should
implement strong security measures, including encryption, multi-factor authentication,
and regular security audits. It is also important to educate users on how to protect their
information and recognize potential security threats.

Page | 28
4.6 Test Case Design

VARIOUS TESTING TYPES:

Testing is also an important phase of any project as it test our product whether it is
properly working or not.

There are basic 4 types of testing which can be included in our project which help to test the
application in different ways before running the application.

1. Unit testing –

• UNIT TESTING is a level of software testing where individual units/ components of a


software are tested.

• A unit is the smallest testable part of any software.

• It usually has one or a few inputs and usually a single output.

2. Module Testing-

• Module testing is the testing of complete code objects as produced by the compiler when built
from source.

3. Integration Testing-

• INTEGRATION TESTING is a level of software testing where individual units are combined
and tested as a group. The purpose of this level of testing is to expose faults in the interaction
between integrated units.

4. System Testing-

• SYSTEM TESTING is a level of software testing where a complete and integrated software is
tested. The purpose of this test is to evaluate the system’s compliance with the specified
requirements.

• The process of testing an integrated system to verify that it meets specified requirements.

Page | 29
Table 4.1: Test Case Design

ID Validation Description Error Action


Message

STK_PRD_001 Verify that the system can N/A Enter a valid stock ticker
predict and analyze the and time frame in days and
stock market verify that the system
provides accurate results.

STK_PRD_002 Verify that the system can Invalid or non- Enter an invalid or non-
handle a non-existent existent stock existent stock ticker and
stock ticker ticker verify that the system
displays the error message.

STK_PRD_003 Verify that the system can Invalid time Enter an invalid time frame
handle an invalid time frame and verify that the system
frame displays the error message.

STK_PRD_004 Verify that the system can N/A Enter a valid stock ticker
handle a very large time and a large time frame and
frame verify that the system
provides accurate results.

STK_PRD_005 Verify that the system can N/A Enter a valid stock ticker
handle a very short time and a short time frame and
frame verify that the system
provides accurate results.

STK_PRD_006 Verify that the system can Invalid or non- Enter a null stock ticker
handle a null stock ticker existent stock value and verify that the
value ticker system displays the error
message.

Page | 30
STK_PRD_007 Verify that the system can Invalid time Enter a null time frame
handle a null time frame frame value and verify that the
value system displays the error
message.

STK_PRD_008 Verify that the system can Invalid or non- Enter a blank stock ticker
handle a blank stock ticker existent stock value and verify that the
value ticker system displays the error
message.

STK_PRD_009 Verify that the system can Invalid time Enter a blank time frame
handle a blank time frame frame value and verify that the
value system displays the error
message.

STK_PRD_010 Verify that the system can N/A Enter a valid stock ticker
handle a stock ticker with with special characters and
special characters verify that the system
provides accurate results.

STK_PRD_011 Verify that the system can Invalid time Enter a time frame of 0
handle a time frame of 0 frame days and verify that the
days system displays the error
message.

STK_PRD_012 Verify that the system can N/A Enter a valid stock ticker
handle a time frame of 365 and a time frame of 365
days days and verify that the
system provides accurate
results.

Page | 31
Chapter 5
Implementation and Testing
5.1 Implementation Approach:
An agile methodology is an iterative approach to software development. Each iteration of
agile methodology takes a short time interval of 1 to 4 weeks. The agile development process is
aligned to deliver the changing business requirement. It distributes the software with faster and
fewer changes. The single-phase software development takes 6 to 18 months.

In single-phase development, all the requirement gathering and risks management factors
are predicted initially. The agile software development process frequently takes the feedback of
workable product. The workable product is delivered within 1 to 4 weeks of iteration.

The agile software development emphasizes on four core values:

1. Individual and team interactions over processes and tools.

2. Working software over comprehensive documentation.

3. Customer collaboration over contract negotiation.

4. Responding to change over following.

Fig 5.1 – Agile methodology

Page | 32
5.2 Coding Details

Main code: [Link]

from urllib import request


from [Link] import render
from [Link] import HttpResponse
from [Link] import RequestContext

from [Link] import plot


import plotly.graph_objects as go
import [Link] as px
from plotly.graph_objs import Scatter

import pandas as pd
import numpy as np
import json

import yfinance as yf
import datetime as dt
import qrcode

from .models import Project

from sklearn.linear_model import LinearRegression


from sklearn import preprocessing, model_selection, svm

# The Home page when Server loads up


def index(request):
# ========================== Left Card Plot
=========================================================
# Here we use [Link] function
data = [Link](

# passes the ticker


tickers=['AAPL', 'AMZN', 'QCOM', 'META', 'NVDA', 'JPM'],

group_by = 'ticker',

threads=True, # Set thread value to true

# used for access data[ticker]


period='1mo',
interval='1d'

data.reset_index(level=0, inplace=True)

Page | 33
fig_left = [Link]()
fig_left.add_trace(
[Link](x=data['Date'], y=data['AAPL']['Adj Close'], name="AAPL")
)
fig_left.add_trace(
[Link](x=data['Date'], y=data['AMZN']['Adj Close'], name="AMZN")
)
fig_left.add_trace(
[Link](x=data['Date'], y=data['QCOM']['Adj Close'], name="QCOM")
)
fig_left.add_trace(
[Link](x=data['Date'], y=data['META']['Adj Close'], name="META")
)
fig_left.add_trace(
[Link](x=data['Date'], y=data['NVDA']['Adj Close'], name="NVDA")
)
fig_left.add_trace(
[Link](x=data['Date'], y=data['JPM']['Adj Close'], name="JPM")
)
fig_left.update_layout(paper_bgcolor="#14151b", plot_bgcolor="#14151b", font_color="white")

plot_div_left = plot(fig_left, auto_open=False, output_type='div')

# =================== To show recent stocks ========================

df1 = [Link](tickers = 'AAPL', period='1d', interval='1d')


df2 = [Link](tickers = 'AMZN', period='1d', interval='1d')
df3 = [Link](tickers = 'GOOGL', period='1d', interval='1d')
df4 = [Link](tickers = 'UBER', period='1d', interval='1d')
df5 = [Link](tickers = 'TSLA', period='1d', interval='1d')
df6 = [Link](tickers = 'TWTR', period='1d', interval='1d')

[Link](0, "Ticker", "AAPL")


[Link](0, "Ticker", "AMZN")
[Link](0, "Ticker", "GOOGL")
[Link](0, "Ticker", "UBER")
[Link](0, "Ticker", "TSLA")
[Link](0, "Ticker", "TWTR")

df = [Link]([df1, df2, df3, df4, df5, df6], axis=0)


df.reset_index(level=0, inplace=True)
[Link] = ['Date', 'Ticker', 'Open', 'High', 'Low', 'Close', 'Adj_Close', 'Volume']
convert_dict = {'Date': object}
df = [Link](convert_dict)
[Link]('Date', axis=1, inplace=True)

Page | 34
json_records = df.reset_index().to_json(orient ='records')
recent_stocks = []
recent_stocks = [Link](json_records)

# ===================== Machine Learning ===========================

try:
df_ml = [Link](tickers = ticker_value, period='3mo', interval='1h')
except:
ticker_value = 'AAPL'
df_ml = [Link](tickers = ticker_value, period='3mo', interval='1m')

# Fetching ticker values from Yahoo Finance API


df_ml = df_ml[['Adj Close']]
forecast_out = int(number_of_days)
df_ml['Prediction'] = df_ml[['Adj Close']].shift(-forecast_out)
# Splitting data for Test and Train
X = [Link](df_ml.drop(['Prediction'],1))
X = [Link](X)
X_forecast = X[-forecast_out:]
X = X[:-forecast_out]
y = [Link](df_ml['Prediction'])
y = y[:-forecast_out]
X_train, X_test, y_train, y_test = model_selection.train_test_split(X, y, test_size = 0.2)
# Applying Linear Regression
clf = LinearRegression()
[Link](X_train,y_train)
# Prediction Score
confidence = [Link](X_test, y_test)
# Predicting for 'n' days stock data
forecast_prediction = [Link](X_forecast)
forecast = forecast_prediction.tolist()

# ========================================== Plotting predicted data


======================================

pred_dict = {"Date": [], "Prediction": []}


for i in range(0, len(forecast)):
pred_dict["Date"].append([Link]() + [Link](days=i))
pred_dict["Prediction"].append(forecast[i])

pred_df = [Link](pred_dict)
pred_fig = [Link]([[Link](x=pred_df['Date'], y=pred_df['Prediction'])])
pred_fig.update_xaxes(rangeslider_visible=True)
pred_fig.update_layout(paper_bgcolor="#14151b", plot_bgcolor="#14151b", font_color="white")
plot_div_pred = plot(pred_fig, auto_open=False, output_type='div')

# ===================== Display Ticker Info =======================

ticker = pd.read_csv('app/Data/[Link]')

Page | 35
to_search = ticker_value
[Link] = ['Symbol', 'Name', 'Last_Sale', 'Net_Change', 'Percent_Change', 'Market_Cap',
'Country', 'IPO_Year', 'Volume', 'Sector', 'Industry']
for i in range(0,[Link][0]):
if [Link][i] == to_search:
Symbol = [Link][i]
Name = [Link][i]
Last_Sale = ticker.Last_Sale[i]
Net_Change = ticker.Net_Change[i]
Percent_Change = ticker.Percent_Change[i]
Market_Cap = ticker.Market_Cap[i]
Country = [Link][i]
IPO_Year = ticker.IPO_Year[i]
Volume = [Link][i]
Sector = [Link][i]
Industry = [Link][i]
break

# ===================== Page Render section =======================

return render(request, "[Link]", context={ 'plot_div': plot_div,


'confidence' : confidence,
'forecast': forecast,
'ticker_value':ticker_value,
'number_of_days':number_of_days,
'plot_div_pred':plot_div_pred,
'Symbol':Symbol,
'Name':Name,
'Last_Sale':Last_Sale,
'Net_Change':Net_Change,
'Percent_Change':Percent_Change,
'Market_Cap':Market_Cap,
'Country':Country,
'IPO_Year':IPO_Year,
'Volume':Volume,
'Sector':Sector,
'Industry':Industry,
})

Page | 36
[Link]

<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8">
<title>Stock Market Prediction</title>
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<meta content="" name="keywords">
<meta content="" name="description">

<!-- Favicon -->


<link rel="icon" href="{% static 'image/dollar_icon.png' %}">

<!-- Google Web Fonts -->


<link rel="preconnect" href="[Link]
<link rel="preconnect" href="[Link] crossorigin>
<link
href="[Link]
&display=swap" rel="stylesheet">

<!-- Icon Font Stylesheet -->


<link href="[Link] rel="stylesheet">
<link href="[Link] rel="stylesheet">

<!-- Libraries Stylesheet -->


<link href="{% static 'lib/owlcarousel/assets/[Link]' %}" rel="stylesheet">
<link href="{% static 'lib/tempusdominus/css/[Link]' %}" rel="stylesheet" />

<!-- Customized Bootstrap Stylesheet -->


<link href="{% static 'css/[Link]' %}" rel="stylesheet">

<!-- Template Stylesheet -->


<link href="{% static 'css/[Link]' %}" rel="stylesheet">
</head>

<body>
<div class="container-fluid position-relative d-flex p-0">
<!-- Spinner Start -->
<div id="spinner" class="show bg-dark position-fixed translate-middle w-100 vh-100 top-50 start-50 d-
flex align-items-center justify-content-center">
<div class="spinner-border text-primary" style="width: 3rem; height: 3rem;" role="status">
<span class="sr-only">Loading...</span>
</div>

Page | 37
</div>
<!-- Spinner End -->

<!-- Sidebar Start -->


<div class="sidebar pe-4 pb-3">
<nav class="navbar bg-secondary navbar-dark">
<a href="#" class="navbar-brand mx-4 mb-3">
<h3 class="text-primary"><i class="fa fa-user-edit me-2"></i>Stocks</h3>
</a>
<div class="d-flex align-items-center ms-4 mb-4">
<div class="position-relative">
<img class="rounded-circle" src="{% static 'image/[Link]' %}" alt="" style="width: 40px;
height: 40px;">
<div class="bg-success rounded-circle border border-2 border-white position-absolute end-0
bottom-0 p-1"></div>
</div>
<div class="ms-3">
<h6 class="mb-0">Welcome</h6>
<span>Guest</span>
</div>
</div>
<div class="navbar-nav w-100">
<a href="#" class="nav-item nav-link active"><i class="fa fa-home me-2"></i>Home</a>
<a href="/search" class="nav-item nav-link"><i class="fa fa-search me-2"></i>Predict</a>
<a href="/ticker" class="nav-item nav-link"><i class="fa fa-list-alt me-2"></i>Ticker Info</a>
</div>
</nav>
</div>
<!-- Sidebar End -->

<!-- Content Start -->


<div class="content">
<!-- Navbar Start -->
<nav class="navbar navbar-expand bg-secondary navbar-dark sticky-top px-4 py-0">
<a href="[Link]" class="navbar-brand d-flex d-lg-none me-4">
<h2 class="text-primary mb-0"><i class="fa fa-user-edit"></i></h2>
</a>
<a href="#" class="sidebar-toggler flex-shrink-0">
<i class="fa fa-bars"></i>
</a>
<form class="d-none d-md-flex ms-4">
<input class="form-control bg-dark border-0" type="search" placeholder="Search">
</form>

Page | 38
<div class="navbar-nav align-items-center ms-auto">
<div class="nav-item dropdown">
<a href="#" class="nav-link dropdown-toggle" data-bs-toggle="dropdown">
<img class="rounded-circle me-lg-2" src="{% static 'image/[Link]' %}" alt=""
style="width: 40px; height: 40px;">
<span class="d-none d-lg-inline-flex">Guest</span>
</a>
<div class="dropdown-menu dropdown-menu-end bg-secondary border-0 rounded-0 rounded-
bottom m-0">
<a href="/search" class="dropdown-item">Predict</a>
<a href="/ticker" class="dropdown-item">Ticker Info</a>
</div>
</div>
</div>
</nav>
<!-- Navbar End -->

<!-- Sales Chart Start -->


<div class="container-fluid pt-4 px-4">
<div class="row g-4">
<div class="col-sm-12 col-xl-12">
<div class="bg-secondary text-center rounded p-4">
<div class="d-flex align-items-center justify-content-between mb-4">
<h6 class="mb-0">Active Stocks</h6>
<a href="">Show All</a>
</div>
{% block Left_Plot %}

{% autoescape off %}
{{ plot_div_left }}
{% endautoescape %}

{% endblock Left_Plot %}
</div>
</div>
</div>
</div>
<!-- Sales Chart End -->

<!-- Recent Sales Start -->


<div class="container-fluid pt-4 px-4">
<div class="bg-secondary text-center rounded p-4">

Page | 39
<div class="d-flex align-items-center justify-content-between mb-4">
<h6 class="mb-0">Recent Stocks</h6>
<a href="[Link] All</a>
</div>
<div class="table-responsive">
<table class="table text-start align-middle table-bordered table-hover mb-0">
<thead>
<tr class="text-white">
<th scope="col">Ticker</th>
<th scope="col">Open</th>
<th scope="col">High</th>
<th scope="col">Low</th>
<th scope="col">Close</th>
<th scope="col">Adj. Close</th>
<th scope="col">Volume</th>
</tr>
</thead>
<tbody>
{% if recent_stocks %}
{% for i in recent_stocks %}
<tr>
<td>{{[Link]}}</td>
<td>{{[Link]}}</td>
<td>{{[Link]}}</td>
<td>{{[Link]}}</td>
<td>{{[Link]}}</td>
<td>{{i.Adj_Close}}</td>
<td>{{[Link]}}</td>
</tr>
{% endfor %}
{% endif %}
</tbody>
</table>
</div>
</div>
</div>
<!-- Recent Sales End -->

<!-- Footer Start -->


<div class="container-fluid pt-4 px-4">
<div class="bg-secondary rounded-top p-4">
<div class="row">
<div class="col-12 col-sm-6 text-center text-sm-start">
&copy; <a href="#">Nilkanth Mistry</a>, All Right Reserved.

Page | 40
</div>
<div class="col-12 col-sm-6 text-center text-sm-end">
Designed By <a href="#">Nilkanth Mistry</a>
</div>
</div>
</div>
</div>
<!-- Footer End -->
</div>
<!-- Content End -->

<!-- Back to Top -->


<a href="#" class="btn btn-lg btn-primary btn-lg-square back-to-top"><i class="bi bi-arrow-
up"></i></a>
</div>

<!-- JavaScript Libraries -->


<script src="[Link]
<script src="[Link]
<script src="[Link] integrity="sha512-
sW/w8s4RWTdFFSduOTGtk4isV1+190E/GghVffMA9XczdJ2MDzSzLEubKAs5h0wzgSJOQTRYyaz73L3d
6RtJSg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="{% static 'lib/easing/[Link]' %}"></script>
<script src="{% static 'lib/waypoints/[Link]' %}"></script>
<script src="{% static 'lib/owlcarousel/[Link]' %}"></script>
<script src="{% static 'lib/tempusdominus/js/[Link]' %}"></script>
<script src="{% static 'lib/tempusdominus/js/[Link]' %}"></script>
<script src="{% static 'lib/tempusdominus/js/[Link]' %}"></script>

<!-- Template Javascript -->


<script src="{% static 'js/[Link]' %}"></script>
</body>

</html>

Page | 41
5.2.1 Code Efficiency:

Efficiency is an important factor to consider when developing code for stock market prediction
and analysis, as these tasks typically involve processing large amounts of data in real-time. Here
are some strategies for improving code efficiency:

1. Use efficient data structures: When dealing with large amounts of data, it's important to
choose the right data structures to store and manipulate the data. For example, using
arrays instead of lists can improve performance when working with large datasets.

2. Optimize algorithms: There are many algorithms available for stock market prediction
and analysis, and some are more efficient than others. For example, using a linear
regression model instead of a neural network can be faster and more efficient, but may
sacrifice some accuracy.

3. Parallelize computations: Many machine learning libraries support parallel processing,


which can greatly improve performance when working with large datasets. By splitting
the work across multiple processors or machines, computations can be completed more
quickly.

4. Reduce I/O operations: Input/output operations (I/O) can be a bottleneck when


processing large datasets. By minimizing the number of I/O operations, such as by
loading data into memory before processing it, you can improve performance.

5. Optimize code: Code optimization involves making small changes to the code to improve
performance, such as using more efficient data types, avoiding unnecessary
computations, and minimizing memory usage.

6. Use caching: If certain computations are performed repeatedly, caching the results can
help to reduce computation time. This can be especially useful when working with large
datasets.

Overall, improving code efficiency for stock market prediction and analysis requires a
combination of good programming practices, algorithmic optimization, and the efficient use of
hardware resources.

Page | 42
5.3 Testing Approach:

5.3.1 Unit Testing:

This is the lowest level of testing that is conducted to remove syntax & logic errors from a
single unit. Individual components are tested to ensure that they operate correctly. Each
component is tested independently, without other system components.
5.3.2 Integration Testing:

Integration Testing is a level of software testing where individual units are combined and
tested as a group. The purpose of this level of testing is to expose faults in the interaction
between integrated units. Test drivers and test stubs are used to assist in Integration Testing.
5.3.3 Acceptance Testing:

This is the final stage in the testing process before the system is accepted for operational
use. The system is tested with data supplied by the system customer rather than simulated
test data. Acceptance testing may reveal errors & omissions in the system requirements
definition because the real data exercise the system in different ways from the test data.
5.3.4 System Testing:

System testing is a type of software testing that evaluates the entire system or application
as a whole to ensure that it meets the specified requirements and functions correctly. The
purpose of system testing is to identify defects, errors, and performance issues in the
software application before it is released to the end-users.

5.3.5 Usability testing:


Usability testing is a type of testing that is used to evaluate how user-friendly a software
application is. The purpose of usability testing is to ensure that the software is easy to
use, intuitive, and meets the needs of its intended users.

Page | 43
Chapter 6
Results and Discussions
6.1 Test Reports

Table 6.1: Test Report Summary

PASSED 100

FAILED 3
EXECUTED
Total Tests Executed (Passed
103
+ Failed)

PENDING 0

IN PROGRESS 0

BLOCKED 3

TEST PLANNED (PENDING + IN PROGRESS + TEST


103
EXECUTED)

Page | 44
Table 6.2: Test Reports

Features #Tests %Tests %Tests Status Remarks


Planned Executed Passed

Functionality to 10 100% 90% Partially 1 test case failed due


predict and Pass to an issue with the
analyze the third-party API.
stock market
Ability to input 5 100% 100% Pass All 5 test cases passed
a valid stock successfully,
ticker indicating that the
system is correctly
accepting valid stock
tickers.
Ability to 5 100% 100% Pass All 5 test cases passed
handle invalid successfully,
stock ticker indicating that the
inputs system is correctly
handling invalid stock
ticker inputs by
returning an
appropriate error
message.
Ability to input 5 100% 100% Pass All 5 test cases passed
a valid time successfully,
frame in days indicating that the
system is correctly
accepting valid time
frame inputs.
Ability to 5 100% 100% Pass All 5 test cases passed
handle invalid successfully,
time frame indicating that the
inputs system is correctly
handling invalid time
frame inputs by
returning an
appropriate error
message.
Functionality to 10 100% 100% Pass All 10 test cases
retrieve stock passed successfully,
indicating that the
system is correctly

Page | 45
data for a valid retrieving stock data
input for a valid input.

Functionality to 10 100% 100% Pass All 10 test cases


handle invalid passed successfully,
stock data indicating that the
inputs system is correctly
handling invalid stock
data inputs by
returning an
appropriate error
message.
Functionality to 5 100% 100% Pass All 5 test cases passed
display stock successfully,
data in a tabular indicating that the
format system is correctly
displaying stock data
in a tabular format.
Functionality to 5 100% 100% Pass All 5 test cases passed
display stock successfully,
data in a indicating that the
graphical
format

Page | 46
6.2 User Documentation

6.2.1 Home Page

By clicking on show all user will


be redirected to the yahoo
Finance website where detailed
information can be viewed

Fig 6.1: Home Page

Page | 47
6.2.2 Ticker Information page

This link will give list of


all the trending
companies with the
biggest change in %.

Fig 6.2: Ticker info page

Fig 6.3: Yahoo Fianace

Page | 48
6.2.3 Predict Data

This will lead the use to


the Ticker info where
user can find his company
name

By clicking on the predict


button the main page where
the data of the company
and the prediction will be
represented.

Fig 6.4: Predict data

Page | 49
6.2.4 Data Representation

Detailed information
will be shown after
clicking

Scan this code


from your phone
User can read the to get this app on
graph properly your deice
and accurately
Fig 6.5: Data Representation

Fig 6.6: Graphical Visual


6.2.5 Tools

Fig 6.7: Enhancing Tools


The First symbol is of camera which clicks image of a graph which will help the user to further
compare the dataset.
Second is for zoom the graph.
Third is for pan
Then for zoom in, zoom out and so on.

Page | 50
This scrollbar is used to change the time span.
For EXAMPLE

Fig 6.8: Scrollbar

Page | 51
Chapter 7:
Conclusion
7.1 Conclusion
In summary, the report highlights the challenges faced by analysts and beginners in the
stock market industry and emphasizes the need for an efficient application to ease their work. The
primary goal of this app is to assist individuals who are interested in investing in the stock market
by providing them with comprehensive information about companies, trends, and stock prices.
This would be particularly beneficial for novices who lack experience in the stock market, enabling
them to make informed decisions about investing their money.

7.1.1 Significance of the System

 Make Treading easy for the newcomers.


 Provide efficient stock price prediction.
 To provide highly efficient analyzed information about the company which will help the
user to make wise decision.
 Provide with the list of STOCK TICKER.
 By scanning the code user can get the data on his/her phone.

7.2 Limitations of the System

 As stock price prediction is based on historical data, there is a possibility of inaccurate


predictions.
 Prediction can’t be done on the basis of news and external factors.
 Investing in the stock market carries inherent risks and there is always a chance of losing
one's money.
 This web application does not support trading functionality.

Page | 52
7.3 Future Scope of the Project
The future scope of stock market prediction and analysis is quite promising, as
advancements in technology and data analytics are revolutionizing the way investors approach the
market. With the help of machine learning algorithms and artificial intelligence, it is now possible
to analyze vast amounts of data and make accurate predictions regarding stock prices.

In the future, we can expect to see further developments in this field, such as the use of
natural language processing to analyze news articles and social media posts to better understand
market sentiment, the integration of blockchain technology to improve transparency and security
in the market, and the use of quantum computing to accelerate data processing and analysis.

Moreover, with the growing demand for sustainable and socially responsible investments,
we can also expect to see an increased focus on ESG (environmental, social, and governance)
factors in stock analysis and prediction. Overall, the future of stock market prediction and analysis
is likely to be shaped by cutting-edge technologies and a greater emphasis on responsible investing.

Page | 53
References
List of links referred

 [Link]
 [Link]
 [Link]
 [Link]
 [Link]
 [Link]
NUE3wx90gsFgCNJUp4roQ3S1FhsqRdR5cAaAnwvEALw_wcB
 [Link]
 [Link]
list/?kw=&cmp=IN_SRCH_DSA_Blog_EN&label=dsa_pagefeed&Network=g&Device
=c&utm_content=622579942031&kwid=dsa-
1753200731733&cmpid=18364821001&agpid=149921608308&BU=Core&extid=60109
293997&adpos=&gclid=Cj0KCQjwlPWgBhDHARIsAH2xdNc22AwxJWS8l1jles55y2a
O-lYbgpBMY7lpRO2guLhJeb-ZQIrJ-usaAjehEALw_wcB
 [Link]
 [Link]
 [Link]
 [Link]
 [Link]
 [Link]
 [Link]
hon%20library,by%20Wes%20McKinney%20in%202008.

Page | 54
Research done:

 Brown, G. W., & Warner, J. B. (1985). Using daily stock returns: The case of event studies.
Journal of financial economics, 14(1), 3-31.
 Lo, A. W. (2001). Risk management for hedge funds: Introduction and overview. Financial
Analysts Journal, 57(6), 16-33.
 Malkiel, B. G. (2003). The efficient market hypothesis and its critics. Journal of Economic
Perspectives, 17(1), 59-82.
 Wu, J., Yan, J., & Zhang, Y. (2014). A hybrid stock price prediction model combining
multiple regression analysis and independent component analysis. Journal of Applied
Mathematics, 2014.
 Zhang, G. P. (2003). Time series forecasting using a hybrid ARIMA and neural network
model. Neurocomputing, 50, 159-175.
 Gencay, R., Selcuk, F., & Whitcher, B. (2002). An introduction to wavelets and other
filtering methods in finance and economics. Academic Press.
 Tsay, R. S. (2005). Analysis of financial time series. John Wiley & Sons.
 Shynkevich, Y. (2016). Predicting the stock market with the news articles. Journal of
Business and Economic Development, 1(1), 12-18.
 Zhang, H., Shen, Z., & Li, X. (2018). Stock price prediction using news articles based on
sentiment analysis and recurrent neural networks. Journal of Intelligent & Fuzzy Systems,
35(3), 2693-2701.
 Kogan, S., & Rossman, G. (2012). Machine learning for stock selection. Journal of
Computational Intelligence in Finance, 1(1), 25-31.

Page | 55

You might also like