Project
Project
Prediction &Analysis)
A Project Report
Abhay Choubey
2106006
Shruti Diwale
2106067
Assistant Professor
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
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
vii
LIST OF FIGURES
Page No.
Figure No. Table Figure
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
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.
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.
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
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.
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.
Bootstrap WordPress
Bootstrap written in HTML, CSS & JavaScript. WordPress written only on PHP.
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.
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.
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.
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
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.
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.
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 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.
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.
4. The stock ticker symbol must match the information listed in the official list of all stock tickers.
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
1. Use historical data, technical analysis, and machine learning to predict stock prices and trends.
3. Focus on providing accurate and reliable predictions for informed decision making.
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.
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.
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.
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.
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.
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.
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.
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:
Page | 21
4.2.4 Activity Diagram:
Page | 22
4.2.6 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.
Page | 24
4.3 System Data design:
Page | 25
Fig 4.8- predict page
Page | 26
fig 4.9 – Graphical visuals
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.
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
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 –
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
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.
Page | 32
5.2 Coding Details
import pandas as pd
import numpy as np
import json
import yfinance as yf
import datetime as dt
import qrcode
group_by = 'ticker',
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")
Page | 34
json_records = df.reset_index().to_json(orient ='records')
recent_stocks = []
recent_stocks = [Link](json_records)
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')
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')
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 | 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">
<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 -->
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 -->
{% autoescape off %}
{{ plot_div_left }}
{% endautoescape %}
{% endblock Left_Plot %}
</div>
</div>
</div>
</div>
<!-- Sales Chart End -->
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 -->
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 -->
</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.
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:
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.
Page | 43
Chapter 6
Results and Discussions
6.1 Test Reports
PASSED 100
FAILED 3
EXECUTED
Total Tests Executed (Passed
103
+ Failed)
PENDING 0
IN PROGRESS 0
BLOCKED 3
Page | 44
Table 6.2: Test Reports
Page | 45
data for a valid retrieving stock data
input for a valid input.
Page | 46
6.2 User Documentation
Page | 47
6.2.2 Ticker Information page
Page | 48
6.2.3 Predict Data
Page | 49
6.2.4 Data Representation
Detailed information
will be shown after
clicking
Page | 50
This scrollbar is used to change the time span.
For EXAMPLE
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.
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