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).

 

 

excel1

 

 

In order to use the above data in Build Alpha 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 yyyymmdd, removed the headers, and saved it as a .csv file. Pictured below…

 

 

excel2

 

 

I then copy and pasted our dates and custom Open Interest data to a new excel sheet. This time instead of having date, open, high, low, close, 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.

 

 

excel3

 

 

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.

 

 

importdata
dataimports

 

 

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 tested across Nasdaq, Dow Jones, and Russell futures**

**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.

Cheers,

Dave

Old Posts:

Thanks for reading,
Dave


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!

    KB

    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!
      David

Leave a Reply

Your email address will not be published. Required fields are marked *

Login


Username
Password
(close)

Create an Account!


Username
Email
Password
Confirm Password
Want to Login? (close)

forgot password?


Username or Email
(close)

Risk Disclosure

FUTURES AND FOREX TRADING CONTAINS SUBSTANTIAL RISK AND IS NOT FOR EVERY INVESTOR. AN INVESTOR COULD POTENTIALLY LOSE ALL OR MORE THAN THE INITIAL INVESTMENT. RISK CAPITAL IS MONEY THAT CAN BE LOST WITHOUT JEOPARDIZING ONES FINANCIAL SECURITY OR LIFE STYLE. ONLY RISK CAPITAL SHOULD BE USED FOR TRADING AND ONLY THOSE WITH SUFFICIENT RISK CAPITAL SHOULD CONSIDER TRADING. PAST PERFORMANCE IS NOT NECESSARILY INDICATIVE OF FUTURE RESULTS.

Hypothetical Performance Disclaimer

HYPOTHETICAL PERFORMANCE RESULTS HAVE MANY INHERENT LIMITATIONS, SOME OF WHICH ARE DESCRIBED BELOW. NO REPRESENTATION IS BEING MADE THAT ANY ACCOUNT WILL OR IS LIKELY TO ACHIEVE PROFITS OR LOSSES SIMILAR TO THOSE SHOWN; IN FACT, THERE ARE FREQUENTLY SHARP DIFFERENCES BETWEEN HYPOTHETICAL PERFORMANCE RESULTS AND THE ACTUAL RESULTS SUBSEQUENTLY ACHIEVED BY ANY PARTICULAR TRADING PROGRAM. ONE OF THE LIMITATIONS OF HYPOTHETICAL PERFORMANCE RESULTS IS THAT THEY ARE GENERALLY PREPARED WITH THE BENEFIT OF HINDSIGHT. IN ADDITION, HYPOTHETICAL TRADING DOES NOT INVOLVE FINANCIAL RISK, AND NO HYPOTHETICAL TRADING RECORD CAN COMPLETELY ACCOUNT FOR THE IMPACT OF FINANCIAL RISK OF ACTUAL TRADING. FOR EXAMPLE, THE ABILITY TO WITHSTAND LOSSES OR TO ADHERE TO A PARTICULAR TRADING PROGRAM IN SPITE OF TRADING LOSSES ARE MATERIAL POINTS WHICH CAN ALSO ADVERSELY AFFECT ACTUAL TRADING RESULTS. THERE ARE NUMEROUS OTHER FACTORS RELATED TO THE MARKETS IN GENERAL OR TO THE IMPLEMENTATION OF ANY SPECIFIC TRADING PROGRAM WHICH CANNOT BE FULLY ACCOUNTED FOR IN THE PREPARATION OF HYPOTHETICAL PERFORMANCE RESULTS AND ALL WHICH CAN ADVERSELY AFFECT TRADING RESULTS.