Upgrade from Eikon -> Workspace. Learn about programming differences.

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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 1 1 1

Pull All Expired Contracts

Is there a way to pull all expired contracts for a commodity? The same process is fairly straightforward for active contracts, but I haven't been able to find a simple method for expired contracts. If none exist, is there a means of pulling expiry dates for all active contracts?

eikoneikon-data-apipythonrefinitiv-dataplatform-eikonworkspaceworkspace-data-apiapicommoditiesexpired-contract
icon clock
10 |1500

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

@munz32

Thank you for your participation in the forum.


Is the reply below satisfactory in resolving your query?

If yes, please click the 'Accept' text next to the appropriate reply.


This will guide all community members who have a similar question.

Otherwise please post again offering further insight into your question.


Thanks,

AHS

@munz32

Hi,

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.

Thanks,

AHS

1 Answer

· Write an Answer
Upvotes
Accepted
39.4k 77 11 27

Here's an example retrieving all expired CBOT corn futures. The result set contains one incorrect item (CH8). All expired future RICs contain carat symbol (^). You can filter out incorrect item that doesn't contain carat in the RIC name from the result set returned from the search.

rdp.search(
    view = rdp.SearchViews.CommodityQuotes,
    filter = ("ExchangeCode eq 'CBT' and AssetCategory eq 'CMF' and " +
              "PrimaryChainRIC eq '0#C:' and ExpiryDate lt 2021-02-05"),
    select = "RIC,ExpiryDate",
    top  = 1000)

For more info on using RDP Library to perform various types of searches see the article titled "Building Search into your Application Workflow".

icon clock
10 |1500

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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