Skip to main content

Twitter Sentiment Analysis: How to Hedge Your Bets in the Stock Markets

  • Chapter
  • First Online:
State of the Art Applications of Social Network Analysis

Part of the book series: Lecture Notes in Social Networks ((LNSN))

Abstract

Emerging interest of trading companies and hedge funds in mining social web has created new avenues for intelligent systems that make use of public opinion in driving investment decisions. It is well accepted that at high frequency trading, investors are tracking memes rising up in microblogging forums to count for the public behavior as an important feature while making short term investment decisions. We investigate the complex relationship between tweet board literature (like bullishness, volume, agreement etc) with the financial market instruments (like volatility, trading volume and stock prices). We have analyzed Twitter sentiments for more than 4 million tweets between June 2010 and July 2011 for DJIA, NASDAQ-100 and 11 other big cap technological stocks. Our results show high correlation (upto 0.88 for returns) between stock prices and twitter sentiments. Further, using Granger’s Causality Analysis, we have validated that the movement of stock prices and indices are greatly affected in the short term by Twitter discussions. Finally, we have implemented Expert Model Mining System (EMMS) to demonstrate that our forecasted returns give a high value of R-square (0.952) with low Maximum Absolute Percentage Error (MaxAPE) of 1.76 % for Dow Jones Industrial Average (DJIA). We introduce and validate performance of market monitoring elements derived from public mood that can be exploited to retain a portfolio within limited risk state during typical market conditions.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD 54.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    http://stocktwits.com/

  2. 2.

    http://www.hedgechatter.com/

  3. 3.

    Twitter API is easily accessible through an easy documentation available at—https://dev.twitter.com/docs Also Gnip—http://gnip.com/twitter, the premium platform available for purchasing public firehose of tweets has many investors as financial customers researching in the area.

  4. 4.

    http://techcrunch.com/2011/10/17/twitter-is-at-250-million-tweets-per-day/

  5. 5.

    https://sites.google.com/site/twittersentimenthelp/

  6. 6.

    http://finance.yahoo.com/

  7. 7.

    lag at k for any parameter M at \(x_{t}\) week is the value of the parameter prior to \(x_{t-k}\) week. For example, value of returns for the month of April, at the lag of one month will be \(return_{april-1}\) which will be \(return_{march}.\)

  8. 8.

    The reason behind purchase of long put options at different time intervals is because in a fully hedged portfolio, profit arrow has lower slope as compared to partially hedged portfolio (refer P/L graph). Thus the trade off between risk and security has to be carefully played keeping in mind the precise market conditions.

References

  1. Acemoglu D, Ozdaglar A, ParandehGheibi A (2010) Spread of (mis)information in social networks. Games Econ Behav 70(2):194–227

    MATH  MathSciNet  Google Scholar 

  2. Asur S, Huberman BA (2010) Predicting the future with social media. Computing 25(1):492499

    Google Scholar 

  3. Bagnoli M, Beneish Messod D, Watts Susan G (1999) Whisper forecasts of quarterly earnings per share. J Account Econ 28(1):27–50

    Google Scholar 

  4. BBC News (2011) Twitter predicts future of stocks, 2011. This is an electronic document. Date of publication: 6 Apr 2011. Date retrieved: 21 Oct 2011. Date last modified: [Date unavailable].

    Google Scholar 

  5. Bollen J, Mao H, Zeng X (2011), Twitter mood predicts the stock market. Computer 1010(3003v1):1–8.

    Google Scholar 

  6. Boyd DM, Ellison NB (2007) Social network sites: definition, history, and scholarship. J Comput-Mediated Commun 13(1):210–230

    Google Scholar 

  7. Brown JS, Duguid P (2002) The social life of information. Harvard Business School Press, Boston

    Google Scholar 

  8. Da Z, Engelberg J, Gao P (2010) In search of attention. J Bertrand Russell Arch (919).

    Google Scholar 

  9. Das SR, Chen MY (2001) Yahoo! for Amazon: sentiment parsing from small talk on the Web. SSRN eLibrary.

    Google Scholar 

  10. Dewally M (2003) Internet investment advice: investing with a rock of salt. Financ Anal J 59(4):65–77

    Google Scholar 

  11. Doan S, Vo BKH (2011) Collier N (2011) An analysis of Twitter messages in the 2011 Tohoku earthquake. ArXiv e-prints, Sept

    Google Scholar 

  12. Frank MZ, Antweiler W (2001) Is all that talk just noise?. The information content of internet stock message boards, SSRN eLibrary

    Google Scholar 

  13. Garman MB, Klass MJ (1980) On the estimation of security price volatilities from historical data. J Bus 53(1):67–78

    Google Scholar 

  14. Gilbert E, Karahalios K (2010) Widespread worry and the stock market. Artif Intell:58–65.

    Google Scholar 

  15. Go A, Bhayani R, Huang L (2009) Twitter sentiment classification using distant supervision.

    Google Scholar 

  16. Guresen E, Kayakutlu G, Daim TU (2011) Using artificial neural network models in stock market index prediction. Expert Syst Appl 38(8):10389–10397

    Google Scholar 

  17. Lee KH, Jo GS (1999) Expert system for predicting stock market timing using a candlestick chart. Expert Syst Appl 16(4):357–364

    Google Scholar 

  18. Lerman A (2011) Individual investors’ attention to accounting information: message board discussions. SSRN eLibrary.

    Google Scholar 

  19. Malkiel BG (2003) The efficient market hypothesis and its critics. J Econ Perspect 17(1):59–82

    Google Scholar 

  20. Mao H, Counts S, Bollen J (2011) Predicting financial markets: comparing survey, news, twitter and search engine data. Quantitative finance papers 1112.1051, arXiv.org, Dec 2011.

    Google Scholar 

  21. McIntyre D (2009) Turning wall street on its head, 2009. This is an electronic document. Date of publication: 29 May 2009. Date retrieved: 24 Sept 2011. Date last modified: [Date unavailable].

    Google Scholar 

  22. Miao H, Ramchander S, Zumwalt JK (2011) Information driven price jumps and trading strategy: evidence from stock index futures. SSRN eLibrary.

    Google Scholar 

  23. Qian B, Rasheed K (2007) Stock market prediction with multiple classifiers. Appl Intell 26:25–33

    Google Scholar 

  24. Qiu L, Rui H, Liangfei, Whinston A (2011) A twitter-based prediction market: social network approach. In: ICIS Proceedings. Paper 5.

    Google Scholar 

  25. Rao T, Srivastava S (2012) Analyzing stock market movements using twitter sentiment analysis. Proceedings of the 2012 international conference on advances in social networks analysis and mining (ASONAM 2012), ASONAM ’12. DC, USA, IEEE Computer Society, Washington, pp 119–123

    Google Scholar 

  26. Sprenger TO, Welpe IM (2010) Tweets and trades: the information content of stock microblogs. SSRN eLibrary.

    Google Scholar 

  27. Szomszor M, Kostkova P, De Quincey E (2009) swineflu : Twitter predicts swine flu outbreak in 2009. 3rd international ICST conference on electronic healthcare for the 21st century eHealth, Dec 2009.

    Google Scholar 

  28. The Atlantic (2011) Does anne hathaway news drive berkshire hathaway’s stock? This is an electronic document. Date of publication: 18 Mar 2011. Date retrieved: 12 Oct 2011. Date last modified: [Date unavailable].

    Google Scholar 

  29. Tumasjan A, Sprenger TO, Sandner PG, Welpe IM (2010) Predicting elections with twitter: what 140 characters reveal about political sentiment. In: International AAAI conference on Weblogs and social media, Washington DC, pp 178–185.

    Google Scholar 

  30. Wysocki P (1998) Cheap talk on the web: the determinants of postings on stock message boards. Working paper.

    Google Scholar 

  31. Zeledon M (2009) Stocktwits may change how you trade. This is an electronic document. Date of publication: 2009. Date retrieved: 01 Sept 2011. Date last modified: Date unavailable.

    Google Scholar 

  32. Zhang X, Fuehres H, Gloor PA (2009) Predicting stock market indicators through twitter i hope it is not as bad as i fear. Anxiety, pp 1–8

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Tushar Rao .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2014 Springer International Publishing Switzerland

About this chapter

Cite this chapter

Rao, T., Srivastava, S. (2014). Twitter Sentiment Analysis: How to Hedge Your Bets in the Stock Markets. In: Can, F., Özyer, T., Polat, F. (eds) State of the Art Applications of Social Network Analysis. Lecture Notes in Social Networks. Springer, Cham. https://doi.org/10.1007/978-3-319-05912-9_11

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-05912-9_11

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-05911-2

  • Online ISBN: 978-3-319-05912-9

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics