Ijraset Journal For Research in Applied Science and Engineering Technology
Authors: Vijay Raj Singh, Manoj V, Sunil Kumar GP, Dr. Sheshappa S. N, Prof. Mr. Byre Gowda B. K
DOI Link: https://doi.org/10.22214/ijraset.2023.51297
Certificate: View Certificate
Many experts, analysts, and novice investors have found it challenging to predict valuations of shares. Investors are, in fact, quite interested in the field of price forecasting for equity study. Many investors are interested in understanding the future state of the equity market in order to make a smart and profitable investment. By giving helpful information like the equity market\'s future direction, good and effective equity market prediction systems assist traders, investors, and analysts. equity market price forecasting is a challenging undertaking that often necessitates intensive human-computer interaction. For forecasting share prices, many prediction approaches are available. The foundation of price for shares forecasting and other financial model forecasts is time series forecasting. More sophisticated time series prediction methods are necessary when share prices become less linear. The predictability of current systems is insufficient. In this research, we suggest using the LSTM Deep Learning Algorithm for effective equity price forecasting and analysis technique with diversification analysis. When compared to current equity price prediction systems, this will produce more accurate findings.
I. INTRODUCTION
The equity market has a reputation for being unpredictable, random, and volatile. It is a chaotic environment with an unbelievable amount of constantly changing data, which makes it challenging to anticipate the future and take profitable action based on those predictions. In fact, it is among the most difficult challenges in times series forecasting.
The primary objective of this project is to examine and use deep learning techniques on the equity market to forecast equity behavior and Users should be given a thorough study of the chosen equity, along with the expected price, technical evaluation plots with strategy using statistics data. The program will generate a report with all the pertinent analysis, including the forecasted value and technical evaluation plots, once the user has chosen the required stock and date range. This tool's goal is to empower investors with information and expertise about the stocks they have picked, enabling investors to make wise selections. accordingly, take their predictions with a grain of salt and to reduce investing risk and make money, act on such projections. Transfer learning will be used to accomplish the goal in order to benefit from neural network models that have already been created. Then, predictions are evaluated using real historical stock price data. The efficient-market theory contends that equity prices are an accurate reflection of all information that is currently known, and that any price fluctuations that don't depend on newly disclosed information are thus intrinsically unexpected. This research will be a useful tool to help novice traders make better selections. Many tools will be employed to accurately achieve the aims of this research. Google Colab and PyCharm (Software) is an excellent place to start, especially for novices, because it allows you to quickly develop several discover which ones work best in the case of time series forecasting and employing ARIMA Model to do some analysis techniques such as trending and technical evaluation. After careful consideration of the model and languages to be used, it has been decided that Python will be the programming language to be used for implementation. This is because of Python's adaptability, the availability of ready-made models, and the availability of open-source libraries that are especially helpful in achieving our objectives and possibly even improving results. The LSTM model, which stands for Long Short-Term Memory, is unquestionably the most fitting model (the one that produces the best results) in the case of time series forecasting, and it will also be covered in this paper. Its superior performance versus a traditional deep neural network is the result of the addition of a memory component, which is essential for time series predictions.
II. MOTIVATION
Equity market price prediction is essentially described as attempting to calculate equity value and provide a solid framework for understanding and forecasting the market and equity prices. The dataset's quarterly financial ratio is typically used to present it. As a result, depending on a single dataset alone may not be adequate for making a forecast and may produce erroneous results. As a result, we are thinking of researching Deep Learning algorithm and integrating different information to forecast market and equity patterns.
If a better equity market price prediction algorithm is not put forth, the issue with calculating the equity price will continue to be a concern. It's challenging to forecast how the equity market will behave. The opinions of thousands of investors typically influence how the equities market moves. Predicting the price of the equities market requires the capacity to foresee how current events will affect investors. These occurrences may be political, such as a political leader's speech or news of a swindle. It may also be a global event, such as a sudden change in the value of a currency or a commodity, etc. All of these things have an impact on business earnings, which in turn have an impact on investor mood. Almost no investor has the capacity to regularly and correctly predict these hyperparameters. Prediction of share prices is particularly difficult due to all of these factors. Once the appropriate data is gathered, it can be utilized to programme a machine and provide a forecast. Once the correct data is gathered, it can be utilised to train a machine and produce a predictive outcome.
III. RELATED WORKS
S. Dinesh have created an application for forecasting close stock price using LSTM algorithm in order to forecast the closing stock price of any given organization. With datasets from Google, Nifty50, TCS, Infosys, and Reliance Stocks, we were able to achieve above 93% accuracy. Future extensions of this programme for forecasting bitcoin trading might include sentiment analysis as well for more accurate forecasts.[10]
Achyut Ghosh paper, we examine the development of businesses across several industries in an effort to determine the ideal window of time for estimating future share prices. The crucial inference from this is that businesses in a certain industry have similar dependence and growth rates.
If the model is trained on more data sets, the prediction may be more accurate. Furthermore, there may be some room for specific business analysis in the case of share prediction. To improve accuracy, we may examine the various share price patterns of various industries and analyse graphs with a wider range of time periods. This framework largely aids in market analysis and growth projections for various organizations across various time periods. The accuracy of the forecast may be increased by include additional variables (such as investor mood, election results, and geopolitical stability) that are not connected with the closing price.[2]
Murtaza Roondiwalat paper proposes RNN based on LSTM built to forecast future values for both GOOGL and NKE assets, the result of our model has shown some promising result. The testing result conform that our model is capable of tracing the evolution of opening prices for both assets. For our future work we will try to find the best sets for bout data length and number of training epochs that beater suit our assets and maximize our predictions accuracy.[3]
According to V Kranthi Sai Reddy's (2018) proposal, machine learning (ML) would be used to make predictions that are correct after being trained using the stock market data that is already accessible. In this regard, this study used the Support Vector Machine (SVM) machine learning approach to forecast stock prices for the big and small capitalizations and in the three separate markets, using prices for both daily and up-to-the-minute frequencies.
The SVM algorithm operates on a big collection of data that is gathered from several international financial marketplaces. Additionally, SVM does not have an issue with overfitting.[9]
Drashti Talati the context of time series forecasting, the LSTM model, which stands for Long Short-Term Memory, will be discussed as a straightforward example of the most fitting model (the one that produces the best results). Its superior performance versus a traditional deep neural network is the result of the inclusion of a memory component, which is essential for time series predictions. (12)https://towardsdatascience.com/data-analysis-visualization-in-finance-technical-analysis-of-stocks-using-python got ant insights from daily price-volume stock market data, we employ Python tools like Pandas, Matplotlib, and Seaborn. [6]
https://towardsdatascience.com/making-a-trade-call-using-simple-moving-average-sma-crossover-strategy-python-implementation-29963326da7a, how to build a powerful tool to perform technical analysis and generate trade signals using moving average crossover strategy.
This script can be used for investigating other company stocks by simply changing the argument to the function MovingAverageCrossStrategy (). [6]
IV. METHODOLOGY
A. LSTM (Long Short-Term Memory)
LSTM is a deep learning model that is commonly used in the field of natural language processing, time series forecasting, speech recognition, and image classification. It is a type of recurrent neural network (RNN) that is designed to address the vanishing gradient problem, which occurs when RNNs are unable to effectively propagate error gradients over time. LSTM has the ability to selectively remember or forget previous inputs based on their relevance to the current output, allowing it to maintain long-term dependencies in sequential data. It consists of a memory cell, an input gate, an output gate, and a forget gate, each of which controls the flow of information within the network. The LSTM model has proven to be effective in a variety of applications, including language translation, sentiment analysis, and speech recognition. It has also been used in predictive maintenance, financial forecasting, and other areas that involve time-series data. Overall, LSTM is a powerful deep learning model that is well-suited for tasks that involve sequential data and long-term dependencies.
a. Input Gate
b. Forget Gate
c. Output Gate
2. STEPS TO BUILD LSTM MODEL
a. Define Network
b. Compile Network
c. Fit Network
d. Make Predictions
B. Long Short-Term Memory model (LSTM)
A form of neural network called LSTM, or long short-term memory, is particularly helpful when predicting time series. An LSTM network is the best method for time series analysis and stock market prediction, claims Srivastava in his essay on LSTMs and the fundamentals of deep learning. Long short-Term Memory networks have been shown to be the most efficient solution for nearly all of these sequence prediction challenges thanks to recent advancements in data science. In many aspects, LSTMs are superior to traditional feed-forward neural networks and recurrent neural networks. This is due to their ability to memorize certain patterns for extended periods of time.
The following figure, represents a more detailed view at the internal architecture of an LSTM network:
A rudimentary neural network applies a sigmoid function on the current information in order to thoroughly change it before adding new input. This results in an overall modification of the material. Therefore, there is no differentiation between "important" and "not so important" information. On the other hand, LSTMs add and multiply information in little amounts to produce modest changes. Cell states are a technique used by LSTMs to transmit information. In this manner, LSTMs are able to selectively recall or forget information.
Information is taken out of the cell state via a forget gate. Information that is no longer necessary for the LSTM to grasp anything or that is less significant is eliminated. Two inputs—h_t-1 and x_t—are required by this gate. X_t is the input at that specific time step, while h_t-1 is the hidden state from the preceding cell or its output. A bias is applied after multiplying the inputs with the weight matrices. After then, this value is subjected to the sigmoid function. A vector with values ranging from 0 to 1, one for each number in the cell state, is the result of the sigmoid function. Fundamentally, the sigmoid function determines which values to save and which to throw away. When the forget gate outputs a '0' for a specific value in the cell state, it signifies that the forget gate wants the cell state to fully forget that particular piece of information. A "1" denotes the forget gate's desire to recall the complete piece of data, in a similar manner. The sigmoid function's vector output is multiplied by the cell state.
D. Input Gate
Information is added to the cell state by the input gate. According to the above figure, this information addition is essentially a three-step procedure. 1) Using a sigmoid function to control which values should be added to the cell state. This functions as a filter for all the data from h_t-1 and x_t and is essentially very similar to the forget gate. 2) Building a vector that contains all values that might be added to the cell state (as determined by h_t-1 and x_t). A tanh function, which returns values between -1 and +1, is used for this. 3) Multiplying the regulatory filter's value by the sigmoid gate, creating a vector, and then adding this by using addition, important information is added to the cell's state. We make sure that only information that is significant and not redundant is added to the cell state when this three-step procedure is complete.
The output gate is in charge of determining whatever relevant data from the current cell state should be shown as an output. Again, the operation of an output gate may be divided into three steps: 1. Making a vector after scaling the cell state's values to lie between -1 and +1 using the tanh function. 2. Using the values of h_t-1 and x_t to design a filter that can control the values that must be produced from the vector previously built. The sigmoid function is used in this filter once again. 3. Adding this regulatory filter's value to the vector made in step 1, multiplying it, and sending the result both to the next cell's concealed state and as an output.
F.. Our Dataset
The data contains records about the Equity price of IT Leading company such as Reliance Industries Limited
Reliance Industries Limited :
https://finance.yahoo.com/quote/RELIANCE.NS/history
The dataset also includes a date-specific value of equity with open, closing, high, and low prices, as well as information on the volume and turnover of transactions that day. Here, we make a forecast using a close value. The Close Value is the final output value that will be forecasted using the Deep Learning model at last, using the LSTM Deep Learning method, compare closed real values with close predicted values.
V. PROPOSED WORK
A. Proposed Algorithm is given below
B. Proposed Architecture and System Flow Diagram
Regarding demonstrated evaluation metrics that display the outcome of where project datasets RELIANCE.NS. and data that has been trained and tested, where batch size 10 and Epoch 50. The value listed above represents the test value.
(RMSE) root Mean Square Error: The root mean squared error, which is the square root of the average squared distance (difference between the actual and expected value), is another often used statistic. The square root of each square of the distance divided by the total number of points is the definition of RMSE.
(MSE) mean_squared_error: This is a metric that measures the average squared difference between the predicted and actual values. It is calculated as the mean of the squared differences between the predicted and actual values. This metric is useful for penalizing large errors in the predictions, and is commonly used as a loss function during training. However, it can be sensitive to outliers and does not provide an easily interpretable measure of error in the original units of the response variable.
(MAE) mean_absolute_error: This is a metric that measures the average absolute difference between the predicted and actual values. It is calculated as the mean of the absolute differences between the predicted and actual values. This metric provides an easily interpretable measure of error in the original units of the response variable, and is less sensitive to outliers than the mean squared error.
r2_score: This is a metric that measures the proportion of variance in the target variable that is explained by the model, normalized by the total variance in the target variable. It is calculated as 1 - (sum of squared residuals / total sum of squares). This metric provides a normalized indication of how well the model fits the data, and can be interpreted as the percentage of variance in the target variable that is explained by the model. It ranges from 0 to 1, with 1 indicating a perfect fit and values close to 0 indicating poor performance.
With the introduction of Deep Learning Technique and its strong algorithms, the most recent market research and equity Market Price Prediction advancements have begun to include such approaches in analyzing equity market data. The Opening Value of the Equity, the Highest and Lowest values of that equity on the same days, as well as the Closing Value at the end of the day, are all indicated for each date. Predicting the equity market was a time-consuming and laborious procedure a few years or even a decade ago. However, with the application of Deep learning using LSTM for equity market Price Prediction, forcaste, analysis and diversification portfolio analysis, the procedure has become much simpler. Deep learning not only saves time and resources but also outperforms people in terms of performance. It will always prefer to use a trained computer algorithm since it will advise you based only on facts, numbers, and data and will not factor in emotions or prejudice
[1] S. Selvin, R. Vinayakumar, E. A. Gopalkrishnan, V. K. Menon and K. P. Soman, \"Stock price prediction using LSTM, RNN and CNN-sliding window model,\" in International Conference on Advances in Computing, Communications and Informatics, 2017. [2] Stock Price Prediction Using LSTM on Indian Share Market by Achyut Ghosh, Soumik Bose1, Giridhar Maji, Narayan C. Debnath, Soumya Sen,2019. vol 63,pp 101—110 [3] Murtaza Roondiwala, Harshal Patel, Shraddha Varma, “Predicting Stock Prices Using LSTM” in Undergraduate Engineering Students, Department of Information Technology, Mumbai University, 2015. Volume 6, Issue 4 [4] Xiongwen Pang, Yanqiang Zhou, Pan Wang, Weiwei Lin, “An innovative neural network approach for stock market prediction”, Springer Science+Business Media, LLC, part of Springer Nature 2018 [5] Ishita Parmar, Navanshu Agarwal, Sheirsh Saxena, Ridam Arora, Shikhin Gupta, Himanshu Dhiman, Lokesh Chouhan Department of Computer Science and Engineering National Institute of Technology, Hamirpur – 177005, INDIA - Stock Market Prediction Using Machine Learning.2018 [6] Pranav Bhat Electronics and Telecommunication Department, Maharashtra Institute of Technology, Pune. Savitribai Phule Pune University - A Machine Learning Model for Stock Market Prediction,2020,JRECE VOL. 8 ISSUE 1 [7] Stock Market Prediction Using LSTM Recurrent Neural Network Adil MOGHAR ,Mhamed HAMICHE, Volume 170,2020 [8] Anurag Sinha Department of computer science, Student, Amity University Jharkhand Ranchi, Jharkhand (India), 834001 - Stock Market Prediction Using Machine Learning,2022, Vol 13, Issue 06 [9] V Kranthi Sai Reddy Student, ECM, Sreenidhi Institute of Science and Technology, Hyderabad, India - Stock Market Prediction Using Machine Learning.,2018, Volume: 05 Issue: 10 [10] S. Dinesh1, A.M.S. Rama Raju1, S. Rahul1, O. Naga Sandeep1 Mr. N D S S Kiran Relangi2 1Final year students of Department of CSE, Anil Neerukonda Institute of Technology and Sciences,2021, Volume X, Issue VI [11] Stock Market Prediction Using LSTM Technique Drashti Talati , Dr. Miral Patel , Prof. Bhargesh Patel, Volume 10 Issue VI,2022 [12] \"STOCK MARKET PREDICTION USING LSTM NEURAL NETWORKS\" P. Akhila, Dr.P.Krishna Subba Rao, CH.Avinash,2018,Vol.5, Issue 5
Copyright © 2023 Vijay Raj Singh, Manoj V, Sunil Kumar GP, Dr. Sheshappa S. N, Prof. Mr. Byre Gowda B. K. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.
Paper Id : IJRASET51297
Publish Date : 2023-04-30
ISSN : 2321-9653
Publisher Name : IJRASET
DOI Link : Click Here