Project for Data Incubator

Scrape data from StockTwits and see if any information can be used for predicting stock price trend.

sessionInfo()
## R version 3.1.2 (2014-10-31)
## Platform: x86_64-apple-darwin13.4.0 (64-bit)
## 
## locale:
## [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
## [1] quantmod_0.4-4 TTR_0.22-0     xts_0.9-7      zoo_1.7-12    
## [5] RJSONIO_1.3-0  RCurl_1.95-4.5 bitops_1.0-6  
## 
## loaded via a namespace (and not attached):
##  [1] digest_0.6.8    evaluate_0.5.5  formatR_1.1     grid_3.1.2     
##  [5] htmltools_0.2.6 knitr_1.9       lattice_0.20-30 rmarkdown_0.5.1
##  [9] stringr_0.6.2   tools_3.1.2
#Have stored client_id, client_secret and access token in .Rprofile

1. How can sum of extreme values reflect the change in price

We use stock_dir() to plot all the changes in price within a day at an interval of 5 minutes and meanwhile to select all extreme values (> 2sd from 0) from all the changes and calculate the sum.

stock_dir('WUBA',leg_pos = 'topright')

## [1] -0.02195645

‘WUBA’ had a 6% drop today (04-13-2015). We see that the empirical density curve is shifted left from the expected (m=0) normal density. In other words, the sum of extreme values carries information about the direction of the trend of a given stock. This leads to the following analyses.