Back to Community
Forecasting Equity Performance Using Trader Mood Data

PsychSignal's StockTwits Trader Mood analyzes trader's messages posted on StockTwits, and provides a measure of bull/bear intensity for securities based on aggregated message sentiment. This dataset includes factors such as number of bullish and bearish messages, bull-to-bear intensity and bull-to-bear message ratio.

A simple strategy could be to go long in securities with a high bull-to-bear intensity, and short securities with a low bull-to-bear intensity. Using this dataset, I constructed the following factors:
- Bull-to-Bear intensity average over the past 3 days.
- Average # of messages over the past 30 days

The attached notebook contains the analysis I conducted using Alphalens to determine how well these factors were able to predict returns. This analysis also helped me determine a trading frequency/ holding period for my algorithm. For more details on how to use Alphalens for factor analysis, check out Lecture 41: Factor Analysis from our Lecture Series.

Then, using the results from the analysis, I integrated both factors into the Long/Short Equity template algorithm from the Lecture Series to construct an algorithm with the following characteristics:

  • Q1500US base universe
  • Long securities with high intensity value, and short securities with a low intensity value
  • Only consider top 1000 securities based on average number of messages
  • Maintain dollar neutrality, or equal long/short exposure
  • Maintain market neutrality, or low beta-to-market risk
  • Maintain low sector exposure

The Optimize API allows our algorithms to easily manage Sector and Beta-to-Market risk, and maintain Dollar Neutrality on our target portfolio every time our algorithm rebalances.

Things to consider trying next:
- Try different window lengths for both factors and use Alphalens to determine if there is any improvement
- Try different algorithm parameters, like trading frequencies or number of securities allowed based on average # of messages
- Build a multi-factor model using more alternative datasets, or combine these factors with your own alpha factors
- Conduct further analysis on the StockTwits Trader Mood dataset and develop your own factors

This post was inspired by Seong Lee's Social Media Trader Mood Series.

Our allocation process attaches high value to algorithms that use alternative datasets. We evaluate all algorithms that use alternative data, including strategies that use either free datasets or premium datasets. And, this dataset in particular does not require a subscription, which means you can research and backtest using the full dataset, as well as paper and live trade algorithms that use it.

Loading notebook preview...
Notebook previews are currently unavailable.
Disclaimer

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.

1 response

This is the corresponding backtest.

Clone Algorithm
58
Loading...
Backtest from to with initial capital
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Max Drawdown
--
Benchmark Returns
--
Volatility
--
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
# Backtest ID: 597a0ea420de9451f5991d05
There was a runtime error.