IDEAS home Printed from https://ideas.repec.org/p/sek/iefpro/13815878.html
   My bibliography  Save this paper

Support for Stock Trend Prediction Using Transformers and Sentiment Analysis

Author

Listed:
  • Harsimrat Kaeley

    (University of California, Irvine)

  • Ye QIAO

    (University of California, Irvine)

  • Nader BAGHERZADEH

    (University of California, Irvine)

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, 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.
  • Handle: RePEc:sek:iefpro:13815878
    as

    Download full text from publisher

    File URL: https://iises.net/proceedings/18th-economics-finance-conference-london/table-of-content/detail?cid=138&iid=004&rid=15878
    File Function: First version, 0000
    Download Restriction: no
    ---><---

    References listed on IDEAS

    as
    1. Yawei Li & Shuqi Lv & Xinghua Liu & Qiuyue Zhang & Siew Ann Cheong, 2022. "Incorporating Transformers and Attention Networks for Stock Movement Prediction," Complexity, Hindawi, vol. 2022, pages 1-10, February.
    2. 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. 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.
    3. 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.
    4. Harsimrat Kaeley & Ye Qiao & Nader Bagherzadeh, 2023. "Support for Stock Trend Prediction Using Transformers and Sentiment Analysis," Papers 2305.14368, arXiv.org.
    5. 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.
    6. 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.
    7. Li Rong Wang & Hsuan Fu & Xiuyi Fan, 2023. "Stock Price Predictability and the Business Cycle via Machine Learning," Papers 2304.09937, arXiv.org.
    8. Jinan Zou & Qingying Zhao & Yang Jiao & Haiyao Cao & Yanxi Liu & Qingsen Yan & Ehsan Abbasnejad & Lingqiao Liu & Javen Qinfeng Shi, 2022. "Stock Market Prediction via Deep Learning Techniques: A Survey," Papers 2212.12717, arXiv.org, revised Feb 2023.

    More about this item

    Keywords

    Stock Prediction; Machine Learning; Recurrent Neural Network; LSTM; Transformer; Self Attention; Sentiment; Analysis; Technical Analysis;
    All these keywords.

    JEL classification:

    • C32 - Mathematical and Quantitative Methods - - Multiple or Simultaneous Equation Models; Multiple Variables - - - Time-Series Models; Dynamic Quantile Regressions; Dynamic Treatment Effect Models; Diffusion Processes; State Space Models
    • C35 - Mathematical and Quantitative Methods - - Multiple or Simultaneous Equation Models; Multiple Variables - - - Discrete Regression and Qualitative Choice Models; Discrete Regressors; Proportions
    • E37 - Macroeconomics and Monetary Economics - - Prices, Business Fluctuations, and Cycles - - - Forecasting and Simulation: Models and Applications

    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:sek:iefpro:13815878. 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: Klara Cermakova (email available below). General contact details of provider: https://iises.net/ .

    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.