Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • Eikon Data APIs /

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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

avatar image
Question by zhangjin · Mar 28 at 11:03 AM · pythonfuturesexpired-contract

Retrieve Futures Contract Names at a point-in-time

Hi there, is there a way to retrieve contract names of a futures product available on a date in the past using Eikon Python API? For example, crude oil on March 1, 2002 there were CLH02,CLJ02,CLK02,....CLZ04... etc on exchanges. Would the API get these names? Need to get these names first and then to check historical info like close prices, first notice date of these contracts, thanks.

People who like this

0 Show 0
Comment
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

4 Replies

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by zoya faberov · Apr 06 at 04:45 PM

Hello @zhangjin ,

With Eikon Data API only, for a date in the past, I don't believe you will be able to have the complete solution.

For chain expansion in history, history product, such as Refinitiv Tick History, would work. We have several materials available, for instance, see article How to expand Chain RIC using the Tick History REST API in Python, but the approach described requires Tick History product.

Otherwise, you can expand today and request at a point in time, which will not result in the complete retrieval at point-in time as some constituents would be expected to have changed overtime.

Once you have the chain constituents in time, you can retrieve any information for the list of constituents in that point of time using Eikon Data API. For example:

ek.get_data(df["Instrument"].tolist(),
                  ['TR.CLOSEPRICE','TR.CLOSEPRICE.date'],
                  {'SDate': '20211001','EDate':'20211101'}
                 )

To see what fields are available, Data Item Browser tool (DIB) can be used, see article How to discover available fields for Data Grid service on JET(App Studio HTML5 SDK) API using Eikon Desktop for more info.

I hope that this information helps

Comment
Jirapongse

People who like this

1 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

avatar image
REFINITIV
Answer by zoya faberov · Mar 28 at 07:51 PM

Hello @zhangjin ,

I think the best pure Eikon Data API approach is described in this previous discussion thread:

1. Expand the CRUDE OIL RIC chain as it is now

2. Obtain the historical information on the dates that you require based on the instruments expanded in step 1.

With history product, for example Refinitiv Tick History, you can use Historical Chain Resolution request to expand that chain in the exact point in time, see this previous discussion thread for a discussion of this approach, and you can request close prices and other fields based on the expanded RIC list.

Hope this information helps

Comment

People who like this

0 Show 1 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

avatar image
zhangjin · Apr 06 at 12:41 AM 0
Share

Hi Zoya, I still don't have a clue after reading the thread you provided. I don't need to know 'joiners' and 'leavers' or other information.

I want to know what futures contracts are available for trade on exchange given a date, like today or a date in history. Is there a way using a root RIC + a date to fetch these contract names?

avatar image
Answer by zhangjin · Apr 06 at 01:36 AM

Hi, My problem is not solved, thanks for asking @raksina.samasiri.

I want to know what futures contracts are available for trade on exchange given a date, like today or a date in history. Is there a way using a root RIC + a date to fetch these contract names? Thanks.

Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

avatar image
REFINITIV
Answer by zoya faberov · Apr 06 at 03:23 PM

Hello @zhangjin ,

Sorry your problem is not solved and let me provide some additional information.

For today, I would suggest using Refiniv Data library, please try the following code:

import refinitiv.data as rd
from refinitiv.data.content import historical_pricing
from refinitiv.data.content import pricing

rd.open_session()

cruds = pricing.chain.Definition(name="0#CL:").get_stream()
cruds.open(with_updates=False)
cruds.close()
print(cruds.constituents)

Resulting in constituents:

['CLK2', 'CLM2', 'CLN2', 'CLQ2', 'CLU2', 'CLV2', 'CLX2', 'CLZ2', 'CLF3', 'CLG3', 'CLH3', 'CLJ3', 'CLK3', 'CLM3', 'CLN3', 'CLQ3', 'CLU3', 'CLV3', 'CLX3', 'CLZ3', 'CLF24', 'CLG24', 'CLH24', 'CLJ24', 'CLK24', 'CLM24', 'CLN24', 'CLQ24', 'CLU24', 'CLV24', 'CLX24', 'CLZ24', 'CLF25', 'CLG25', 'CLH25', 'CLJ25', 'CLK25', 'CLM25', 'CLN25', 'CLQ25', 'CLU25', 'CLV25', 'CLX25', 'CLZ25', 'CLF26', 'CLG26', 'CLH26', 'CLJ26', 'CLK26', 'CLM26', 'CLN26', 'CLQ26', 'CLU26', 'CLV26', 'CLX26', 'CLZ26', 'CLF27', 'CLG27', 'CLH27', 'CLJ27', 'CLK27'...

That we can request the info that you require, for example:

non_streaming = rd.content.pricing.Definition(
    cruds.constituents,
    fields=['TRDPRC_1','ASK','BID']
).get_stream(
non_streaming.open(with_updates=False)
non_streaming.get_snapshot()

resulting in:

InstrumentBIDTRDPRC_1ASK
0CLK299.4599.4799.47
1CLM298.5198.5198.54
2CLN297.5897.5297.61
3CLQ296.5496.5896.5
...
Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

Watch this question

Add to watch list
Add to your watch list to receive emailed updates for this question. Too many emails? Change your settings >
11 People are following this question.

Related Questions

Pulling the display name of an expired contract

request expired commodity futures with get_data

Expired contracts data using eikon api

Futures and options chains

Finding all RICs for S&P 500 Futures

  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Connected Risk APIs
  • DSS
  • Data Fusion
  • Data Model Discovery
  • Datastream
  • Eikon COM
  • Eikon Data APIs
  • Electronic Trading
    • Generic FIX
    • Local Bank Node API
    • Trading API
  • Elektron
    • EMA
    • ETA
    • WebSocket API
  • FX Venues
    • FX Trading – RFQ Maker
  • Intelligent Tagging
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open Calais
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • RDMS
  • Refinitiv Data Platform
    • Refinitiv Data Platform Libraries
  • Rose's Space
  • Screening
    • Qual-ID API
    • Screening Deployed
    • Screening Online
    • World-Check One
    • World-Check One Zero Footprint
  • Side by Side Integration API
  • TR Knowledge Graph
  • TREP APIs
    • CAT
    • DACS Station
    • Open DACS
    • RFA
    • UPA
  • TREP Infrastructure
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • Workspace SDK
    • Element Framework
    • Grid
  • World-Check Data File
  • Yield Book Analytics
  • 中文论坛
  • Explore
  • Tags
  • Questions
  • Badges