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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
7 1 0 1

request expired commodity futures with get_data

The chain ric 0#ATW: provides all futures that haven't expired yet, starting with ATWMJ0 which is still tradable.

I can't seem to find expired futures anywhere, e.g. for the previous month, it should be ATWMH0 but this ric doesn't seem to exist.

How to download e.g. a price history of settlements of already expired futures?

Thanks


eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpythonricsfuturesexpired-contract
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
3.8k 4 4 6

Hi @arndf

You need to modify your RIC a bit to get the expired RIC.
Assuming you wish to retrieve the March 2020 data, the RIC would begin as normal, (ATWMH0) RIC Root + Month Code + Last digit of year, then add a "^" followed by the decade of the Expiry of the contract --> ATWMH0^2.

df,err= ek.get_data('ATWMH0^2', ['TR.SETTLEMENTPRICE.date','TR.SETTLEMENTPRICE'], {'SDate':'-5M', 'EDate':'0D'})
df


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.

Thanks Marcin, very helpful. Is there a way to do that for continous chain rics as well, like ATWMc1 for the history?

Hi @arndf,

The continuous chains have all the RIC codes including expired ones.

Click below to post an Idea Post Idea