futures expiry date in TRTH python
Hi there,
I have 2 questions please:
1 I am trying to retrieve the expiry date of a specify contract through the TRTH Python API. I use "Expiration Date" as the file in ContentFieldNames section of the json file. It works for some products but does not for others. For example, when trying to retrieve the expiry date of FCEK1, the extract does not any entry whereas the code works perfectly for others.
2 Is there also a way to simply retrieve all the expiry dates of a future chain like in the Eikon API by using a ric chain like 0#FCE:
I also tried to use this in the query but it does not work.
Thank you for your help
Best Answer
-
Hello @Mehdi,
Check out the attached example of the two "chained" searches, it is not a fully polished example, but hope it helps:
0
Answers
-
Hello @Mehdi,
I think FuturesAndOptionsSearch may be suitable:
{{protocol}}{{host}}{{api}}Search/FuturesAndOptionsSearch
{
"SearchRequest": {
"FileCodes": null,
"CurrencyCodes": null,
"ExchangeCodes": null,
"IdentifierType": "Ric",
"Identifier": "FCEK1"
}
}resulting in:
{
"@odata.context": "https://hosted.datascopeapi.reuters.com/RestApi/v1/$metadata#Collection(ThomsonReuters.Dss.Api.Search.FuturesAndOptionsSearchResult)",
"value": [
{
"Identifier": "FCEK1",
"IdentifierType": "Ric",
"Source": "MNP",
"Key": "VjF8MHgwMDEwMGIwMDI2YTljMzEzfDB4MDAxMDBiMDAyNmFjMDY2NnxNTlB8RFZRVXxERVJWfEZVVHxEfHxGQ0VLMXw1MDM2",
"Description": "CAC 40 MAY1",
"InstrumentType": "DerivativeQuote",
"Status": "Valid",
"ExchangeCode": "MNP",
"CurrencyCode": "EUR",
"FuturesAndOptionsType": "Futures",
"PutCallCode": "",
"ExpirationDate": "2021-05-21T00:00:00.000Z",
"AssetStatus": "Active"
}
]
}It does not support chainRIC as identifier, so you have to find expand the chain:
{{protocol}}{{host}}{{api}}Search/HistoricalChainResolution
{
"Request": {
"ChainRics": ["0#FCE:"],
"Range": {
"Start": "2020-06-12T00:00:00.000Z",
"End": "2021-06-12T00:00:00.000Z"
}
}
}And then look up expiration dates of the relevant RICs using FuturesAndOptionsSearch
0 -
Hi Zova,
I tried your query in the Python API, but it does not work. The ExtractRaw method returns:
Status Code = 400
XXX lineno: 94, opcode: 0
Do you think this should work even in the Python TRTH API? would you have a small piece of Python code to share that i could try because i could not find any documentation about this type of json file to be called in Python?
Thank you again
0 -
Hello @Mehdi,
ExtractRaw is not the right request type/endpoint to use.
My suggested approach included two Searches:
{{protocol}}{{host}}{{api}}Search/FuturesAndOptionsSearch
and
{{protocol}}{{host}}{{api}}Search/HistoricalChainResolution
Please see REST API Reference Tree with the complete spec to use.
I have tested the "naked" requests in Postman, so they will work the same in any language that supports HTTP REST interface, including Python.
0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 685 Datastream
- 1.4K DSS
- 616 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 252 ETA
- 556 WebSocket API
- 38 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 275 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 652 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 27 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 193 TREP Infrastructure
- 228 TRKD
- 917 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 90 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛