Paper: arXiv 2305.14368

Authors: 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.

Complexity vs Empirical Score

  • Math Complexity: 6.0/10
  • Empirical Rigor: 6.0/10
  • Quadrant: Holy Grail — high math complexity, high empirical rigor

Why this score: The paper employs advanced deep learning concepts like Transformer self-attention and has detailed equations for technical indicators, yet it is grounded in a novel dataset with specific performance metrics against baseline models.

Research Flowchart

  flowchart TD
  A["Research Goal: Improve Stock Trend Prediction"] --> B["Data Collection"]
  
  subgraph B ["Data Inputs"]
      B1["Daily Technical Data"]
      B2["Top News Headlines"]
  end
  
  B --> C["Sentiment Analysis"]
  B --> D["Transformer Model Training"]
  
  C --> D
  
  subgraph D ["Model Architecture"]
      D1["Technical Features + Sentiment Scores"]
      D2["Multi-Head Attention"]
      D3["Feed-Forward Network"]
  end
  
  D --> E["Performance Evaluation"]
  
  subgraph E ["Comparison"]
      E1["Transformer vs RNNs"]
      E2["5-30 Business Days Sequence Lengths"]
  end
  
  E --> F["Key Findings"]
  
  subgraph F ["Outcomes"]
      F1["↑ 18.63% Directional Accuracy at 30 Days"]
      F2["Transformer Outperforms RNNs for Long Sequences"]
      F3["Sentiment Analysis Reduces News Lag"]
  end

Evidence Card

What the authors claim, on what data, and who has checked it. Read from the paper's own text by a language model: every quote is verbatim, nothing was re-run. How to read this card

Proposes

The paper proposes a Transformer‑based model (StockFormer) that combines technical stock data with sentiment analysis and introduces a novel dataset of daily technical data and news headlines.

Source sentence
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.

Assumes 2

  • Longer lag periods allow the Transformer to capture long‑term dependencies better than RNNs. model
    Source sentence
    We believe this is attributed to the fact that a lag period of 4 days is not long enough for our Transformer based model’s ability to better extract long-term dependencies
  • Z‑Score normalization of all numerical fields is sufficient to prevent price scale differences from affecting trend prediction. data
    Source sentence
    Therefore, we conduct a Z-Score normalization over all numerical fields to prevent the different prices of each stock in our dataset from skewing our results

Data

Backtest sample: equities · daily

  • novel dataset containing daily technical stock data and top news headline data · EOD Historical Data API and News API market-prices commercial
    3/18/2019 - 2/18/2022 · FAANG (Facebook, Amazon, Apple, Netflix, Google) companies
    Source sentence
    The dataset consists of 3700 entries of the FAANG (Face-book, Amazon, Apple, Netflix, Google) companies. The entries are drawn from actual stock data from a time period of close to three years spanning from 3/18/2019 - 2/18/2022.
  • news headline sentiment scores · News API processed with FinBert text-news commercial
    3/18/2019 - 2/18/2022 · FAANG companies
    Source sentence
    Each entry in our dataset corresponds to a business day for a given stock and contains this stock’s technical indicator data and top news headline for the given day. The news headline feature is preprocessed using FinBert

Costs

Not applicable The paper reports no trading or execution result.

Finds 3

  • The Transformer model improves directional accuracy over RNNs, achieving up to an 18.63% improvement at a 30‑business‑day window. performance
    Source sentence
    with the largest improvement being close to 18.63% at 30 business days.
  • At a lag period of 29 days, the model reaches 0.8919 directional accuracy versus 0.7056 for the S‑EMDAM LSTM baseline. predictive-accuracy
    Source sentence
    Our model was able to reach 0.8919 in directional accuracy compared to 0.7056 for S EMDAM LSTM.
  • For a lag period of 24 days, the model attains an AUC of 0.9727 and directional accuracy of 0.7184, outperforming the baseline LSTM. predictive-accuracy
    Source sentence
    as we increase the lag period to n=24 days, we can see that our model reaches an AUC score of 0.9727 and directional accuracy of 0.7184 as it continues to outperform our baseline LSTM

Checked by others

No other paper in the archive has been found to support or contradict these findings (compared with 11 related papers). Coverage is partial, so this is neither replication nor refutation.

Cited by 1 paper in the archive (1 by independent authors)

Code

No repository by the authors found in the paper.

Extracted 2026-11-14 · same card as JSON · A language model chose these items: check the source sentence before relying on one.