For those interested in using news sentiment data feeds, this thread is dedicated to showing pipeline factor examples created with Sentdex's News Sentiment data feed. These factors are meant for you to build, iterate on, and use in other Pipeline based algorithms you may have.
There will be a number of different factors on this thread and new ones will be updated periodically. To view a complete list of template pipeline factors for all data feeds, please visit this factor library.
So here's what you're going to get:
- Research: You'll get the economic hypothesis behind the factor and the iterations I went through before arriving at the final factor. You'll also be able to clone and visualize this factor yourselves by adjusting the date ranges and data imports available (for those who don't have the premium datafeed). This process is something you can replicate for yourselves easily by using the Factor Tearsheet.
- Pyfolio in-sample and out-of-sample factor performance: You'll get the in-sample (3 Jan 2014 - 21 Jan 2016) and out-of-sample (3 Jan 2014 - 18 Apr 2016) results of a template algorithm using this factor.
- Template algorithm: You'll get the template algorithm used to evaluate this factor. This algorithm is not geared for trading as commissions and slippage are set to zero; however, it provides a good, liquid universe filter for you to build and add other pipeline factors. Commissions and slippage are set to zero in order to analyze the alpha signal of the factor independent of other variables. I recommend using these factors as building blocks for your overall strategy.
Data Description
- sentiment_signal - A standalone sentiment score from -3 to 6 for stocks
- Coverage extends to almost all the S&P 500 securities as well as a few other key mentions
All Factors
Each factor is linked to the full research and backtest. You can find them all listed here:
Factor 1: Average monthly article sentiment
class AverageMonthlyArticleSentiment(CustomFactor):
# Economic hypothesis: Article sentiment can reflect the
# public's mood about a given security. In this case, use the past
# 30 day's article sentiment to make decisions for the next 20 trading
# days
inputs = [sentdex.sentiment_signal]
window_length = 30
def compute(self, today, assets, out, sentiment_signal):
out[:] = np.nanmean(sentiment_signal, axis=0)
This algorithm is for education - the algorithm is not intended to provide investment advice.