For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 1 0 0

c1 futures historical underlying contract and expiry

Want to get timeseries with the underlying contract RIC for a continuous future, for example CLc1, for each given date in my specified period. Ideally want this for CLc1-CLc2 or equivalent in other future. End goal is to get timeseries with roll contract close, volume as well as volume as OI for each of the two underlying futures legs for each give date for at least 5 years back.

For example tried df,err= ek.get_data("CLc1", ["EXPIR_DATE.date", "EXPIR_DATE"], {'SDate':'2019-05-01', 'EDate':'2019-05-30'}) to get timeseries for CLc1 expiry date but not working.

Alternative to full timeseries would be to specify date, not just default on current.

All in Eikon API for Python.

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpythonfutures
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

1 Answer

Upvotes
Accepted
18k 21 12 20

I am not a content expert, so I am not sure if this is the information you are looking for.

I think you can retrieve futures RIC codes from this:

df,e = ek.get_data('0#CL:','LINK_1')
rics = df['Instrument'].tolist()
rics


Which gives you a list of 128 RIC codes.

['CLN0', 'CLQ0', 'CLU0', ...,  'CLZ30', 'CLF31', 'CLG31']


Then on each RIC, you can retrieve timeseries data:

This is an example using RIC code at index 0 from rics list(which is CLN0).



ahs.png (86.3 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea