Major - Project Report
Major - Project Report
Submitted by B449
AKSHAT UNIYAL [RegNo: RA1911028010061] &
RAHUL GOEL [RegNo: RA1911030010094]
Under the Guidance of
BACHELOR OF TECHNOLOGY
in
COMPUTER SCIENCE ENGINEERING
of
FACULTY OF ENGINEERING & TECHNOLOGY
1
SRM INSTITUTE OF SCIENCE AND TECHNOLOGY
(Under Section 3 of UGC Act, 1956)
BONAFIDE CERTIFICATE
SIGNATURE SIGNATURE
2
TABLE OF CONTENTS
Acknowledgement……………………………………………. 5
Abstract ……………………………………………………… 7
Introduction ………………………………………………….. 9
General ………………………………………………... 10
Objective ……………………………………………… 12
System Analysis…………………………………………….. 23
3
Methodology ………………………………………………. 28
Conclusion ………………………………………………… 29
References .………………………………………………… 29
Implementation ..…………………………………………... 31
4
ACKNOWLEDGEMENT
5
SRM Institute of Technology for their help throughout my project.
Finally, I would like to thank my parents, family and friends for their
unconditional love, constant support and encouragement.
6
ABSTRACT
In the short term, the market acts like an election or a voting machine,
but in the long term it acts like a weighing machine and thus can
make predictions on market movements over a longer time frame.
Stock Price prediction’s integration with modern technology –
especially Machine Learning Algorithm (Quant models as they are
referred to in the financial sector) is recently becoming a growing
idea for research.
7
LIST OF SYMBOLS AND ABREVIATIONS
8
CHAPTER 1
INTRODUCTION
1.1 GENERAL
9
electronic screen trading system, providing convenient trading
facilities to investors nationwide.
The main motive to correctly predict stock values and prices in the
short and long term is to maximise your potential earnings rather than
relying on tips. A huge amount of research has gone into developing
Machine Learning models that are capable of correctly predicting
stock prices and have been used by hedge funds and investment banks
for quite some time now. However these models are mainly used to
predict short term prices so that they can be utilised in intraday
trading and most long term models generally focus on indices and
option chains.
10
Due to the large number of industries and companies involved, it
contains very large datasets from which it is difficult to extract
information and manually analyse their work trends. The application
developed in this project not only helps in predicting the future
movement of stocks in the market, but also automates data retrieval,
trend analysis, predictive analysis and information generation for
stocks in one click.
11
Nasdaq (USA), Nikkei225 (Japan), SSE (Shanghai/China), HSI
(Hong Kong), BSESN (India), DAX (Europe), SMI (Switzerland),
MXX (Mexico), BVSP (Brazil).
1.3 OBJECTIVE
14
CHAPTER 2
LITERATURE SURVEY
15
remove noise and uses time series data engineering to provide
enhancements with original features. These new features are fed to a
stacked LSTM auto-encoder for a multi-step estimation of the final
stock value. Also, this estimate is used as part of the profit
maximization method to provide support at the right time to buy or
sell a particular stock. The results show that the proposed framework
outperforms state-of-the-art time series forecasting methods in terms
of analytical accuracy and efficiency.
[3] LSTM Method for Bitcoin Price Prediction: A Case Study Stock
Market Yahoo Finance, IEEE 2019- Ferdiansyah et al., The stock
market is very risky. Bitcoin is a cryptocurrency. In recent years, the
price has gradually increased, and sometimes it suddenly dropped. I
don't know if it will affect the scholarship. Due to its volatility,
automated tools are needed to predict Bitcoin in the stock market.
This study examines how LSTMs can be used to generate forecasts of
the Bitcoin stock market prediction model. Before confirming the
results, the article attempts to measure the results using RMSE (root
mean square error). RMSE will always be greater than or equal to
MAE. The RMSE metric evaluates the model's ability to compute
continuous values. The method applied in this study to predict Bitcoin
on the Yahoo Finance stock market can predict results above $12,600
within two days of the prediction.
16
mentions recommender systems for company selection and models
built on the RNN and LSTM methods.
17
other anonymous facts. Analyze model performance by comparing
actual and predicted data using an RNN plot. Machine learning
predicts stock prices because the model can predict stock prices very
close to the actual price, where the model captures detailed
characteristics and uses different prediction strategies. The template
starts all NSE internet data and identifies inputs and groups them and
provides inputs based on user configuration. This RNN-based
architecture has proven to be very good at predicting performance by
modifying configurations accordingly, which also uses
backpropagation during acquisition. and group the data to avoid data
mixing.
18
[9] Predictive Model Development for Stock Analysis, IEEE 2017 -
R. Yamini Nivetha, Dr. C. Dhaya. Related study of three algorithms
namely – Multiple Linear Regression (MLR), Support Vector
Machine (SVM) and Artificial Neural Network (ANN) is the main
focus of this study. Forecast the next day's market price, the forecast
is divided into monthly forecast and daily forecast. With monthly and
daily forecasts. Sentiment analysis using the best forecasting
algorithms can predict stock prices. The least developed algorithm is
the multiple linear regression algorithm which calculates the
correlation between volume and stock price. The research results
show that the deep learning algorithm is more advanced than the
MLR algorithm and the SVM algorithm.
19
CHAPTER 3
ALGORITHMS DESCRIPTION
At a high level, LSTMs work much like RNN cells. This is the inner
workings of LSTM networks. LSTM consists of three parts as shown
in the figure below, each performing a separate function.
20
Figure 3.1: Layers of LSTM
These parts of an LSTM cell are known as gates. The first part is
known as Forget gate, the second part is called the Input gate and the
last one is named as the Output gate.
21
3.2 MIN MAX SCALING
22
CHAPTER 4
SYSTEM ANALYSIS
23
4.2 HARDWARE REQUIREMENTS
CHAPTER 5
SYSTEM IMPLEMENTATION
In our project we have gathered data from Yahoo Finance. Our dataset
consists of historical data of the following stock
24
Figure 5.1: Dataset – Microsoft Historical data
CHAPTER 6
METHODOLOGY
25
The data was first imported from the yahoo finance library of
share prices which records all the changes in the stock prices on
an interval of 5 minutes as provided by the share’s stock
exchange – NASDAQ, DOW JONES, NIFTY etc.
26
We can also use the P/E ratio to determine whether a stock is
overvalued or undervalued. For example, if you consider two
companies in the same industry but which have completely
different values for the P/E ratios, it may mean that one of them
is not credibly valued.
27
Although the price-to-sales ratio is a solid investment measure,
it is recommended that you only compare it to similar
companies. Comparing the P/E ratio of an oil and gas company
like Shell to that of a technology company like Google is
pointless because the two operate very differently.
Using the above metrics, the data was scaled with the help of a
MinMax Scaler and prepped for testing and the LSTM principles were
applied on the data. The Long-Term Short-Term Memory Network is
an advanced form of Recurrent Neural Network , a sequential network,
that allows information to persist. It can handle the vanishing gradient
problem faced by RNNs. A cyclic neural network is also known as
RNN and is used for persistent memory. Note for the LSTM
layer, units is the number of LSTM neurons in the layer. 50 neurons
will give the model high dimensionality, enough to capture the
upwards and downward trends. return_sequences is True as we need to
add another LSTM layer after the current
one. input_shape corresponds to the number of time stamps and the
number of indicators. For dropout, 20% of 50 neurons will be ignored
randomly during each iteration of training.
28
Following the above same method, added 2nd, 3rd, and 4th LSTM
layer. The data was then scaled back to the initial format and the
model’s predictions were compared with the actual closing price.
CHAPTER 7
CONCLUSION
29
The trained model was able to predict closing prices for the
dataset to within 0.93 points of the closing price and did well in
the long-term predictions. The main area where the prediction
was off by a margin was the Covid crash of 2020 which could
not possibly have been predicted by company values and
historical data. However, to solve this issue – sentiment analysis
can be used on news headlines pertaining to the stock in
question and call/put options can be provided accordingly.
CHAPTER 8
30
REFERENCES
[2] Chong, E., Han, C., & Park, F. C. (2017). Deep learning
networks for stock market analysis and prediction: Methodology, data
representations, and case studies. Expert Systems with Applications,
83, 187-205.
[3] Dai, W., Wu, J. Y., & Lu, C. J. (2012). Combining nonlinear
independent component analysis and neural network to predict Asian
stock market indexes. Expert systems with applications, 39(4), 4444-
4452.
[4] Das, S. P., & Padhy, S. (2012). Support vector machines for
prediction of futures prices in the Indian stock market. International
Journal of Computer Applications, 41(3).
31
[6] Enke, D., & Thawornwong, S. (2005). The use of data mining
and neural networks for forecasting stock market returns. Expert
Systems with applications, 29(4), 927- 940.
[10] Jasic, T., & Wood, D. (2004). The profitability of daily stock
market indices trades based on neural network predictions: Case study
for the S&P 500, the DAX, the TOPIX and the FTSE in the period
1965–1999. Applied Financial Economics, 14(4), 285-297.
32
[13] Kim, K. J., & Lee, W. B. (2004). Stock market prediction using
artificial neural networks with optimal feature transformation. Neural
computing & applications, 13(3), 255-260.
APPENDIX A
IMPLEMENTATION SCREENSHOTS
33
34
35
36
37
38