Future Stock Price Prediction Using Recurrent Neural Network, LSTM And .

1y ago
6 Views
2 Downloads
623.58 KB
5 Pages
Last View : 2m ago
Last Download : 3m ago
Upload by : Louie Bolen
Transcription

Special Issue - 2021International Journal of Engineering Research & Technology (IJERT)ISSN: 2278-0181ICRADL - 2021 Conference ProceedingsFuture Stock Price Prediction using RecurrentNeural Network, LSTM and Machine LearningShriram.S1, Dr. K. Anuradha2, Dr.K.P.Uma31Second year UG Student,1Department of Computer Science and Engineering,1Hindusthan College of Engineering and Technology,Coimbatore, India2Associate Professor, Department of Computer Applications, Karpagam Academy of Higher Education, Coimbatore, India3Professor and Head, Hindusthan College of Engineering and Technology, Coimbatore, IndiaAbstract - A stock market, equity market or share market is theaggregation of buyers and sellers ofstocks (also called shares),which represent ownership claims on businesses. The task ofpredicting stock prices is one of the difficult tasks for manyanalysts and in fact for investors. For a successful investment,many investors are very keen in predicting the future ups anddown of share in the market. Good and effective predictionmodels help investors andanalysts to predict the future of thestock market. In this project, I had proposed RecurrentNeural Network (RNN) and Long Short-Term Memory (LSTM)model by using Machine andDeep Learning models to predictstock market prediction. In present, there are several modelsto predict the stock market but they are less accurate. I hadproposed a model that uses RNNand LSTM to predict the trendin stock prices that would be more accurate. LSTM introducesthe memory cell, a unit of computation that replaces traditionalartificial neurons in the hiddenlayer of the network. In thiswork by increasing the Epochs and batch size, the accuracy ofprediction is more. In proposed method, I am using a test datathat is used to predict whichgives results that are more accuratewith the test data. The proposed method is capable oftracingand prediction of stock market and the prediction will producehigher and accurateresults.Keywords: Stock Market Prediction, Recurrent Neural Network(RNN),Long Short Term Memory (LSTM), Epochs, batch size,Stock Price.1. INTRODUCTIONtraditional artificial neurons in thehidden layer of thenetwork. In this work by increasing the Epochs and batchsize, theaccuracy of prediction is more. In proposed method,I am using a test data that is used topredict which givesresults that are more accurate with the test data. Theproposed method iscapable of tracing and prediction of stockmarket and the prediction will produce higher andaccurate results.2. METHODOLOGY:(i) RNN (RECURRENT NEURALNETWORK)(ii) LSTM (LONG SHORT TERMMEMORY)(i) RNN(RECURRENT NEURAL NETWORK)RNN is recurrent in nature as it performs the same functionfor every input of data while the output of the current inputdepends on the past one computation. After producing theoutput, it is copied and sent back into the recurrent network.For making a decision, it considers the current input and theoutput that it has learned from the previous input. Unlikefeed forward neural networks, RNNs can use their internalstate (memory) to process sequences of inputs. In otherneural networks, all the inputs are independent of each other.But in RNN, all the inputs are related to each other.Our project is recurrent neural network based Stock priceprediction using machine learning.For a successfulinvestment, many investors are very keen in predicting thefuture ups anddown of share in the market. Good andeffective prediction models help investors andanalysts topredict the future of the stock market. In this project, I hadproposed a RecurrentNeural Network (RNN) and LongShort-Term Memory (LSTM) model by using Machine andDeep Learning models to predict stock market prediction. Inpresent, there are several modelsto predict the stock marketbut they are less accurate. I had proposed a model that usesRNNand LSTM to predict the trend in stock prices thatwouldbemoreaccurate.LSTMintroducesthe memory cell, a unit of computation that replacesVolume 9, Issue 5Published by, www.ijert.orgFigure 1 Recurrent Neural Network304

Special Issue - 2021International Journal of Engineering Research & Technology (IJERT)ISSN: 2278-0181ICRADL - 2021 Conference Proceedings3)Output gate — the input and the memory of the block isused to decide the output. Sigmoid function decides whichvalues to let through 0,1. and tanh function gives weightageto the values which are passed deciding their level ofimportance ranging from-1 to 1 and multiplied with outputofSigmoid.(ii) LSTM (LONG SHORT TERMMEMORY)Figure 2 Long Short Term MemoryLSTM’s have a Nature of Remembering information for along periods of time is their Default behavior. look at thebelow figure that says Every LSTM module will have 3 gatesnamed as Forget gate, Input gate, Output gate.Figure 6 Output gate3.DATA THAT IS USED IN THEMODEL:In the Model Two types of data are being used. They are(i) Train Data(ii) TestData(i) TrainData:In the model Train Data of 4 Years of Google Stock Prices isused. This data will be used to train our model. We useepochs of about 200 to get more accuracy.Figure 3 Long Short Term Memory Gates1) Input gate — discover which value from input should beused to modify the memory. Sigmoid function decides whichvalues to let through 0,1. andtanh function gives weightage tothe values which are passed deciding their level ofimportance ranging from-1 to1.(ii) TestData:In the Model Test data of 1 year of Google stock price isused to test our data. This data is used to test our modelforaccuracy.4.PROJECT IN PYTHONENVIRONMENT:Figure 4 Input gate2)Forget gate — discover what details to be discarded fromthe block. It is decided by the sigmoid function. it looks at theprevious state(ht-1) and the content input(Xt)andoutputs anumber between 0(omit this)and 1(keep this)for each numberin the cell state Ct 1.Figure 7 Project in python environmentFigure 5 Forget gateVolume 9, Issue 5Published by, www.ijert.org305

Special Issue - 2021International Journal of Engineering Research & Technology (IJERT)ISSN: 2278-0181ICRADL - 2021 Conference ProceedingsFigure 8 Project GUI InterfaceIn the model the project in python environment the GUIInterface consists of three buttons (i) Open Training file,(ii)Open Test file, (iii) Click to get Graph of result of model,graph of predicted future 30 days and theclosevalueofpredicted 30 days. Each button is written under a functiondefinition in python environment. Where the first button isused to open the train data, the second media is used to opentest data, the third button is used to run the RNN and LSTMand fit the model to the RNN. And the code is also writtenfor the prediction of next future 30 days. There is also codefor plotting the graph of result of the model, graph forpredicted close prices for next future 30 days and there isalso code written for displaying the values of predicted 30days Close values.Figure 10 Initializing the RNNFigure 11 Prediction of stock prices for future 30 days.Figure 9 Functions for the buttonsFigure 12 Plotting the graphVolume 9, Issue 5Published by, www.ijert.org306

Special Issue - 2021International Journal of Engineering Research & Technology (IJERT)ISSN: 2278-0181ICRADL - 2021 Conference ProceedingsFigure 13 Resultant graph5.RESULTS:Figure 16 Graph of Predicted Stock PriceFigure 14 Resultant graph of model of predictionFrom the above Graph we can see that the model haspredicted the stock prices more accurately. The model haspredicted the results more accurately. This graph comparesthe actual stock price with the predicted stock price and wecan see that the model has predicted the stock prices moreaccurately.Figure 17 The Close prices of predicted 30 days6. NOVELTY OF THEPROPOSED MODEL:Figure 15 Graph of Predicted Stock Price of future 30 dayVolume 9, Issue 5The quality of being new in my project is that in my StockPrice prediction model the prediction is more accurate thanother existing models and my project is also different in away that I had created a Graphical User Interface (GUI)where we can upload the Train data, Test Data and we canget the result of the model and the future 30 days predictedgraph with the stock prices. In my Project I had created togive a result graph which consists of the Future 30 daysPublished by, www.ijert.org307

Special Issue - 2021International Journal of Engineering Research & Technology (IJERT)ISSN: 2278-0181ICRADL - 2021 Conference ProceedingsPredicted Close Stock Prices. And also in the model thereis a special feature where it can display the close values ofthe predicted future 30 days.7. BACKGROUND OF THEPROPOSED MODEL:The Field of the proposed model is ARTIFICIALINTELLIGENCE, MACHINE LEARNING, DEEPLEARNING and my model is FUTURE STOCK PRICEPREDICTIONUSINGRECURRENTNEURALNETWORK, LSTM AND MACHINE LEARNING.TheStock Price prediction model can predict more accuratethan other existing models and my project is also differentin a way that I had created a Graphical User Interface(GUI) where we can upload the Train data, Test Data andwe can get the result of the model and the future 30 dayspredicted graph with the stock prices. In my Project I hadcreated to give a result graph which consists of the Future30 days Predicted Close Stock Prices. In my project theuser can get the future 30 days predicted Close prices ofStock prices. And also in the model there is a specialfeature where it can display the close values of thepredicted future 30days.8.ADVANTAGE OF THEMODEL:The main Advantage is that since the model uses RNN,LSTM, Machine Learning and Deep Learning models theprediction of stock prices will be more accurate. And alsoin the model it can predict the future 30 days Stock Pricesand it can show it in a graph. Also the main feature is thatthe model can show an output of the Individual PredictedClose prices of the Predicted 30 days as shown in thefigurebelow.9. CONCLUSION:In present, there are several models to predict the stockmarket but they areless accurate. We proposed a model thatuses RNN and LSTM to predict the trend instock pricesthat would be more accurate. LSTM introduces thememory cell, a unit ofcomputation that replaces traditionalartificial neurons in the hidden layer of thenetwork. In thiswork by increasing the Epochs and batch size, the accuracyofprediction is more. In proposed method, we are using atest data that is used to predictwhich gives results that aremore accurate with the test data. The proposedmethodiscapable of tracing and prediction of stock marketand the prediction will producehigher and accurate results.In our above model we are getting accurate results whichwillbe more useful to stock analysts, Business analysts,Stock Market Investors.REFERENCES[1]Batres-Estrada, B. (2015). Deep learning for multivariate financialtime series.[2] Emerson, S., Kennedy, R., O'Shea, L., & O'Brien, J. (2019, May).Trends and Applications of Machine Learning in QuantitativeFinance. In 8th International Conference on Economics and FinanceResearch (ICEFR 2019).[3] Heaton, J. B., Polson, N. G., & Witte, J. H. (2017). Deep learningfor finance: deep portfolios. Applied Stochastic Models in Businessand Industry, 33(1), 3-12.[4] Moritz, B., & Zimmermann, T. (2016). Tree-based conditionalportfolio sorts: The relation between past and future stock returns.Available at SSRN 2740751.[5] Olah, C. (2015). Understanding lstm networks–colah’s blog. Colah.github. io.[6] Paiva, F. D., Cardoso, R. T. N., Hanaoka, G. P., & Duarte, W. M.(2018). Decision-Making for Financial Trading: A Fusion Approachof Machine Learning and Portfolio Selection. Expert Systems withApplications.[7] Patterson J., 2017. Deep Learning: A Practitioner’s Approach,O’Reilly Media.[8] Siami-Namini, S., &Namin, A. S. (2018). Forecasting economicsand financial time series: Arima vs. lstm. arXiv preprintarXiv:1803.06386.[9] Takeuchi, L., & Lee, Y. Y. A. (2013). Applying deep learning toenhance momentum trading strategies in stocks. In TechnicalReport. Stanford University.[10] Wang, S., and Y. Luo. 2012. “Signal Processing: The Rise of theMachines.” Deutsche Bank Quantitative Strategy (5 June).Figure 18 The Close prices of predicted 30 daysVolume 9, Issue 5Published by, www.ijert.org308

prediction of stock prices will be more accurate. And also in the model it can predict the future 30 days Stock Prices and it can show it in a graph. Also [5] the main feature is that the model can show an output of the Individual Predicted Close prices of the Predicted 30 days as shown in the figurebelow. 9. CONCLUSION:

Related Documents:

Stock price prediction is regarded as one of most difficult task to accomplish in financial forecasting due to complex nature of stock market [1, 2, 3]. The desire of many . work are historical daily stock prices obtained from two countries stock exchanged. The data composed of four elements, namely: open price, low price, high price and

stock prices then an increase in the -rm s own stock price informativeness reduces the sensitivity of its investment to its peer stock price (prediction 1). Indeed, as the signal conveyed by its own . stock price (prediction 2), but not otherwise. The same prediction holds for an increase in the correlation of the fundamentals of a -rm .

The stock market is dynamic, non-stationary and complex in nature, the prediction of stock price index is a challenging task due to its chaotic and non linear nature. The prediction is a statement about the future and based on this prediction, investors can decide to invest or not to invest in the stock market [2]. Stock market may be

1. BASIC INTRODUCTION OF STOCK MARKET A stock market is a public market for trading of company stocks. Stock market prediction is the task to find the future price of a company stock. The price of a share depends on the number of people who want to buy or sell it. If there are more buyers, then prices will rise. If the seller has a number of .

the relationship between stock prices and these factors. Although these factors will temporarily change the stock price, in essence, these factors will be reflected in the stock price and will not change the long-term trend of the stock price. erefore, stock prices can be predicted simply with historical data.

An ecient stock market prediction model using hybrid feature reduction method based on variational autoencoders and recursive feature elimination Hakan Gunduz* Introduction Financial prediction, especially stock market prediction, has been one of the most attrac - tive topics for researchers and investors over the last decade. Stock market .

of a stock is known to be unpredictable[Walczak, 2001; Nguyenet al., 2015], research efforts have been focused on predicting the stock price movement e.g., whether the price will go up/down, or the price change will ex-ceed a threshold which is more achievable than stock price prediction[Adebiyi et al., 2014; Fenget al., 2018; Xu and Cohen, 2018].

Stock market prediction is the act of trying to determine the future value of a company stock or other financial instrument traded on a financial exchange. The successful prediction of a stock's future price could yield significant profit. The stock market is not an efficient market.