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:
- Momentum(OpenInterest,20) <= Momentum(OpenInterest,20)
- Momentum(OpenInterest,20) > Momentum(OpenInterest,5)
- Momentum(OpenInterest,10) > Momentum(OpenInterest,10)
**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 > Low2 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.
- Free Friday #17 – Would You Trade This?
- Free Friday #16 – Market Regime Switching
- Free Friday #15 – Download Data with Python
- Free Friday March 2017 Update
- Free Friday 14 and 14a – MultiMarket Portfolio
- Noise Test – Explained
- Free Friday 12 – Noise Test
- Free Friday February 2017 Update
- What is E-Ratio
- Free Friday 11 – Free Friday 11 – Sample Size
- Free Friday 10 – Sizing with Monte Carlo
- Free Friday 9 – Intermarket Signals
- Free Friday January 2017 Update
- Free Friday 8 – Randomized Monte Carlo
Thanks for reading,