Abstract

Accurate stock market prediction is highly desirable to corporations and investors. In this study a deep learning model based on LSTM, BiLSTM with attention mechanism used to predict stocks closing price for next 30 days of two banks listed in Pakistan Stock Exchange. For accurate stock price prediction, it is necessary to consider volatile factors such as news sentiments along with historical data. This study covers that aspect by incorporating news sentiments along with historical stock data that is distributed over a span of ten years from Jan 2011 to July 2021. Preprocessing and sentiment analysis of data was performed using python NLTK module. After that we built a univariate deep learning model based on four layers of LSTM and one dense layer to combine all layers and performed a prediction on train and test data followed by a multivariate deep learning model based on BiLSTM with self-attention mechanism and found out that incorporation of news sentiments really improved the prediction accuracy by reducing the values of mean squared error. Finally, we did the prediction for next 30 days of stock closing price of two banks and compared those predicted prices with actual prices and got quite accurate results.

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.