FAST : Financial News and Tweet Based Time Aware Network for Stock Trading (2021)

Abstract: Designing profitable trading strategies is complex as stock movements are highly stochastic; the market is influenced by large volumes of noisy data across diverse information sources like news and social media. Prior work mostly treats stock movement prediction as a regression or classification task and is not directly optimized towards profit-making. Further, they do not model the fine-grain temporal irregularities in the release of vast volumes of text that the market responds to quickly. Building on these limitations, we propose a novel hierarchical, learning to rank approach that uses textual data to make time-aware predictions for ranking stocks based on expected profit. Our approach outperforms state-of-the-art methods by over 8% in terms of cumulative profit and risk-adjusted returns in trading simulations on two benchmarks: English tweets and Chinese financial news spanning two major stock indexes and four global markets. Through ablative and qualitative analyses, we build the case for our method as a tool for daily stock trading.

## introduction the stock market, a financial ecosystem involving quantitative trading and investing, observed a market capitalization exceeding $us 60 trillion as of 2019. 1 stock trading presents lucrative opportunities for investors to utilize the market as a platform for investing funds and maximizing profits. however, making profitable investment decisions is challenging due to the market's volatile and rapid-changing nature @xcite . research at the intersection of natural language processing (nlp) and finance presents encouraging prospects in stock prediction @xcite *equal contribution. 1 world federation of exchanges: https://data. worldbank.org/indicator/cm.mkt.lcap.cd/ figure 1 : here, we study how tesla's tweets influence investors' opinions about the company and impact its stock price trend. the first tweet shows positive opinions, and we observe a rise in prices. later, the tweets made by the ceo rapidly lead to drastic price drops within minutes. further, without a sequential context, it gets challenging to understand the tweets that follow. @xcite ). conventional work forecasts future trends by modeling numerical historic stock data @xcite . however, price signals alone can not capture market surprises, news, and company announcements. such events, often reported across financial news and social media, have shown to influence market dynamics @xcite . as shown in figure 1 , prices immediately react to breaking news about the related company. such reactions conform to the efficient market hypothesis (emh), which states that financial markets are informationally efficient and prices reflect all available information @xcite . the abundance of stock affecting information across news and twitter helps investors analyze market trends and inspires the adoption of nlp to study the interplay between textual data and stock prices @xcite . however, unlike structured numerical data, analyzing natural language poses various challenges. first, analyzing individual tweets or news headlines may not be informative enough. they often exhibit a sequential context-dependency, where analyzing them together can provide a greater unified context, figure 2 : more accurate methods m 1 (higher accuracy) may not always be more profitable than less accurate methods m 2 (lower accuracy). profit is gained by selling stocks having ¬ prediction for price movement from trading day t to t+1. as shown in figure 1 . despite the success of recurrent neural networks (rnns) in modeling such a sequential context ( §2), a critical drawback is that they assume all text to be equally spaced in time, ignoring the inherent dynamic timing irregularities of social media and news. timing plays a critical role as stock markets rapidly react to new information @xcite , leading to significant price changes within minutes, as shown in figure 1 . @xcite show that reacting one second slower than other market participants can lead to a loss in thousands of dollars. further, not each text holds the potential to influence stock prices, texts have a diverse influence on stock prices based on their content, such as breaking news or tweets from a reliable source, as opposed to noise like vague comments as shown in figure 1 . these observations mandate the need to factor in the time-aware dependencies and diverse influence in analyzing online natural language data for stock trading. despite profitability being the prime objective of trading, nlp methods for stock prediction @xcite are commonly framed as classification or regression tasks, and are not directly optimized towards profitable stock selection. consider the toy example in figure 2 that shows how methods having a higher classification accuracy may not always lead to higher overall profits. this research gap in nlp methods for stock prediction presents a new direction for stock selection, where both predictive performance and profits are jointly and directly optimized. contributions: we formulate stock prediction as a learning-to-rank problem ( §3.1) and present fast: financial news and tweet based time aware network for stock trading, which uses text for maximizing profit by jointly optimizing predictive power and the optimal ranking of stocks. fast learns time-aware representations of financial news and tweets, and captures relevant market signals using hierarchical temporal attention for ranking stocks ( §3). through experiments ( §4) on english and chinese text corresponding to the nasdaq, shanghai, shenzhen, and hong kong markets, we show that fast outperforms state-of-the-art methods in terms of intraday returns by over 8% and risk-adjusted returns by over 10% ( §5.1, §5.2). further, through exploratory ( §5.3, §5.4) and qualitative ( §6) analyses, we demonstrate the practical applicability of fast to daily stock trading. contemporary methods: newer models based on the emh, leverage natural language features extracted from investor sentiments @xcite , financial reports @xcite , earnings calls @xcite , online news @xcite @xcite ) and social media @xcite @xcite for stock price regression and movement classification tasks. these methods show how nlp can complement conventional price-based methods in capturing the effect of events like market surprises and mergers over stock returns. however, these methods do not directly optimize profit, and do not factor the fine-grain irregularities in release times of stock affecting text. for stock trading, the timing of release of information across these sources plays a critical role, as price changes rapidly factor all publicly available information @xcite . firms may exploit investors' perception of market information @xcite , for instance, by timing the release of negative news between positive ones to minimize losses @xcite . these limitations hinder contemporary methods from modeling a time-aware progression of stock-affecting market signals to directly optimize profit generation. time-aware methods: recently, time-aware modeling of time series data has shown improvements over conventional sequential models like rnns and lstms on various tasks such as patient subtyping @xcite , suicide ideation and buildup detection using twitter history @xcite , disease progression @xcite , and much more. however, modeling the temporal dynamics inherent in social media and online news is complex as it involves noisy and diversely influential data across irregular time intervals. the intersection of modeling the temporal dynamics of natural language with finance presents an underexplored yet promising research avenue. ## fast qualitative analysis we now conduct an extended analysis as shown in figure analyzing hierarchical attention: within days, the intra-day attention filters less informative news and emphasizes more influential ones. for instance, we observe that the second news about boe technology on 7 th categorizes the stock as "overweight," a rating through which equity analysts forecast better future performance @xcite . such news would likely induce positive public sentiments and drive more investment to the stock, as opposed to the less informative news about "margin trading data." the intra-day attention accurately captures the diverse influence of such news headlines. further, we observe that news released on 9 th comprises relatively more crucial information than other days, and the inter-day attention accurately emphasizes its importance. these observations reiterate the diverse influence of different news and days over future stock returns, accurately captured by the hierarchical temporal attention mechanism. probing time-aware modeling: the news released for shanghai electric (se) on the morning of 9 th reports a positive event, likely indicating future profits. later during that afternoon, after a few hours, two other news report negative impacts over se due to a loss in nuclear power stocks, indicating a downtrend for the upcoming days. fast disregards older news to emphasize on the newer ones to forecast the upcoming loss and allots a lower rank to se. in contrast, ranking methods such as ranknet assign a higher rank to se, potentially due to their inability to model the time-aware dependencies. further, classification methods like sn-hfa do not correctly predict the stock return trends, as they do not capture the fine-grain temporal irreg-ularities in texts, and are not optimized towards profit. consequently, fast relatively outperforms sn-hfa by a margin of 47.5%, and ranknet by 28.4% in profits on 10 th december 2015. ## conclusion we propose fast, a neural approach to rank profitable stocks using stock-relevant textual data across online financial news and tweets. to model the market information, fast hierarchically learns temporally relevant signals from texts and shows the positive effects of factoring the fine-grain temporal irregularities in textual data. through quantitative and qualitative analyses on english tweets and chinese financial news spanning four stock markets, we highlight the real-world applicability of fast. in trading simulations on the s&p 500 and china a-shares indexes, fast outperforms state-ofthe-art methods across four different formulations by over 8% in terms of profit and sharpe ratio.