This post will hope to show that sentiment is a viable stock selection criteria and that even a simple and obvious strategy exhibits sentiment alpha.
Long-Only Positive Sentiment Filter Strategy
The strategy can be described as follow:
- At the start of each trading day
- Select stocks in the universe with previous day sentiment > 7 and invest in them with weightage based on the previous day sentiment holding for 1 trading day
We basically invest in stocks that had a strong sentiment on the previous trading day, believing that the sentiment will drive further gains and profit.
The weightage assigned to each stock will be (sentiment/sum of all sentiment that fits filter) as we want to assign more weightage on stocks with the best sentiment.
For testing, 29 stocks that are either current components in the Dow Jones Industrial Average or were component of the index in the past were used. The list of stocks can be found in the code itself. The benchmark index can be changed on line 27. The backtest period can also be extended to include up till August of 2017 as the data is there on the file.
Trading too many Stocks
It is important to ensure that the strategy does not trade too many stocks. With an extremely short holding period of 1 day and high portfolio turnover, trading too many stocks can lead to extremely high transaction costs.
A secondary selection criteria can be used if we find that the first filter selects too many stocks. We can further reduce the number of positions opened by taking the n-largest or n-random stocks from the selected stocks based on how many we need. The code posted has 2 helper functions that can be used to tweak the strategy to reduce stocks traded, namely n_largest and n_random which can be applied to the scores variable before we convert to weights.
Other Possible Filters
Here are some suggestions for other possible filters:
- Sentiment – 5-day Sentiment Simple or Exponential Moving Average
- (Sentiment – 5-day Sentiment Low)/(5-day Sentiment High – 5-day Sentiment Low) (Variant of the Stochastic Oscillator in Technical Analysis)
Both above filters work on the concept of relative sentiment, which means that when we look at current sentiment data, we need to also consider the sentiment data of the recent past before we can determine how good or bad current sentiment data is.
For example, if the past sentiment has been extremely bad for successive days and the sentiment today is not as bad, we will view this as a good sign and count the current sentiment as good even though the absolute value of the sentiment is not high. The above filters will allow us to compare how the current sentiment is compared to the sentiment of the recent past.
More about the data
The data used in this particular instance is powered by FinSentS published by InfoTrie Financial Solutions.
The FinSentS News Sentiment database offers daily media sentiment indicators for 23,000+ global equities, calculated by applying sophisticated real-time machine-learning algorithms to the content of thousands of news websites and media sources from around the world.
Each stock has 5 indicators:
- Sentiment Score: a numeric measure of the bullishness / bearishness of news coverage of the stock.
- Sentiment High / Low: highest and lowest intra-day sentiment scores.
- News Volume: the absolute number of news articles covering the stock.
- News Buzz: a numeric measure of the change in coverage volume for the stock.
|Returns||1 Month||3 Month||6 Month||12 Month|
|Alpha||1 Month||3 Month||6 Month||12 Month|
|Beta||1 Month||3 Month||6 Month||12 Month|
|Sharpe||1 Month||3 Month||6 Month||12 Month|
|Sortino||1 Month||3 Month||6 Month||12 Month|
|Volatility||1 Month||3 Month||6 Month||12 Month|
|Max Drawdown||1 Month||3 Month||6 Month||12 Month|