Generating order signals

In the trading strategy that we will define, we want to be able to decide whether there is enough movement in the volume of searches on debt to go and execute a trade in the market that will make us a profit. The paper defines this threshold as though there is a higher search volume at the end of a Google Trends week than in the previous three-week average of the search volume, and then we will go short. If there is a decline, we will go long the following week.

The first thing we will need to do is reorganize our data by moving the GoogleWE dates into the index. We are going to make our decisions based upon these week-ending dates and use the Close price in an associated record as the basis for our trade as that price ...

Get Mastering pandas for Finance now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.