Pull federal Canadian bonds that are active as of a specific date using Python API

I am trying to pull the list of federal Canadian bonds that are active as of a specific date using Python API. I can do this in Eikon by using GOVSRCH and filtering by asset status effective date however, I am not able to add the duration and yield to maturity based on that historical date. I was wondering if there is an option that will allow me to do this using Python API instead?
Best Answer
-
Hi @MarkJayson.Lima , thank you for getting back to me. To pull the historical RICs you can use either the GOVSRCH or the code I have provided above (by adding filter criteria you used in GOVSRCH(eg AssetStatusEffDate)). In terms of the values for yield and duration you will get the latest values as an output.
And if you want the historical time series, you can use rd.get_history function.
Here is the code to get historical data with RD Libraries:
rd.get_history(universe=['CA135087VH4=', 'CA135087UT9='], start = '2010-01-01', end='2010-01-10',
fields=['B_YLD_1','A_YLD_1','ISMA_A_YLD','ISMA_B_YLD','MOD_DURTN'])Through this code I was able to get ISMA yields and Duration for the specified bonds:
Hope this was helpful.
Best regards,
Haykaz
0
Answers
-
HI @MarkJayson.Lima ,
thank you for your question. You can use search capabilities of RD Library for Python. Here you can find examples of using Search functionality.
I have tried to build your query here with as much information I had
rd.discovery.search(
view = rd.discovery.Views.GOV_CORP_INSTRUMENTS,
top = 10000,
filter = "RCSAssetCategoryLeaf eq 'bond' and IsActive eq true and IssuerCountry eq 'CA' and DbType eq 'GOVT'",
select = "RIC,EJVAssetID,DTSubjectName,BusinessEntity,PI,DBSTicker,CouponRate,MaturityDate,IssueDate,ISIN,RCSCurrencyLeaf,RCSCountryLeaf,DbTypeDescription,InstrumentTypeDescription,FaceIssuedUSD,RCSGovtBondTypeLeaf"
)If you let me know some more details on the type of data you would want to get and the type of filters, I will be happy to help to build the query.
Hope this helped, let me know should you have any further questions.
Best regards,
Haykaz
0 -
Hi @haykaz.aramyan,
Thanks for the response. I am actually hoping to pull the historical federal bonds of Canada that were active on the particular historical date and also allow me to view data like yield and duration at that particular date for those bonds (ex. 10/01/2010).
0 -
Thanks for the help @haykaz.aramyan
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
- 689 Datastream
- 1.4K DSS
- 625 Eikon COM
- 5.2K Eikon Data APIs
- 11 Electronic Trading
- 1 Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 255 ETA
- 558 WebSocket API
- 39 FX Venues
- 15 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
- 277 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 23 RDMS
- 1.9K Refinitiv Data Platform
- 695 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
- 106 UPA
- 194 TREP Infrastructure
- 229 TRKD
- 918 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 93 Workspace SDK
- 11 Element Framework
- 5 Grid
- 19 World-Check Data File
- 1 Yield Book Analytics
- 48 中文论坛