Back

Using Google Trends to Predict Markets

I am a newbie here and came across an interesting article on using Google trends (

https://seekingalpha.com/article/4202781-timing-market-google-trends-search-volume-data

) and wondered if I could replicate the results. I wasn't able to exactly replicate them, but the results still look pretty good. 

Update Backtest








Actually, this would be the accurate backtest. 

1


Super Interesting! Thanks for sharing!

0

Really cool! We should try and make this one a LEAN custom data type to avoid any potential look-ahead bias. If the API is fairly robust we can make it available to the whole community with one line of code:

AddData<GoogleTrends>("SearchFilter");
3

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


That would be amazing!

0

Interesting to see this! I wrote a paper on this many years ago actually: https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2502508

 

I think having Google Trends data would be interesting on the QC side.

0

I remember looking into this a while back and noticed the Google trends data has a look ahead bias. If I remember correctly, the numbers are % of popularity. So if suddenly a topic becomes way more popular than in the past, previous values will change to reflect this new popularity. Backtesting this data, the %'s might have been different at the actual time of the hypothetical trades.

So for example, bitcoin became very popular in 2017, like the picture below. However, if we were back in 2012, those little spikes would have been the 100% mark at the time.

1

Post above is true but irrelevant -- interesting & out of the box. Thanks for the share OP

0

Tocht I would say it is quite relevant. Let's say you're building an interface to access this Google Trend data - not only would you need to pass a parameter for the date range of the data (i.e. get me data for Nov 1 2012) but you would also need a second parameter to specify the "simulated date of access".

Looking at the graph above, if you got Nov 2012 data as of today, it would be around 5-10. However, if you got the Nov 2012 data as of, say, Dec 2012, then it would probably be in the ~100 range.

This means thought needs to be put into how to design the data interface. You might be able to get away with simply scaling the data up by the maximum value attained prior to "simulated date of access" - but if Google's scaling is more complex, you may need to somehow store a copy of the data for each "simulated date of access".

1

Exactly. I don't know if the scaling is just (current value) / (max historical value) or something more complex. And I don't think they give you the raw values.

Another thing to be mindful of are the actual search terms used. For example now we all know bitcoin was super popular in 2017, but if we were to start trading a strategy with bitcoin as a keyword in 2010, we wouldn't know bitcoin would be popular. So a systematic way of choosing keywords needs to be implemented. 

In the example above, would we have known to use the word debt prior to the GFC?

0

Update Backtest





0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Loading...

This discussion is closed