Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Sentiment as a Factor

Hi All,

Just wanted to reach out to the forums to see if anyone has had any success using sentiment_score from Stocktwits Bull minus Bear? If so, what's the best window length used?

Also, as I was going through factors I thought it might be a good idea to see if there is any juice in scanning sentiment score for volatility indications. Are there any other uses of sentiment I could gauge fluctuations outside of x std dev?

sentiment_score = SimpleMovingAverage(
inputs=[stocktwits.bull_minus_bear],
window_length=21,
)

2 responses

Hey Daniel,

Our Getting Started Tutorial actually uses StockTwits data as the example. It will show you how to statistically evaluate the predictive ability of the data over whichever window length you want.

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.

Attached is something I've been working on the last few days. The code can use a lot of work but it's a starting ground/experiment. Ultimately, my strategy for this would be to compare the rate of change (ROC) between each type of stocktwit indicator below and rank them by sector. Where each security in my pipeline has a ROC rank for each of the 5 below and add the cumulative score together. and compare it to the overall sector's ROC over N days.

Learning Python/coding/algo trading has been a struggle and I've barely scratched the surface since joining the site <1 year ago but I can't get away from it. Sometimes I have ideas above and beyond my current coding skills so thanks Quantopian for the free hobby/ addiction!! lol I hope I can break the Top 10 soon :)

If anyone wants to expand upon this idea feel free to clone and share back what you've done, your knowledge and feedback is always appreciated

  1. bullish_intensity
  2. bearish_intensity
  3. bull_scored_messages
  4. bear_scored_messages
  5. total_scanned_message