开云体育

ctrl + shift + ? for shortcuts
© 2025 开云体育

How are built the Continuous future data retrieved with secType = CONTFUT ?


 

I submit the question to IB assistance 2 months ago, but no answer received until today.
So I ask the group:
As wrote in the subject:
How are built the Continuous future data retrieved with secType = CONTFUT ?
The data are a simple concatenation of the data from the different contracts?
Or are the data from previous contracts rescaled avoiding gaps?
How is the rollover date chosen? By volume change or expiry date or anything else?
I did not find any info about on the web.
Anyone know the method used by IB to build the Continuous version of futures?


 

To create a continuous future, you must apply the back adjustment method with the various futures contracts that you downloaded.
The most recent future is used to calculate a coefficient that is used to adjust (going back) the closest expired future, etc.
Here is an explanation:
?
[Edited by Moderator: this link shows one way to calculate continuous future data: it may not be the way IBKR does it.]


 

As the Moderator noticed, the link shows just one way to create a continuous version of a futures,
but I want to know what method used by TWS.
?
So the question is still opened, waiting for the answer.
Thank you anyway.


 

I seriously hope what you really wanted to say is "So the question is still opened, waiting for the answer from IBKR support." Otherwise it would sound like you feel entitled to an immediate answer from our group when IBKR has not responded in two months..

The welcome message you received when you signed up (and our home page at /g/twsapi) asks you to "Tell us what you have already tried, what worked, and what did not". Now you told us that you asked IBKR a couple of month ago, but what else have you done, and what did you find?

You can get a pretty precise answer for your question within a few minutes yourself:
  • Simply grab historical data for the roll month of the future you are interested in. Say June 2024 for NQ on CME.
  • Get June 2024 data for NQU4@FUT, NQM4@FUT, and NQ@CONTFUT
  • Compare the prices you get around 2024-06-21, the expiration date for NQM4.

I assume you are looking for Historical Bar Data from reqHistoricalData. In that case, check whether the results are different when you request TRADES or ADJUSTED_LAST data.

Let us know what you find. I would hope (but don't know) that reqHistoricalData(TRADES) is a simple concatenation of unmodified data.

闯ü谤驳别苍
?
?
On Fri, Sep 13, 2024 at 10:20 AM, <luca.chiaravalloti@...> wrote:

...
So the question is still opened, waiting for the answer.
....


 

Yes, you're right, I can try to deduce how the continuous is built, but I think it's very strange that IB doesn't state anywhere how it is officially constructed, and since it's an important aspect, I assume someone asked IB about it earlier, and so I asked here. We can infer, but IB official answer is its official answer.


 

TL;DR Volume-based ratio adjustment
?
TWS shows the adjustment on the Chart. For example, let's take CME Crude Oil (CL). On 14 Aug there is a small marker "RA 101.63%" being shown on the TWS chart with CL CONTFUT. I guess RA = Ratio Adjustment. This is shown if you enable "Cash Dividend Indicator" in chart settings. Basically I think they simplified it and handle it exactly like for dividends - not that it makes it more clear as they also do not explain how it's calculated for dividends either. Coincidentally 14 Aug was the volume rollover day.


 

Thanks for your observation, if I investigate on my own I will publish the results. In any case, any other contribution is welcome.


 

Did you conduct any investigation of your own, and if yes, did you find anything new? Just out of curiosity.


 

After a loto of time, IB added an explanation on this topic on the online guide, the link is:
?
?
Read the section:
?

Generate Normalized Historical Data Series for Continuous Futures

?
But this explanation has been added following my question to the assitance
?
I hope it will be useful to many.


 

A watchout with ratio adjustments (RA):
- useful when calculating % returns, roll yields or other multiplicative measures
- resulting in different signals when running the same ATS on it again (backtesting results will differ)
?
For completeness, one can calculate rollover also like this:
- by date no adjustment
- by volume (front < back) no adjustment
- by date backadjusted BA (front settlement - back settlement)
- by volume backadjusted BA (front settlement - back settlement)
?
The BA data (not available on TWS) is suitable for additive measures (net profit, draw down) and remains stable for backtesting (up to a constant offset). The ratio data is suitable only for multiplicative measures (returns, standard deviation of returns, TWRR/CAGR, etc.) - you cannot add profit from trade A in $ with profit from trade B a few months ago. Also, obviously one cannot have a buy on one side of an RA and the corresponding sale on the other side (this is true for BA also).