Hello, I have a doubt that I have been thinking about for a while.
I know that if I want to backtest a strategy on futures contract I have to adjust the rollover spread between contacts by "stitching" them together (sometimes called panama adjustment, if I am not wrong), in order to get a continous contract.
But let's say I want to trade the Gasoline / Brent spread, or the gold / silver spread. So, I want a time series that represents the backadjusted spread netween the two legs (the difference or the ratio, it does not matter).
How should I proceed? Should I simply first backadjust the two legs separately and take difference (or the ratio), obviously correctly calibrated (in the case of gasoline/brent I would multiply gasoline by 42 or something, it depend on the case).
Or should I do something else? Do you have an example of the backadjusted gasoline/brent spread to double check?
thank you very much
The following user says Thank You to atmaweapon for this post:
Typical backadjusted continuous futures contracts work well with price DIFFERENCES, but will give incorrect results for RATIO calculations (incorrect in that the ratio for a date late year will change at the next rollover. This sometimes leads to signals that were not present at the original creation date). This is regardless of it is a single instrument or a combination/ratio of many instruments.
So, if you are doing a ratio, I would use the unadjusted continuous contract. Problem with crude is it rolls earlier than heating oil or unleaded gas, so you will have to adjust for that.
What you actually trade should be backadjusted data, to make sure your strategy does not improperly take advantage of rollover gaps.
I would recommend examining the data by hand and seeing what works for your need before any heavy testing.
The following 3 users say Thank You to kevinkdog for this post:
Normally Houston TX but in Ecuador/Galapogos today
Experience: Advanced
Platform: TT and Stellar
Broker: Primary Advantage Futures. Also ED&F and Tradestation
Trading: Primarily Energy but also a little Equities, Fixed Income, Metals and Crypto.
Posts: 4,816 since Dec 2013
Thanks: 4,133 given,
9,724
received
As somebody who almost only trades spreads (and even spreads of spreads) this is something I have given some thought to, but not come up with a good answer. As already diagnosed the big issue is how to adjust for rollovers. For something like ES/NQ (S&P500/Nasdaq) or ZB/ZN (30 yr vs 10 yr Treasury) this probably isn't as a big an issue as it is for Gasoline/Brent (RB/BZ).
In the case of ES/NQ the rollover only occurs once every 3 months, it occurs on the same day for both contracts, and the rollover premium/discount will be highly correlated since both are really just dividends minus cost of carry. Hence as @kevinkdog said using the unadjusted continuous contract probably works.
Gasoline/WTI though is the opposite. Both roll every month. Crude rolls around the 20th and Gasoline rolls at month end. Also the rollover premium/discount will be highly UNcorrelated. Crude is a non-seasonal contract based upon delivery in the Midwest US. Gasoline is very seasonal contract based upon delivery in NY Harbor. So you have product differences (supply/demand), locational differences (Midwest vs NYH) and seasonal differences. Gasoline/Brent has the advantage that the contracts roll at the same time, but Brent is North Sea Crude benchmark and probably even more fundamentally different than WTI when compared to Gasoline. NOTE: The seasonality is a big issue here. If you just use the unadjusted continuous contract it will look like you should go long this spread every spring and short it every fall. In reality that is mostly a factor of the seasonality/rollovers and not actual price changes. Similar issues with Gold (which trades GJMQVZ) vs Silver (which trades FHKNUZ). Now imagine that you want to spread between a basket of energies (say Gasoline, Heating Oil & Brent) vs a basket of Metals (say Gold, Silver and Copper).
Additionally not only is the ES/NQ (and ZB/ZN) spread a lot easier to model but there is a whole world of people, managing billions of dollars looking at the ES/NQ spread, so finding and edge in there may be difficult. On the other hand there's very few people looking at a basket of Energies vs a basket of Metals so I think the chance of finding something there is higher.
Sorry I didn't add much to this thread! Very interested in it though and would love to promote additional discussion. Unfortunately not many around here interested in this subject and hence not sure who else on futures.io might find this interesting. Maybe @Hulk ?
NOTE: You can use back-adjusted contracts if your momentum trading, ie picking/buying the contract with the most positive momentum, and selling the contract with the most negative momentum, but don't believe that was what the OP was asking.
The following 4 users say Thank You to SMCJB for this post:
Gasoline/Brent is an exchanged traded spread. You can get the spread data without having to do any calculations. The NYMEX symbol is RBBZ and ICE Europe its UHUBRN. Unlike futures that have contract specs, quotes etc listed on the exchange website, these crack spreads do not have a dedicated page so its hard to find information but rest assured, they exist and are traded just like the more popular WTI crack spreads.
Spreads listing from TT
Charts of the Mar spreads
For many reasons, you may still want to build your own synthetic spread by using the legs. Brent expires a month before RB for the same contract month so you have a choice as to which months you want to use and when. In this case, I would first convert RB to Crude terms by multiplying RB by 42 as you said. Then you can choose when you want to roll the legs, then "stitch" individual legs and then apply the difference to create the spread time series. The important thing here is to roll both legs on the same date. I would test each one of the following roll strategies and see which one works best for you.
Potential roll strategies:
Roll when Brent expires and use the same contract month: In this case, today, you would be using the March contract for both legs. On the last day of January, when Mar brent expires, you would roll both legs to April.
Roll when RB expires and use the front months: In this case, today, you would use the Feb RB vs the Mar Brent contract. On the last day of Jan, you roll RB to Mar and Brent to Apr
Roll when WTI expires: Depending upon what you are looking for, this is also a valid roll strategy. Liquidity in RB and HO futures is correlated with the WTI front month more than anything. In this case, today, you would be using the March contract for both RB and BZ because the front month for WTI is March. When March WTI expires on 02/21/23, you would roll both RB and brent to April.
Typically, you want to roll 3 days before expiry (when options expire) because thats when liquidity generally rolls over to the next month.
Let me know if there are any questions.
The following user says Thank You to Hulk for this post:
Thank you very much.
In fact, by looking at the unadjusted RB/BZ spread I could notice some appealing seasonality, but once you backajuast it, it goes away...:-( (also, the backadjusted spread has a strong upward trend)
Thank you, I was aware about the pre-packaged spread contracts, however some broker do not provide them (or I want to create other custum synthetic spreads).
I had never though about this, could you please explain me why this is important?
It is important to roll on the same date because thats how you would roll your position if you are in a trade. For instance If you are long 1 March RBBZ contract today and you want to keep your length when the Mar contract expires on 01/31, you would sell 1 Mar RBBZ and buy 1 Apr RBBZ, preferably at the same time to prevent any execution loss. When you are backtesting on continuous contract data and your position spans a roll, this is what you would do to actually roll your position. If you are using different dates to roll each leg, how would you actually execute to roll that position? Think about it.
Normally Houston TX but in Ecuador/Galapogos today
Experience: Advanced
Platform: TT and Stellar
Broker: Primary Advantage Futures. Also ED&F and Tradestation
Trading: Primarily Energy but also a little Equities, Fixed Income, Metals and Crypto.
Posts: 4,816 since Dec 2013
Thanks: 4,133 given,
9,724
received
The CME Globex Product Reference Sheet available on the CME Website on this page is very useful. It actually lists every spread type available, but unfortunately even that is difficult to read. A lot of the products listed only trade "over the counter" and not on Globex. For example the Gasoline/Brent Futures spread is line 289 of the spreadsheet. Other liquid energy futures spreads that aren't highly visible unless you know they are there are Brent-WTI, Brent-Heating Oil, Brent-Gasoil (on ICE), WTI-Heating Oil, WTI-Gasoline, Heating Oil-Gasoline, Heating Oil-Gasoil (on ICE). I thought CME also had 2:1:1 cracks (2 WTI vs 1 Heating Oil & 1 Gasoline) as well but I don't seem to be able to find them on that sheet. There's also a bunch of spreads to Oman and Dubai crude but these don't trade on screen much, if at all. Don't think Metals have any similar spreads, and they only ags spread I know of is SOM which is the Implied Soybean Crush. The problem is software like Tradestation won't let you trade these products!
Note: When we say Gasoline in this thread, I believe we actually mean the NYMEX RB contract which is actually a Reformulated Blendstock for Oxygenate Blending contract. RBOB while the a major component of Oxygenated Gasoline is not actually a finished gasoline product itself.
The following 2 users say Thank You to SMCJB for this post: