Trading Google Trends with logistic regression

Recently we have highlighted the value of using social data in your analysis of the market. Earlier we showed how you could have used Google Trends to price ZNGA after its IPO. We also showed how you can monitor risk with the Twitter stream. Today we will expand upon an example where we showed how VIX breakouts could be predicted using search volume for the term stock market. We exported the data from Google Trends using the gtrends class in Python.

The following graph shows the relationship between the current level of search volume and the probability of SPY having an up day. The graph visualizes a logistic regression between last week’s normalized search volume and a binary variable that takes the value of 1 if SPY had a non-negative daily return and 0 if the return was negative on the day. We used data from 2004 to now. The line represents the probability of having an up day given the level of search volume:
logisticWith the current value of 16, the level of search volume indicates a positive bias to the stock market. As the VIX drops below 17 it would seem that the market agrees, for now.

It is interesting to note that the probability of having an up day only crosses the 50% threshold after search volume rises approximately above 40. After that the probability drops quickly but that is offset by the increase in the confidence interval.

It would be interesting to expand this research in the future to incorporate the role of volume in trading, which we found to have a pronounced relationship with volatility.


Want to learn how to mine social data sources like Google Trends, StockTwits, Twitter, and Estimize? Make sure to download our new book Intro to Social Data for Traders by our very own Thomas Pendergrass


Enter your email address to follow this blog and receive notifications of new posts by email.


follow_st

7 replies »

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s