Trading Stocks Based on Financial News Using Attention Mechanism
Saurabh Kamal,
Sahil Sharma,
Vijay Kumar,
Hammam Alshazly,
Hany S. Hussein and
Thomas Martinetz
Additional contact information
Saurabh Kamal: Engineering and Technology Department, Liverpool John Moores University, Liverpool L3 5UX, UK
Sahil Sharma: Computer Science and Engineering Department, Thapar Institute of Engineering and Technology, Patiala 147004, India
Vijay Kumar: Computer Science and Engineering Department, National Institute of Technology, Hamirpur 177005, India
Hammam Alshazly: Faculty of Computers and Information, South Valley University, Qena 83523, Egypt
Hany S. Hussein: Electrical Engineering Department, College of Engineering, King Khalid University, Abha 62529, Saudi Arabia
Thomas Martinetz: Institute for Neuro- and Bioinformatics, University of Lübeck, 23562 Lübeck, Germany
Mathematics, 2022, vol. 10, issue 12, 1-30
Abstract:
Sentiment analysis of news headlines is an important factor that investors consider when making investing decisions. We claim that the sentiment analysis of financial news headlines impacts stock market values. Hence financial news headline data are collected along with the stock market investment data for a period of time. Using Valence Aware Dictionary and Sentiment Reasoning (VADER) for sentiment analysis, the correlation between the stock market values and sentiments in news headlines is established. In our experiments, the data on stock market prices are collected from Yahoo Finance and Kaggle. Financial news headlines are collected from the Wall Street Journal, Washington Post, and Business-Standard website. To cope with such a massive volume of data and extract useful information, various embedding methods, such as Bag-of-words (BoW) and Term Frequency-Inverse Document Frequency (TF-IDF), are employed. These are then fed into machine learning models such as Naive Bayes and XGBoost as well as deep learning models such as Convolutional Neural Network (CNN) and Long Short-Term Memory (LSTM). Various natural language processing, andmachine and deep learning algorithms are considered in our study to achieve the desired outcomes and to attain superior accuracy than the current state-of-the-art. Our experimental study has shown that CNN (80.86%) and LSTM (84%) are the best performing models in relation to machine learning models, such as Support Vector Machine (SVM) (50.3%), Random Forest (67.93%), and Naive Bayes (59.79%). Moreover, two novel methods, BERT and RoBERTa, were applied with the expectation of better performance than all the other models, and they did exceptionally well by achieving an accuracy of 90% and 88%, respectively.
Keywords: deep learning; sentiment analysis; word embedding; natural language processing; news summarisation; market-based investor (search for similar items in EconPapers)
JEL-codes: C (search for similar items in EconPapers)
Date: 2022
References: View references in EconPapers View complete reference list from CitEc
Citations: View citations in EconPapers (1)
Downloads: (external link)
https://www.mdpi.com/2227-7390/10/12/2001/pdf (application/pdf)
https://www.mdpi.com/2227-7390/10/12/2001/ (text/html)
Related works:
This item may be available elsewhere in EconPapers: Search for items with the same title.
Export reference: BibTeX
RIS (EndNote, ProCite, RefMan)
HTML/Text
Persistent link: https://EconPapers.repec.org/RePEc:gam:jmathe:v:10:y:2022:i:12:p:2001-:d:835568
Access Statistics for this article
Mathematics is currently edited by Ms. Emma He
More articles in Mathematics from MDPI
Bibliographic data for series maintained by MDPI Indexing Manager ().