Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Image Source: http://www.ritholtz.com/blog/wp-content/uploads/2010/09/Hemline-1-.jpg
Image source: http://alliedow.wordpress.com/2009/11/17/dancing-in-your-nuddy-pants/
•
•
•
•
•
•
•
•
•
•
•
•
•
•

http://xkcd.com/55/
Can signal a change in trends
library(twitteR)
tweets <- searchTwitter("Stock Market", n=1500)
times <- sapply(tweets, function(x) format(x@created, "%b...
http://www.huffingtonpost.com/dan-mirvish/the-hathaway-effect-how-a_b_830041.html
library(RGoogleTrends)
library(quantmod)
ans = getGTrends("Anne Hathaway")
trend <- xts( ans$Week$anne.hathaway, order.by=...
•
•
•

•
•
•
Alternative Data Sources for Measuring Market Sentiment and Events (using R) - R/Finance 2011
Alternative Data Sources for Measuring Market Sentiment and Events (using R) - R/Finance 2011
Alternative Data Sources for Measuring Market Sentiment and Events (using R) - R/Finance 2011
Alternative Data Sources for Measuring Market Sentiment and Events (using R) - R/Finance 2011
Alternative Data Sources for Measuring Market Sentiment and Events (using R) - R/Finance 2011
Alternative Data Sources for Measuring Market Sentiment and Events (using R) - R/Finance 2011
Alternative Data Sources for Measuring Market Sentiment and Events (using R) - R/Finance 2011
Alternative Data Sources for Measuring Market Sentiment and Events (using R) - R/Finance 2011
Alternative Data Sources for Measuring Market Sentiment and Events (using R) - R/Finance 2011
Alternative Data Sources for Measuring Market Sentiment and Events (using R) - R/Finance 2011
Alternative Data Sources for Measuring Market Sentiment and Events (using R) - R/Finance 2011
Alternative Data Sources for Measuring Market Sentiment and Events (using R) - R/Finance 2011
Alternative Data Sources for Measuring Market Sentiment and Events (using R) - R/Finance 2011
Alternative Data Sources for Measuring Market Sentiment and Events (using R) - R/Finance 2011
Upcoming SlideShare
Loading in …5
×

Alternative Data Sources for Measuring Market Sentiment and Events (using R) - R/Finance 2011

328 views

Published on

An introduction to emerging alternative data sources available to investors which are increasingly easy to access using R and it's many community-contributed packages.

Presented to the R/Finance conference in Chicago in 2011
http://www.rinfinance.com/RinFinance2011/agenda/

  • Be the first to comment

Alternative Data Sources for Measuring Market Sentiment and Events (using R) - R/Finance 2011

  1. 1. Image Source: http://www.ritholtz.com/blog/wp-content/uploads/2010/09/Hemline-1-.jpg
  2. 2. Image source: http://alliedow.wordpress.com/2009/11/17/dancing-in-your-nuddy-pants/
  3. 3. • • • •
  4. 4. • • • • • • •
  5. 5. • • • http://xkcd.com/55/
  6. 6. Can signal a change in trends
  7. 7. library(twitteR) tweets <- searchTwitter("Stock Market", n=1500) times <- sapply(tweets, function(x) format(x@created, "%b %d %H:00")) users <- sapply(tweets, function(x) x@screenName) times <- times[!duplicated(users)] # removing duplicate users to avoid spammers and news counts <- table(times) bp <- barplot(counts, main="Counts of 'Stock Market' Tweets by Hour", col="lightblue", border=NA, ylim=c(0,200)) lines(spline(counts ~ bp), lwd=3, lty="dashed", col="darkblue")
  8. 8. http://www.huffingtonpost.com/dan-mirvish/the-hathaway-effect-how-a_b_830041.html
  9. 9. library(RGoogleTrends) library(quantmod) ans = getGTrends("Anne Hathaway") trend <- xts( ans$Week$anne.hathaway, order.by=as.Date(ans$Week$Week, "%b %d %Y")) brk <- getSymbols("BRK-A", auto.assign=F, from = "2004-01-01" ) x <- na.locf(merge(trend, Cl(brk)))[index(trend)] #plot returns and search volume par(mfrow=c(2,1)) plot(x$trend, main="Google Trends: Anne Hathaway", col="blue") plot(x$BRK.A.Close, main="Berkshire Hathaway Share Price", col="red", cex=.7) #evaluate returns by search volume x$Return <- Delt(x$BRK.A.Close) breaks <- cut(x$trend, seq(0,10, 1)) boxplot(as.numeric(x$Return) ~ breaks, ylab="Weekly Return", xlab="Search Volume", col="lightblue", border="darkblue" ) abline(h=0, col="blue")
  10. 10. • • • • • •

×