Final Year Edited Project (1) (2) - 1-11

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 11

STOCK MARKET PREDICTIONS

USING ML ALGORITHMS
(A Project Report Submitted in the partial fulfillment of the requirements for the award of the degree)

of

BACHELOR OF TECHNOLOGY

IN

COMPUTER SCIENCE AND ENGINEERING

Submitted By

CH. CHATURYA (18981A0531) B. ANIL KUMAR (18981A0525)

CH. AKHIL (18981A0532)

UNDER THE ESTEEMED GUIDENCE OF

Mr. V. TATA RAO, M.Tech.

Asst. Professor

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

RAGHU ENGINEERING COLLEGE


(AUTONOMOUS)
Affiliated to JNTU KAKINADA
Approved by AICTE, Accredited by NBA, Accredited by NAAC with A grade
www.raghuengineering.com
2021-2022
RAGHU ENGINEERING COLLEGE
(AUTONOMOUS)
Affiliated to JNTU KAKINADA
Approved by AICTE, Accredited by NBA, Accredited by NAAC with A grade
www.raghuengineering.com

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


CERTIFICATE

This is to certify that this project entitled “Stock Market Predictions using ML
Algorithms” done by ”CH. Chaturya(18981A0531), B. Anil Kumar(18981A0525), CH.
Akhil(18981A0532)” are students of B.Tech in the Department of Computer Science and
Engineering, Raghu Engineering College, during the period 2018-2022, in partial fulfillment for
the award of the Degree of Bachelor of Technology in Computer Science and Engineering to the
Jawaharlal Nehru Technological University, Kakinada is a record of bonafide work carried out
under my guidance and supervision.
The results embodied in this project report have not been submitted to any other University or
Institute for the award of any Degree.

Internal Guide Head of the Department


Mr. V. TATA RAO, Mr.S. SRINADH RAJU,
Asst. Professor, Associate Professor,
Dept of CSE. Dept of CSE.

EXTERNAL EXAMINER

i
DISSERTATION APPROVAL SHEET
This is to certify that the dissertation titled
STOCK MARKET PREDICTIONS USING ML ALGORITHMS
BY

CH. CHATURYA (18981A0531) B. ANIL KUMAR (18981A0525)

CH. AKHIL (18981A0532)

Is approved for the degree of Bachelor of Technology

Mr. V. TATA RAO


Asst. Professor

Internal Examiner

External Examiner

Mr. S. SRINADH RAJU


Associate Professor
Date:

ii
DECLARATION
This is to certify that this project titled “STOCK MARKET PREDICTIONS USING ML

ALGORITHMS” is bonafied work done by my team, impartial fulfillment of the requirements

for the award of the degree B.Tech and submitted to the Department of Computer Science and

Engineering, Raghu Engineering College, Dakamarri.

We also declare that this project is a result of our own effort and that has not been copied

from anyone and we have taken only citations from the sources which are mentioned in the

references.

This work was not submitted earlier at any other University or Institute for the reward of any

degree.

Date:
Place:

CH. CHATURYA B. ANIL KUMAR


(18981A0531) (18981A0525)

CH. AKHIL
(18981A0532)

iii
ACKNOWLEDGEMENT

We express our sincere gratitude to my esteemed Institute “Raghu Engineering College”,


which has provided us an opportunity to fulfil the most cherished desire to reach my goal.

We take this opportunity with great pleasure to put on record our ineffable personal
indebtedness to Mr. Raghu Kalidindi, Chairman of Raghu Engineering College for
providing necessary departmental facilities.

We would like to thank the Principal Dr.Srinivasa Rao, Administration and Management
of “Raghu Engineering College”, for providing the requisite facilities to carry out project
in campus.

Our sincere thanks to Associate Professor Mr. S. Srinadh Raju, Head of the Department,
Department of Computer Science and Engineering, Raghu Engineering College, for this kind support
in the successful completion of this work.

We sincerely express our deep sense of gratitude to Mr. V. Tata Rao, Asst.
Professor, Department of Computer Science and Engineering, Raghu Engineering College,
for his perspicacity, wisdom and sagacity coupled with compassion and patience. It is our
great pleasure to submit this work under his wing.

We extend my deep hearted thanks to all faculty members of Computer Science


department for their value based imparting of theory and practical subjects, which were use in
the project.

We are thankful to the non-teaching staff of the Department of Computer Science and
Engineering, Raghu Engineering College, for their inexpressible support.

Regards
CH. Chaturya (18981A0531)
B. Anil Kumar (18981A0525)
CH. Akhil (18981A0532)

iv
ABSTRACT

Time series analysis is a Statistical Technique that deals with time series data, or trend
analysis. Time series data means that data is in a series of particular time periods or
intervals. Accurate prediction of Stock Market data is a major research problem in
Time series community. Anything that is observed sequentially over time is a time
series. Stock Market can make huge impact on an investor’s life, so before take a
decision need to analyze all the factors of stock data. In this project proposed
ensemble technique to improve the prediction. Exponential smoothing is one of the
most popular forecasting methods. Exponential smoothing in time series analysis
method predicts the one next period value based on the past and current value. It
involves averaging of data such that the nonsystematic components of each individual
case or observation cancel out each other. The prediction can be done using
STACKED LONG SHORTTERM MEMORY (SLSTM) model to get better results.
Finally these results compared with other existing models.

v
Table of Contents

Contents
Table of Contents...........................................................................................................2

1. Introduction......................................................................................................................................6

1.1 Aim of the Project...................................................................................................................6

1. 2 Forecasting Advantages.......................................................................................................6

1.2.1. Helps Predict the Future..............................................................................................6

1.2.2. Good for Customers......................................................................................................6

1.2.3. Keeps a Company Up-to-date....................................................................................7

1.2.4. Learn from Past Experience.......................................................................................7

1.2.5. Stay on Top of Costs.....................................................................................................7

1.2.6. Receiving Financing.....................................................................................................7

1.3 Objective....................................................................................................................................7

2.Literature Survey.............................................................................................................................9

3. Proposed System..........................................................................................................................12

3.1 Long short-term memory network...................................................................................12

3.1.1 Working of LSTM:......................................................................................................12

3.2 Proposed Stacked LSTM Model:.....................................................................................14

3.3 Advantages of stacked LSTM Model:............................................................................15

3.4 System Architecture.............................................................................................................15

3.4.1 Algorithm steps for proposed Stacked LSTM model........................................17

3.5 ARIMA Model :....................................................................................................................18

4. Requirements Specifications....................................................................................................20

4.1 Hardware Requirements:....................................................................................................20

4.2 Software Requirements:......................................................................................................20

4.3 Functional requirements......................................................................................................20


4.4 Non-Functional requirements............................................................................................20
vi
4.5. Tools & Technologies........................................................................................................21

4.5.1 PYTHON........................................................................................................................21

4.5.2 NUMPY...........................................................................................................................21

4.5.3 TENSORFLOW............................................................................................................21

4.5.4 KERAS............................................................................................................................22

4.5.5 COMPILER OPTION.................................................................................................22

4.5.6. JUPITER NOTEBOOK............................................................................................22

4.5.7 SCIKIT LEARN...........................................................................................................23

5. UML Diagrams.............................................................................................................................25

5.1 Use Case Diagram................................................................................................................25

5.2 Class Diagram........................................................................................................................26

5.3 Activity Diagram...................................................................................................................27

5.4 Collaboration Diagram........................................................................................................28

5.5 Component Diagram............................................................................................................29

5.6 Sequence Diagram:...............................................................................................................30

6.Sample Code...................................................................................................................................33

7.RESULTS........................................................................................................................................50

7.1 Dataset:.....................................................................................................................................50

7.2 Statistical Measures..............................................................................................................51

7.3 Exploratory Data analysis:.................................................................................................51

7.3 Implementation of Models.................................................................................................56

7.3.1 ARIMA Models............................................................................................................56

7.3.2 Deep Learning Models................................................................................................56

8. TESTING PROCESS.................................................................................................................61

8.1 System Testing.......................................................................................................................61

8.1.1 Test Cases and Test Results..........................................................................................61

8.1.2 Software Quality Attributes ................................................................... 61


vii
8.2 TESTING OBJECTIVES...................................................................................................62

8.3 LEVELS OF TESTING......................................................................................................62

8.3.1 UNIT TESTING...........................................................................................................62

8.3.1.1 USER INPUT.............................................................................................................62

8.3.1.2 ERROR HANDLING..............................................................................................62

8.3.2 INTEGRATION TESTING......................................................................................63

8.3.2.1 BOTTOM-UP INTEGRATION TESTING.....................................................63

8.3.3 SYSTEM TESTING....................................................................................................63

9.CONCLUSIONS AND FUTURE SCOPE...........................................................................66

REFERENCES.............................................................................................................................68

viii
List of Figures
Figure Page Number

Figure -3.1 Simple LSTM Architecture 13

Figure -3.2 Architecture of StackedLSTM 15

Figure -3.3 Flowchart of proposed SLSTM Model 16

Figure -5.1 Use case Diagram 26

Figure -5.2 Class Diagram 27

Figure -5.3 Activity Diagram 28

Figure -5.4 Collaboration Diagram 29

Figure -5.5 Component Diagram 30

Figure -5.6 Sequence Diagram 31

Figure -7.1 Dataset description 50

Figure -7.2 Statistical analysis on Trade data 52

Figure -7.3 Statistical Analysis on Turnover 53

Figure -7.4 Statistical Analysis on Volume 53

Figure -7.5 Statistical Analysis between High and Low 54

Figure -7.6 Statistical Analysis of VWAP 54

Figure -7.7 Statistical Analysis between VWAP and VWAPRolled 55

Figure -7.8 Forecast using ARIMA model 56

Figure -7.9 RNN model loss 57

Figure -7.10 Prediction using RNN model 57

ix
Figure -7.11 Training Loss and Testing Loss of LSTM model 58

Figure -7.12 Prediction of LSTM Model 59

You might also like