Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Predicting the Stock Market with Twitter

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.

Predicting the Stock Market with Twitter

Given at JavaScript North East, Monday 5th October 2013. http://jsnortheast.co.uk/

Avatar for JavaScript North East

JavaScript North East

October 10, 2013
Tweet

Other Decks in Technology

Transcript

  1. About this project •  Hacked together in a weekend • 

    Research paper by Tushar Rao & Saket Srivastava in Delhi, India •  Soon to be open sourced
  2. Theory •  Twitter sentiment reflects investor behavior on the stock

    market (EMH) •  Real-time thanks to the Streaming API •  Until recently, implementations have been pretty dumb
  3. Guts of the project •  Mine tweets for large technology

    stocks (MSFT, AMZN, AAPL, etc.) •  Calculate sentiment for each tweet, and create a trend •  Compare against historical closing price data for each company and find correlation
  4. Technology •  Node.js •  ntwitter – github:AvianFlu •  SentiMental –

    github:thinkroth •  Node Language Detect – github:FGRibreau •  Yahoo Finance API •  MySQL
  5. Scan.js •  Tracks an array of symbols on Twitter Streaming

    API using the $ hashtag •  Strips out any hyperlinks, retweets, copypasta & foreign tweets •  Stores the tweet with metadata in DB
  6. Finance.js •  Extract dataset from DB •  Run sentiment analysis

    on data collection •  Score each Tweet’s sentiment •  Pull CSV from Yahoo Finance and compare the two trend lines
  7. :-(

  8. Why? •  Scan.js crashed too often •  No dataset =

    no trends •  Later version with forever.js improved problem, but still no dice
  9. Improvements •  Try again with better technologies •  CouchDB (?)

    •  Understand node.js garbage collection •  Further down the line… •  Optimize sentiment tool for stock market language (bull, bear, dog, etc.) •  Write my own sentiment tool
  10. Call for help •  Going to open source it and

    try again •  Still a Javascript neophyte •  Any help would be appreciated •  Maybe we can all make some $$$