TR(Universe=’0#USTSY’)
I want to translate a excel function TR(Universe=’0#USTSY’) in python. How should I do it?
Best Answer
-
There appears to be an error in the Excel function syntax you provided. Assuming what you're looking to do is to retrieve the constituents of 0#USTSY= chain, which is what =TR("0#USTSY=") function returns, then you can use for instance
ek.get_data('0#USTSY=',['DSPLY_NAME'])
The field name DSPLY_NAME in the above is arbitrary. It can be replaced or appended by any other field available in the real-time record for the constituents of 0#USTSY= chain, e.g.
ek.get_data('0#USTSY=',['DSPLY_NAME','PRIMACT_1','SEC_ACT_1'])
0
Answers
-
Thanks. It is very helpful. The output instrument ticker is same as ID_CUSIP from Bloomberg, right? Can I get corresponding Bloomberg ticker and following Bloomberg field: SECURITY_DES, SECURITY_PRICING_DATE, MATURITY, ID_BB_UNIQUE, ID_BB_GLOBAL, MARKET_SECTOR_DES?
Besides, how can I find tickers to get other countries' bonds, i.e. German, France, British, Canada, Italy and Japan?
Thanks
Peng
0 -
Hi Peng,
The symbols returned in the Instrument column are RICs, which is Thomson Reuters proprietary symbology. There's no direct mapping between RICs and Bloomberg symbols, however you could use other symbology such as ISINs, Cusips, Sedols etc as intermediary. E.g. using Eikon you can retrieve a Cusip given a RIC and vice versa. And using Bloomberg terminal you can retrieve Bloomberg symbols given a Cusip and vice versa.
It sounds like you could benefit from an introductory training for Eikon focusing no how to find the data items you might be interested in. You can request such training through your Thomson Reuters account team or from the main Eikon menu - Help - Tutorials and Training - Live Training.
Also please note that my answers are specific to Eikon and Eikon APIs. I understand your company is also considering using Datascope product. The calls to retrieve data from Datascope will be different. If you're looking to use Datascope, please visit Datascope page on this portal:
https://developers.thomsonreuters.com/datascope-select-dssAnd if you have questions related to Datascope APIs you can post them on a dedicated forum.
0 -
Thanks. I tried the following
ek.get_data('0#USTSY=',['DSPLY_NAME', 'CUSIP'])
but can't get CUSIP. Anything wrong?
Peng
0 -
It sounds like you're trying to guess the field name. If this is indeed what you're doing you're unlikely to succeed. The best way to discover the field names you can use in function calls is to search for them using the GUI helpers provided in the product. See this tutorial, which talks at length about metadata discovery.
For US treasuries the RIC symbology is based on CUSIP. You could simply drop the trailing "=" sign from the RIC such as "912810RY6=" to arrive at the CUSIP. The exception are the RICs denoting "when issued" benchmarks.0 -
Alternatively you can retrieve CUSIPs for the constituents of 0#USTSY= chain using the following sample:
df, err = ek.get_data('0#USTSY=',['DSPLY_NAME'])
ustlist = df['Instrument'].tolist()
ek.get_data(ustlist,['TR.CUSIP'])0 -
Thanks a lot. Appreciated!
0
Categories
- All Categories
- 6 AHS
- 39 Alpha
- 161 App Studio
- 4 Block Chain
- 4 Bot Platform
- 16 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 370 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 60 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛