Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Cripto IJSDR2303207

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

ISSN: 2455-2631 March 2023 IJSDR | Volume 8 Issue 3

STOCK PRICE PREDICTION


USING LSTM
1S. Subasree, 2J. R Vasan, 3S. Arvindan, 4S. Anandnarayanan, 5N. Moganarangan
1
Assistant Professor, 2,3,4Students, 5Professor
Department of Computer Science and Engineering, Sri Manakula Vinayagar Engineering College

Abstract- Stock price prediction is always a most challenging task. Stock price prediction helps in identifying the decision
before investing on different companies. In nature, stock market is multidimensional. Stock market price prediction is
necessary for getting profit and investment of companies. The various attributes related in change of market price values
are economic, political, and human. Many intelligent networks are available to predict the price. Still there is a need a for
new prediction to optimize the stock index price. Artificial Neural Network LSTM has been applied in many different
domains with success. LSTM generalized and applied in learned base of example. LSTM helps the better prediction to
forecast the closing stock price. Neural network offers the capacity to determine the outlines in market prediction. LSTM
prediction clears the stock price forecasting challenge by forming the training set. LSTM techniques are used to form the
prediction of differentvariables. LSTM is one of the best techniques used for analyzing the historical dataset. Historical
information in the network input is used to get the expected output of the network. This approach advances in predicting
the best future stock price by forming training and testing set.

Keywords: Machine Learning, Stock Price Prediction, Long Short- Term Memory, Stock Market, Artificial neural
Networks, National Stock Exchange

INTRODUCTION
The share market is a place where the shares of a public company are traded. As discussed in [7] the volatile nature of the stock
market makes it an area which needs an abundance of analysis with the old data predicated.The previous stock trend prediction
algorithms use the historic time series stock data. the typical scientific stock price forecasting procedures are focused on the
statistical analysis of stock data. In the paper will develop a stock data predictor program that uses previous stock prices and data
will be treated as training sets for the program to predict the stock prices of a particular share this program develops a procedure.
This model considers the historical equity share price of a company price and applies RNN (Recurrent Neural Network)
technique called Long Short Term Memory (LSTM). The proposed approach considers available historic data of a share and it
provides prediction on a particular feature. The features of shares are Opening price, day High, day Low, previous day o price,
Close price, Date of trading, Total Trade Quantity and Turnover. The proposed model uses the time series analysis in order to
predict a share price for a required time span. the proposed will be considering Indian stock exchange Company named as
The National Stock Exchange of India Limited (NSE).The National Stock Exchange (NSE) is the Indian stock exchange entity, the
NSE was the first exchange in India to provide a modern, provides latest facility to the investors spread across the length and breadth
of the country. It has thoroughly modern with all latest facilities, , which provides investors with the facility to trade from anywhere
in India. This has a decisive role in reforming the Indian equity market to add increased transparency, convergence and efficiency
to the capital market. NSE's Common Index, The CNX NIFTY, is used prodigiously by the investor across India as well as globally.
It provides accommodation for the exchange, settlement and clearing in equity and debt market and additionally in derivatives. This
is one of India's most astronomically enormous mazurka, currency and index options trading exchanges worldwide. There are
numerous domestic and ecumenical companies which have an interest in the exchange. Several regional companies include TATA,
WIPRO, HDFC and YES BANK ltd. Among pilgrim investors, few are strategic holdings of the city party, Mauritius limited, Tiger
Ecumenical five holdings.
As suggested by [3] The Long Short Term Memory (LSTM) networks are a type of recurrent neural network (RNN) capable of
addressing linear problems. LSTM is a deep learning technique. Long-term Memory (LSTM) Units are enforced to learn very long
sequences. This is a more general version of the gated recurrent system. LSTM is more benign than other deep learning methods
like RNN or traditional feed forward because LSTMs tackle the evanescent gradient issue possessed by [10].
Paper is ordered as follows. In Section II, related works are discussed. Section III represents the proposed system used and
Section IV represents the proposed algorithm. In Section V the results are presented and conclusions are drawn in Section VI.
`
1. Related work
While doing the literature survey, the data about Stock market prediction systems that are as of now being utilized are considered.
Over the most recent two decades determining of stock returns has become a significant field of research. In the majority of
the cases the scientists had endeavored to build up a straight connection between the information macroeconomic factors what's
more, the stock returns, be that as it may, with the revelation of non linear slants in the financial exchange record returns, there has
been an incredible move in the focal point of the scientists towards the nonlinear expectation of the stock returns. Despite the fact
that, there after numerous writing have come up in nonlinear measurable displaying of the stock returns, the majority of them
required that the nonlinear model be indicated before the estimation is done. in any case, for the explanation that the financial
exchange returns being boisterous, unsure, confused and nonlinear in nature. There are various functions used to forecast the
parameters. Mainly include, binary threshold, linear threshold, hyperbolic sigmoid, and brown.

IJSDR2303207 International Journal of Scientific Development and Research (IJSDR) www.ijsdr.org 1270
ISSN: 2455-2631 March 2023 IJSDR | Volume 8 Issue 3

The Investigation of Stock Market Prediction Using Machine Learning Approach has been mentioned. The stock exchange
forecast has become a sharp area of interest. Particular assessment is one of them, yet it does not reliably deliver specific results, so
it is essential to develop strategies for progressively accurate gauge. All the procedures recorded under the backslide have their own
ideal conditions and obstacles over their various accomplices. The way in which straight backslide models act is that they are
consistently fitted using the least squares approach, however they may be fitted in different habits, for example by reducing the
"non-appearance of fit" in some other standard, or by diminishing a disabled variation of the least squares setback work. Again, the
least squares approach can be used to fit nonlinear models.
The impact of the financial ratios and technical analysis on stock price forecasting using random forests, The use of AI and
human-made awareness frameworks to predict stock costs is a growing example. A constantly increasing number of experts spend
their time every day considering ways to deal with techniques that can further improve the precision of the stock conjecture model.
As aresult of the galactic number of decisions available, there can be n number of ways on the most capable strategy to envision
the expense of the stock, anyway all techniques don't work a comparable way. The yield changes for each methodology whether or
not comparative educational file is being applied. In the alluded to paper the stock worth gauge has been finished by utilizing the
self-confident timberland figuring is being used to betoken the expense of the stock utilizing fiscal extents structure the perspective
quarter. This is just a single technique for optically crusading the circumstance by advancing toward it utilizing an insightful model,
utilizing the capricious boondocks to anticipate the future expense of the stock from recorded data. However, there are continuously
different components that influence the cost of the stock, such as the suspicions of the money-related authority, the general
assessment of the association, news from sundry outlets, and even events that cause the entire trade protection to change, by using
the cash related size in the vicinity of a model that can strongly separateassumptions, the accuracy of the stock value forecast model
can be extended.
It is also mentioned in [1] that stock value Prediction by methods for Multi-Source multiple instance learning unequivocally
foreseeing the protections trade is a troublesome task, anyway the web has wind up being a useful gadget in making this task less
difficult, due to the related course of action of the data, it is certainly not difficult to evacuate certain inclinations right now, it is
less difficult to establish associations between different variables and, for the most part, a case of adventure The way in which
budgetary trade information can beadequately predicted is through the use of some different options from specific legitimate data
and the use of different strategies, such as the use of a feeling analyzer, to suggest a remarkable relationship between the emotions
of individuals and how they are influenced by the enthusiasm for express stocks. One of the progressively noteworthy areas of the
desire strategy was to extract huge events from web news to see how theyhad an impact on stock costs. It is also mentioned that
trade prediction protection: using historic data analysis. The stock or offer expense can be foreseen using chronicled data and its
example in all actuality there is need to apply counts to anticipate the expenses. The customary frameworks are just worried about
variety of an element that is selected for forecast. The latter is usually achieved with the benefit of the Genetic Algorithms (GA) or
the Artificial Neural Networks (ANN's)[5], but they neglect to establish a relationship between their stock costs as long-distance
fleeting dependencies.
RautSushrut et al.[2] suggested that supervised learning classifier be used to forecast stock price movement based on financial
index data, and determine their ability. In the financial market computationalanalytical approaches have been portfolio modeling.
A discussion about the statistical AI methodology has been addressed; the usage of SVM methodology has been shown in the paper
and also shown that tactical methodologies can be applied to predict the stock prices.
Manoj S Hegde et al.[3] investigated that The Long Short Term Memory (LSTM) networks are a type of recurrent neural
network (RNN) capable of solving in volute linear problems, and also there is a discussionabout the usage of RNN (Recurrent
Neural Networks ) to predict the share prices.
M. Roondiwala et al.[4] proposed that the Long Short-Term Memory is the most popular RNN architecture. In the secret network
layer, LSTM introduces a memorycell; a processing device that replaces conventional artificial neurons, using these memory cells,
networks caneffectively link memory and remote input in time, making it suitable to dynamically capture data structure over time
with a high predictive limit. It is also shown in the paper that the stock prediction can be done on the NIFTY50 shares. The data
collection is one of the major step and later the training of our model and there is a need to test the algorithm by applying different
data set to the algorithm. Our procedure will be discussed in coming sections As Kim and H. Y. Kim et al.[5] identified that
.another significant issue with basic ANNs for stock forecast is the marvel of detonating fleeting inclination, where the loads of a
gigantically huge system either become excessively massively enormous or too inuscule (respectively),drastically easing back their
union to the ideal worth. This is regularly brought about by two components: loads are instated self-assertively and the loads
progressively proximate to the end of the system moreover slope to transmute significantly more than those at the beginning. It is
also mentioned in the paper that the usage of LSTM networks can be applied in procedure of predicting share prices.
As discussed by S. Selvin et al.[6], Customary types for dealing with the financial exchange investigation and the stock-value
forecast include a major review of the past stock-exhibition gander and the general credibility of the organization itself, and a
measurable investigation that is solely concerned with the calculation and recognition of stock-value designs, it also mentioned in
the paper that different types of analysis that can be performed in order to predict the stock value.
Loke.K.S et al.[7] suggested that the volatile nature of the stock market is an area that needs a lot of analysis based on historical
data. Traditional stock trend forecast algorithms use historical time series stock data, traditional technical forecasting procedures
for stock prices are based on statistical data analysis. in the paper author also talks about the change and advancements in the process
of predicting stock prices using AI and Machine Learning methodologies, there are many research which are being conducted
to find an accurate model to predict the stock prices and there is no universal solution which is available to apply, hence the
historic data of a share will be considered for stock price prediction.
Xi Zhang1 et al. [8] suggested that the stock markets play critical roles in modern society's economic operations. It is also
mentioned in the paper that the analysis can be performed an the data that is retrieved from a legitimate source and proposed a

IJSDR2303207 International Journal of Scientific Development and Research (IJSDR) www.ijsdr.org 1271
ISSN: 2455-2631 March 2023 IJSDR | Volume 8 Issue 3

methodology in which we can utilize multiple source of information to predict the stock values.
Tao Xing and Yuan Sun et al. [9] suggested a model which considers the historical equity share price of a company price and
applies RNN (Recurrent) technique called Long Short Term Memory (LSTM). The proposed approach considers available historical
data of a share and it applies prediction on a particular feature. The features of shares are Opening price, day High, day Low,
previousday o price, Close price, Date of trading. The proposed model uses the time series analysis in order to predict a share price
for a required time span.
Jordan Prosky et al. [10] suggested that, the CNN methodologies and its usage in predicting stock prices, a method to apply
sentiment analysis on stock prediction.
As mentioned by X. Shao and D. Ma [11] it is a more general version of the gated recurrent system. LSTM is more benign than
other deep learning methods like RNN or traditional feed forward neural networks because LSTMs tackle the evanescent gradient
issue possessed by RNNs and it is also mentioned that how to implement LSTM along with K-means algorithms for a short term
stock predictor systems.

2. Proposed System
As represented in the previous section getting thehistorical data from market is mandatory step. Then there is a need to extract
the feature which is required for data analysis, then divide it as testing and training data, training the algorithm to predict the
price and the final step it to visualize the data. Fig. 1 represents the Architecture of the proposed system.

Figure 1: Block diagram

The typical LSTM unit consists of a cell, an info door,an entrance door and a door with a view. The cell collects values over
discretionary time intervals, and the threeinputs manage the progress of data into and out of the cell. The main advantage of the
LSTM is its ability to learn context-specific temporal dependence. Each LSTM unit collects information for either a long or short
period of time (hence the name) without explicitly using theactivation function within the recurrent components. A Significant
certainty to note is that any cell state is uniquely increased by the output of the overlooked entryway, which changes somewhere
in the range of 0 and 1. In other words, the overhead door in the LSTM cell is responsible for both the loads and the capacity to
initiate the cell state. Subsequently, data from a past cell state can pass through a cell unaltered rather than expanding or decreasing
exponentially at each time-step or layer, and loads can meet their ideal quality in a reasonable measure of time. This allows LSTM's
to take care of the evaporating slope issue – as the value put away in the memory cell is not iteratively adjusted, The inclination
does not disappear when prepared with back engendering, where markets such as NSE and BSE are considered to be Indian trading
entities for our analyzes.

2.1. Parameters used


List of parameters/Symbols used in this paper is listed in Table 1

Table 1:Parameters Used

Parameter
Meaning
Used
Date Date of stock price
Open Open price of a share
Close Closing price of a share
Volume/
trade
quantity Number of shares traded
High Highest share value for the day

IJSDR2303207 International Journal of Scientific Development and Research (IJSDR) www.ijsdr.org 1272
ISSN: 2455-2631 March 2023 IJSDR | Volume 8 Issue 3

Low Lowest share value for the day


Turnover Total Turnover of the share

3. A Stock Price Predictor Using LSTM


The proposed framework that learns online anticipating the close costs of the stock with the assistance of Long Short Term
Memory (LSTM). The Long Short Term Memory (LSTM) is a counterfeit intermittent neural system (RNN) design[1] used in
the field of deep learning, Unlike standard feed forward neural systems, LSTM has input associations. Not only does the
procedure not focus on single information (e.g. pictures) but also on full information arrangements, (For example, a speech or
a video). For example, LSTM is material for undertakings, such as un partitioned, associated penmanship recognition, speech
recognition and recognition of peculiarities in arranged traffic or IDS (interruption location frameworks).

Algorithm 1: Stock prediction using LSTM

Input: Historic stock data


Output: prediction of stock price using price variation

Step 1: Start.
Step 2: Data Pre processing after getting the historic data from the market for a particular share.
Step 3: import the dataset to the data structure and read the open price.
Step 4: do a feature scaling on the data so that the data values will vary from 0 and 1.
Step 5: Creating a data structure with 60 timestamps and 1 output.
Step 6: Building the RNN (Recurrent neural network) for Step 5 data set and Initialize the RNN by using sequentialprocessor.
Step 7: Adding the first LSTM layer and some Dropout regularization for removing unwanted values.
Step 8: Adding the output layer.
Step 9: Compiling the RNN by adding optimization and the loss as mean_squared_error.
Step 10: Making the predictions and visualizing the results using plotting techniques.

Before processing the data there is an important step that is to collect the information from market. Information assortment
is the principle step in our proposed framework importing of the information from advertise clearing organizations like BSE
(Bombay Stock Exchange) and NSE (National Stock Exchange). The dataset that will be utilized in the market expectation must
be utilized to be separated dependent on different perspectives. Information assortment additionally supplements to upgrade the
dataset by including more information that is outside. Our information for the most part comprises of the earlier year stock costs.
For python available packages for retrieving the data from NSE is NSEpy
The next step is to preprocess the data; in this step the Information Pre-Processing is a significant advance ininformation mining
here the change in crude information into a basic configuration is required. The information which is retrieved from source will be
conflicting, fragmented and it will contain mistakes. The preprocessing step will purify the information; toward the end there is a
need to perform highlights scaling which will restrict the factors.
The preparation of the model incorporates cross- approval, which is a very well-founded, projected execution of the model using
the preparation information. the purpose of the tuning models is to explicitly tune the calculation training is to add information to
the calculation itself. The test sets are immaculate, as a model ought not to be made a decision about dependent on concealed
information. Scale up the information to the using of visualization technique that helps to show the variation of data in the
outcome of our algorithm.
6.The Role of LSTM in Improving Sequence Learning and Prediction
Long Short-Term Memory (LSTM) networks have improved the accuracy and effectiveness of sequence learning and prediction
tasks. The paper explores the fundamental mechanisms behind LSTM's ability to handle long-term dependencies in sequential data,
and highlights its advantages over traditional Recurrent Neural Networks (RNNs) and other sequence modeling techniques. The
paper also presents case studies and examples that demonstrate the practical applications of LSTM in various domains, such as
natural language processing, speech recognition, and time series analysis. Overall, the paper provides valuable insights into the key
role that LSTM plays in advancing the field of deep learning and improving the performance of sequence learning and prediction
tasks.
The memory cell is the core component of LSTM, which enables it to store and retrieve information over extended time periods.
The input gate and forget gate control the flow of information into and out of the memory cell, while the output gate regulates the
output of the memory cell to the next layer in the network. LSTM has been proven to be highly effective in various applications
such as natural language processing, speech recognition, and time series analysis, where long-term dependencies are common.
The success of LSTM has led to its extensive use in research and industry, and many variations and improvements to the original

IJSDR2303207 International Journal of Scientific Development and Research (IJSDR) www.ijsdr.org 1273
ISSN: 2455-2631 March 2023 IJSDR | Volume 8 Issue 3

architecture have been proposed. These advancements have further improved the performance and capabilities of LSTM networks,
making them a valuable tool for a wide range of applications. Overall, LSTM has had a significant impact on the field of deep
learning, and its versatility and effectiveness make it a critical component of modern neural network architectures.

LSTM is particularly useful for time series prediction tasks, such as stock market prediction, because it can handle long-term
dependencies and capture complex patterns in the data.

In stock market prediction, LSTM can be used to model the historical stock prices, financial indicators, news articles, and other
relevant information to predict future stock prices. LSTM is well-suited to this task because it can learn from historical data, identify
trends and patterns, and make predictions based on the current and previous values of the input features.

7.Impact of Data Size

The size of the data is a critical factor in determining the accuracy and effectiveness of the prediction models. The size of the data
refers to the number of samples, features, and time periods used in training the machine learning models. In stock market prediction,
the data typically includes historical stock prices, financial indicators, news articles, and other relevant information. The size of the
data used in this type of project can range from a few thousand to millions of data points, depending on the length of the historical
data and the granularity of the time periods.

A larger dataset can provide more information to the machine learning models, leading to better accuracy and generalization.
However, a larger dataset can also be more challenging to manage and may require more computational resources and longer
training times. Moreover, the quality of the data and the selection of relevant features are also critical factors that can affect the
performance of the models.

Therefore, it is essential to carefully consider the size and quality of the data when developing a stock market prediction model. In
some cases, it may be necessary to preprocess the data, remove outliers, or extract relevant features to improve the accuracy of the
models. It is also important to use appropriate performance metrics and evaluation techniques to assess the effectiveness of the
models and identify any areas for improvement.

Overall, the size of the data is an important factor in stock market prediction, and careful consideration and preprocessing of the
data can lead to more accurate and effective prediction models.

8.ARIMA and Linear Regression as an Alternative to LSTM: Addressing Limitations and Challenges in Stock Market
Prediction

Long Short-Term Memory (LSTM) is a popular deep learning architecture that has been widely used in stock market prediction
due to its ability to handle long-term dependencies and capture complex patterns in the data. However, there are certain limitations
and challenges associated with the use of LSTM, such as the requirement for large amounts of training data and computational
resources, and the difficulty in interpreting the model's predictions.

To address these limitations and challenges, alternative approaches such as Autoregressive Integrated Moving Average (ARIMA)
and linear regression have been used in stock market prediction. ARIMA is a time series forecasting method that models the past
values of the series and the errors made by the previous forecasts to make future predictions. Linear regression, on the other hand,
models the relationship between the dependent variable and one or more independent variables.

ARIMA has been shown to be effective in predicting short-term trends and patterns in the stock market, while linear regression has
been used to identify the factors that influence stock prices and make predictions based on these factors. Both methods have the
advantage of being relatively easy to interpret and can be used with smaller datasets.

IJSDR2303207 International Journal of Scientific Development and Research (IJSDR) www.ijsdr.org 1274
ISSN: 2455-2631 March 2023 IJSDR | Volume 8 Issue 3

In a study comparing the performance of LSTM, ARIMA, and linear regression in stock market prediction, it was found that ARIMA
and linear regression produced comparable results to LSTM, with the added advantage of being less computationally expensive and
more interpretable. Moreover, these methods can be used in combination with LSTM to enhance the accuracy and interpretability
of the predictions.
In conclusion, ARIMA and linear regression offer alternative approaches to stock market prediction that can overcome some of the
limitations and challenges associated with the use of LSTM. These methods can be used alone or in combination with LSTM to
achieve more accurate and interpretable predictions. However, the choice of method depends on the specific problem and dataset,
and careful evaluation and comparison of the methods is necessary to select the most appropriate approach.

An Autoregressive Integrated Moving Average (ARIMA) model is a time-series forecasting method that models the past values of
a series and the errors made by the previous forecasts to make future predictions. The ARIMA model is widely used in stock market
prediction, as it can capture short-term trends and patterns in the data.

The model has three key components: the autoregressive (AR) component, the integrated (I) component, and the moving average
(MA) component. The AR component models the relationship between the past values of the series and the current value, while the
MA component models the errors made by the previous forecasts. The I component models the non-stationarity in the series by
taking the difference between the series and its lagged values.

Overall, the ARIMA model is a widely used and effective method for time-series forecasting in stock market prediction. Its
flexibility and ability to capture short-term trends and patterns make it a popular choice among researchers and practitioners in the
field

Linear regression is a statistical method used to model the relationship between a dependent variable and one or more independent
variables. It is commonly used in stock market prediction to identify the factors that influence stock prices and make predictions
based on these factors.
The linear regression model assumes that there is a linear relationship between the dependent variable and the independent
variables. The goal of the model is to find the coefficients of the independent variables that best predict the value of the dependent
variable. This is done by minimizing the sum of squared errors between the actual values and the predicted values.
The linear regression model can be trained using historical data and evaluated using a hold-out set of data. The model can then be
used to make predictions for future time periods. The accuracy of the model's predictions can be evaluated using metrics such as
mean squared error (MSE) or mean absolute error (MAE).
The linear regression model can be extended to include non-linear relationships between the variables, by using polynomial
regression or other non-linear regression techniques. The model can also be regularized to prevent overfitting, by using techniques
such as ridge regression or lasso regression.
In stock market prediction, the linear regression model can be used to identify the factors that influence stock prices, such as
interest rates, economic indicators, or company-specific factors. The model can then be used to make predictions based on these
factors. The accuracy of the model's predictions depends on the quality of the input variables and the strength of the relationships
between the variables.

Overall, the linear regression model is a widely used and effective method for modeling the relationship between variables and
making predictions based on these relationships. Its simplicity and interpretability make it a popular choice among researchers and
practitioners in the field of stock market prediction.

To address these challenges and limitations, researchers have proposed various modifications and extensions to linear regression
and ARIMA models. These include the use of regularization techniques to prevent overfitting, the inclusion of additional variables
to capture non-linear relationships, and the use of ensemble methods to combine multiple models and improve performance.

Despite these challenges and limitations, linear regression, ARIMA and LSTM models remain popular and effective methods for
stock market prediction. By understanding the strengths and weaknesses of these models, researchers and practitioners can select
the appropriate method for their specific needs and improve the accuracy of their predictions.

9.Results and Discussion


The implementation of proposed LSTM model using python which predicts the future price of TATAMOTORS share based on its
historical data. The below visualization figure shows the visualization of TATASHARE prediction. In our paper the implementation
of an algorithm which predicts the stock price of a share for given period of time, the below graph from our algorithm will show
the predicted price of TATAMOTORS share. In the result shown in the below graph is the plotted form our algorithm outcome by
applying 96 LSTM units for achieving the accuracy.

IJSDR2303207 International Journal of Scientific Development and Research (IJSDR) www.ijsdr.org 1275
ISSN: 2455-2631 March 2023 IJSDR | Volume 8 Issue 3

The Fig 2 is drawn from original dataset and also shown the result by comparing its correctness with the trained model from
algorithm that is defined in the previous section. the “x” axis is share price. The “y” axis is days. The data is slot of 1500 days
is shown in the Fig 3.

Figure 2: predicted testing stock price

The Fig 3 is drawn from original dataset also shown the result by comparing its correctness with the trained model from
algorithm which that is defined in the previous section. the “x” axis is share price. The “y” axis is days. The data is slot of 300
days is shown in the Fig 3.

Figure 3: predicted stock price


In the Fig 2, the graph has been plot for whole data set along with some part of trained data. the graph is showing
the open price of TATAMOTORS share for 1484 th day’s opening price with very minimal loss. the algorithm has plotted the
graph successfully along with the predicted price testing price (blue) and true price (red), there is a slight difference in predicting
the price between the predicted price testing price (blue) and true price (red), which proves that our algorithm is able to predict
the withminimum loss rate for the given complete data set of a particular share.

IJSDR2303207 International Journal of Scientific Development and Research (IJSDR) www.ijsdr.org 1276
ISSN: 2455-2631 March 2023 IJSDR | Volume 8 Issue 3

In the Fig 3, the graph is showing the open price of TATAMOTORS share for 300th day’s opening price with very minimal
loss. the algorithm has plotted the graph successfully along with the predicted price testing price (blue) and actual testing price
(red), there is a slight difference in predicting the price between the predicted price testing price (blue) and actual testing price (red),
which proves that our algorithm is able to predict the with minimum loss rate of 0.0024.

The proposed algorithm is able to predict the share price with very low loss and error rate, if increase the epoch batch rates the
training will be more efficient, inthe above section we have used epoch batch size of 50 to predict the stock prices.

The figures shown in the previous section (fig 2 and fig 3) of the proposed algorithm is able to predict the price, with loss:
0.0024

300th days open price was 172 rupees INR and our predicted price is 166 rupees per share.

10.Conclusion
The study of the share is carried out in this paper and it can be carried out for several shares in the future. Prediction could be more
reliable if the model trains a greater number of data sets using higher computing capacities, an increased number of layers, and
LSTM modules.
In future enhancement the inclusion of data from wider range datasets to understand what the market thinks about the price
variation for a particular share andit can be implemented by adding different types of APIto our program as Facebook is a leading
social media which has lots of market trend information posted byusers.

References
[1] Hiba Sadia, Aditya Sharma, Adarrsh Paul, SarmisthaPadhi, Saurav Sanyal- “Stock Market Prediction Using Machine
Learning Algorithms”, IJEAT, 2019.
[2] Raut Sushrut Deepak, Shinde Isha Uday, Dr. D. Malathi, “Machine Learning Approach In Stock Market Prediction”,
IJPAM 2017
[3] M. S. Hegde, G. Krishna and R. Srinath, "An Ensemble Stock Predictor and Recommender System," 2018 International
Conference on Advances in Computing, Communications and Informatics (ICACCI), Bangalore, 2018, pp. 1981-
1985.
[4] M. Roondiwala, H. Patel and S. Varma, "Predicting stock prices using LSTM," International Journal of Science and
Research(IJSR), vol. 6, no. 4, pp. 1754-1756, 2017.
[5] T. Kim and H. Y. Kim, "Forecasting stock prices with a feature fusion LSTM-CNN model using different representations
of the same data," PloS one, vol. 14, no. 2, p. e0212320, April 2019.
[6] S. Selvin, R. Vinayakumar, E. A. Gopalkrishnan,
V. K. Menon and K. P. Soman, "Stock priceprediction using LSTM, RNN and CNN-sliding window model," in
International Conference on Advances in Computing, Communications and Informatics, 2017.
[7] Loke.K.S. “Impact Of Financial Ratios And Technical Analysis On Stock Price PredictionUsing Random Forests”, IEEE,
2017.
[8] . Xi Zhang1, Siyu Qu1, Jieyun Huang1, Binxing Fang1, Philip Yu2, “Stock Market Prediction viaMulti-Source Multiple
Instance Learning.” IEEE 2018.
[9] Tao Xing, Yuan Sun, Qian Wang, Guo Yu. "The Analysis and Prediction of Stock Price", 2013 IEEE International
Conference on Granular Computing (GrC), ISBN: 978-1-4799-1282-7, DOI: 10.1109/GrC.2013.6740438.
[10] Jordan Prosky, Andrew Tan, Xingyou Song,Micael Zhao. "Sentiment Predictability for
Stocks" - arXiv:1712.05785v2 [cs.CL], 18 Jan 2018.
[11] X. Shao, D. Ma, Y. Liu, Q. Yin. "Short-term forecast of stock price of multi-branch LSTM based on K-means", 2017
4th InternationalConference on Systems and Informatics (ICSAI).

View publication stats

IJSDR2303207 International Journal of Scientific Development and Research (IJSDR) www.ijsdr.org 1277

You might also like