Gamestudio Links
Zorro Links
Newest Posts
Camera always moves upwards?
by clonman. 11/13/25 14:04
brokerCommand PLOT_HLINE parameters
by M_D. 11/13/25 10:42
ZorroGPT
by TipmyPip. 11/10/25 11:04
Training with the R bridge does not work
by frutza. 11/05/25 00:46
Zorro 2.70
by opm. 10/24/25 03:44
Alpaca Plugin v1.4.0
by TipmyPip. 10/20/25 18:04
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
2 registered members (TipmyPip, AndrewAMD), 21,112 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sheliepaley, Blueguy, blobplayintennis, someone2, NotEBspark
19177 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
download historical data of expired futures with IB #487083
01/12/23 13:09
01/12/23 13:09
Joined: Mar 2022
Posts: 21
Frankfurt am Main
B
BrainSailor Offline OP
Newbie
BrainSailor  Offline OP
Newbie
B

Joined: Mar 2022
Posts: 21
Frankfurt am Main
Hi,
I am currently downloading futures data with IB. This is working very well with existing (live) futures.

Is there any way of downloading a trade history for expired futures ? IB is offering historical futures data for the last two years (also from expired ones).

The function "assetHistory()" is not returning any historical data for expired futures.
Example of an Asset List:

Name,Price,Spread,RollLong,RollShort,PIP,PIPCost,MarginCost,Market,Multiplier,Commission,Symbol-2023,Centage,Desc
CL_23F,0,0,0,0,0.01,10,-30,0,1000,0,CLF3-FUT-202301-CL-NYMEX,0,Crude Oil
CL_23G,0,0,0,0,0.01,10,-30,0,1000,0,CLG3-FUT-202302-CL-NYMEX,0,Crude Oil
CL_23H,0,0,0,0,0.01,10,-30,0,1000,0,CLH3-FUT-202303-CL-NYMEX,0,Crude Oil

The download is working well for the CLG3 and CLH3 contract but is not returning any data for the CLF3.

Is there any brokerCommand for downloading historical data for expired contracts, or am I missing something?

The script I am using is very basic:

int Mode = 1;
brokerCommand(SET_PRICETYPE,2);

StartDate = EndDate = 2023;

assetList("AssetsIB_Futures");
for(listed_assets)
assetHistory(0,Mode);

Any help is highly appreciated!
BS

Re: download historical data of expired futures with IB [Re: BrainSailor] #487096
01/16/23 13:38
01/16/23 13:38
Joined: Mar 2022
Posts: 21
Frankfurt am Main
B
BrainSailor Offline OP
Newbie
BrainSailor  Offline OP
Newbie
B

Joined: Mar 2022
Posts: 21
Frankfurt am Main
Just a short follow up if somebody has the same question:

Read the manual again and you'll find the answer wink

FUTX and the expiiry including the expiration day did the trick!


Moderated by  Petra 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1