Hi,
I would like to pull a futures chain, including expired contracts (say 0#C) and current contracts. And get the prices. Is there a simple way to do this that pulls them in a single dataframe once you have the list of contracts?
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
Hi,
I would like to pull a futures chain, including expired contracts (say 0#C) and current contracts. And get the prices. Is there a simple way to do this that pulls them in a single dataframe once you have the list of contracts?
hi @Shadeun ,
Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?
If so please can you click the 'Accept' text next to the appropriate reply? This will guide all community members who have a similar question.
Thanks,
AHS
Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.
Thanks,
AHS
Hi @Shadeun,
The Search API is what you're after. How many are you expecting to retrieve in one call? are we talking 1k or 100 million rows?
Would be a lot, perhaps 1k rows per contract and 100 contracts historically, so 100k 'cells'. But not an unrealistically large number of datapoints i think.
So you are suggesting i use the search function to find the contracts and then pull via ek.get_data?
Yes, I'd suggest that, although you don't have to use ek.get_data, you can keep with rd, which also has a get data function. you can find more details here (as well as many examples in CodeBook).
the search limits itself to 10k rows; for more, I'd advise bulking your search (e.g.: by maturity). There is a way to do just this as shown here and explained in the 'Building Search into your Application Workflow' article.
When it comes to expired instruments, I'd suggest reading this great article too.
Thanks i was hoping something that merged Pull All Expired Contracts - Forum | Refinitiv Developer Community and an active one.
I cannot seem to get the code in the link to work however. i assume rdp is always
import refinitiv.dataplatform as rdp
yeah?
Hi @Shadeun ,
Is this what you're looking for?
df, err = ek.get_data('0#C:',['TRDPRC_1','OPINT_1','EXPIR_DATE']) df
where
To find the field name to be used, Data Item Browser (DIB) in Refinitiv Workspace/Eikon Desktop can be used, here's the video regarding DIB tutorial.
Hope this helps and please let me know in case there is any further question