IDEAS home Printed from https://ideas.repec.org/p/arx/papers/2305.14368.html
   My bibliography  Save this paper

Support for Stock Trend Prediction Using Transformers and Sentiment Analysis

Author

Listed:
  • Harsimrat Kaeley
  • Ye Qiao
  • Nader Bagherzadeh

Abstract

Stock trend analysis has been an influential time-series prediction topic due to its lucrative and inherently chaotic nature. Many models looking to accurately predict the trend of stocks have been based on Recurrent Neural Networks (RNNs). However, due to the limitations of RNNs, such as gradient vanish and long-term dependencies being lost as sequence length increases, in this paper we develop a Transformer based model that uses technical stock data and sentiment analysis to conduct accurate stock trend prediction over long time windows. This paper also introduces a novel dataset containing daily technical stock data and top news headline data spanning almost three years. Stock prediction based solely on technical data can suffer from lag caused by the inability of stock indicators to effectively factor in breaking market news. The use of sentiment analysis on top headlines can help account for unforeseen shifts in market conditions caused by news coverage. We measure the performance of our model against RNNs over sequence lengths spanning 5 business days to 30 business days to mimic different length trading strategies. This reveals an improvement in directional accuracy over RNNs as sequence length is increased, with the largest improvement being close to 18.63% at 30 business days.

Suggested Citation

  • Harsimrat Kaeley & Ye Qiao & Nader Bagherzadeh, 2023. "Support for Stock Trend Prediction Using Transformers and Sentiment Analysis," Papers 2305.14368, arXiv.org.
  • Handle: RePEc:arx:papers:2305.14368
    as

    Download full text from publisher

    File URL: http://arxiv.org/pdf/2305.14368
    File Function: Latest version
    Download Restriction: no
    ---><---

    References listed on IDEAS

    as
    1. Tej Bahadur Shahi & Ashish Shrestha & Arjun Neupane & William Guo, 2020. "Stock Price Forecasting with Deep Learning: A Comparative Study," Mathematics, MDPI, vol. 8(9), pages 1-15, August.
    Full references (including those not matched with items on IDEAS)

    Most related items

    These are the items that most often cite the same works as this one and are cited by the same works as this one.
    1. Tej Bahadur Shahi & Chiranjibi Sitaula & Arjun Neupane & William Guo, 2022. "Fruit classification using attention-based MobileNetV2 for industrial applications," PLOS ONE, Public Library of Science, vol. 17(2), pages 1-21, February.
    2. Harsimrat Kaeley & Ye QIAO & Nader BAGHERZADEH, 0000. "Support for Stock Trend Prediction Using Transformers and Sentiment Analysis," Proceedings of Economics and Finance Conferences 13815878, International Institute of Social and Economic Sciences.
    3. Ilia Zaznov & Julian Kunkel & Alfonso Dufour & Atta Badii, 2022. "Predicting Stock Price Changes Based on the Limit Order Book: A Survey," Mathematics, MDPI, vol. 10(8), pages 1-33, April.
    4. Wai Khuen Cheng & Khean Thye Bea & Steven Mun Hong Leow & Jireh Yi-Le Chan & Zeng-Wei Hong & Yen-Lin Chen, 2022. "A Review of Sentiment, Semantic and Event-Extraction-Based Approaches in Stock Forecasting," Mathematics, MDPI, vol. 10(14), pages 1-20, July.
    5. Illia Baranochnikov & Robert ƚlepaczuk, 2022. "A comparison of LSTM and GRU architectures with novel walk-forward approach to algorithmic investment strategy," Working Papers 2022-21, Faculty of Economic Sciences, University of Warsaw.
    6. Changzhi Li & Dandan Liu & Mao Wang & Hanlin Wang & Shuai Xu, 2023. "Detection of Outliers in Time Series Power Data Based on Prediction Errors," Energies, MDPI, vol. 16(2), pages 1-19, January.
    7. Li Rong Wang & Hsuan Fu & Xiuyi Fan, 2023. "Stock Price Predictability and the Business Cycle via Machine Learning," Papers 2304.09937, arXiv.org.

    More about this item

    NEP fields

    This paper has been announced in the following NEP Reports:

    Statistics

    Access and download statistics

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:arx:papers:2305.14368. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    If CitEc recognized a bibliographic reference but did not link an item in RePEc to it, you can help with this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: arXiv administrators (email available below). General contact details of provider: http://arxiv.org/ .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.