Free Friday #18 – Building a Strategy with Open Interest

As always, happy Friday!

This week I was asked by a Build Alpha user if he could build strategies using a contract’s open interest. Open interest is just the total number of outstanding contracts that are held by market participants at the end of each day. So it is intuitive that as more contracts are opened or closed then it might be telling of how traders are positioning.

This is a detailed and advanced post. Build Alpha is all point and click, but this is certainly a way more advanced blog post showing how a more sophisticated user can utilize the software.

I have to admit this is not something I have looked at previously so I was quite intrigued but I pulled some open interest data from TradeStation and saved it.

I then went on to create columns I – M below. Columns I-L are momentum measures (N period change) of Open Interest. For example, column J holds the Open Interest change over the past 5 days. Column K holds the Open Interest change over the past 10 days. Column N just holds the 3 bar sum of the 1-period momentum of Open Interest. The data can be seen below opened in Excel (I know who uses Excel anymore).

In order to use the above data in BuildAlpha, we need to format two separate files. First, we need to create a date, open, high, low, close, volume file of the actual S&P500 futures data (columns A, C, D, E, F, G). I copy and pasted those columns to a new sheet and then reformatted the date to YYYY/MM/DD, removed the headers, and saved it as a .csv file. Pictured below…

I then copy and pasted our dates and custom Open Interest data to a new excel sheet. This time instead of having the date, open, high, low, close, the volume we’ll use (copy) the date, 1-period OI change, 5-period OI change, 10-period OI change, 20-period OI change, 3 bar sum of OI as our six columns.

We can now pass this data into Build Alpha and build strategies using the Intermarket capabilities. However, in this case, our intermarket or Market 2 will be this custom open interest data and not some other asset.

The two videos below show exactly how I did this process in case you didn’t follow my Thursday night, two glasses of scotch deep, blog writing.

There is a different strategy displayed in the video above, but I promised some guys on twitter I’d share the strategy I posted Thursday. So below is the actual Free Friday #18. It holds for one day and trades when these conditions are true:

  1. Momentum(OpenInterest,20)[0] <= Momentum(OpenInterest,20)[5]
  2. Momentum(OpenInterest,20)[0] > Momentum(OpenInterest,5)[1]
  3. Momentum(OpenInterest,10)[0] > Momentum(OpenInterest,10)[1]

**S&P500 Futures strategy built on open interest data only and tested across Nasdaq, Dow Jones, and Russell Futures. Results just based on 1 contract**

So the last rule in Build Alpha would appear as Low2[0] > Low2[1] or translated as the low of Market 2 is greater than the low of Market 2 one bar ago. However, if you remember we created a custom data series for Market 2 and in the low column, we inserted the 10-period momentum of open interest!

Like I said this is a confusing post, but a really neat idea of how creative you can be with this software. The possibility of things we can test are immense.

Furthermore, when Build Alpha calculates RSI or Hurst, for example, using the close price of Market 2 (our intermarket selected) it will actually calculate RSI or Hurst on 20 bar momentum of the Open Interest (what we passed in for the close column)! You can also use the custom indicator/rule builder on these custom data columns.

You can also run strategies built on custom data like this through all the robustness and validation tests as well.

All in all, thanks for reading. I thought this was a cool idea taking system development to a whole new level.



Old Posts:

Thanks for reading,

2 thoughts on “Free Friday #18 – Building a Strategy with Open Interest

  1. David,
    I’ve sourced multiple data providers and I don’t see how you are getting the prices you are for 1997 in ES.
    However, our open interest tie out for the days I can see in the video.
    Does TradeStation happen to adjust prices?
    Care to send the last year of data, I’m having trouble tying out this research.

    Thank you!


    1. Hey KB,

      Yeah, the data pulled from this example is from TradeStation (as seen in the video). TradeStation does adjust their continuous futures data. It sounds like that’s the hang up. Send me an email and I can send you the data used to create this post.

      Thanks for reading!

Leave a Reply

Your email address will not be published.