Retrieve EOD bond price Python eikon
Hi, I want to be able to retrieve the EOD dirty prices of corporate bonds (international portfolio) using Python eikon API (see code snippet below).
How can I do that?
Can someone also pls explain:
a) can I use this Sdate argument and how? What does Sdate="0D" or "-1D" mean?
b) does 'TR.CLEANPRICE.date' give me the date on which the bond last traded or .. ?
c) what is the difference between 'TR.DIRTYPRICE' and "DIRTY_PRC" ?
Many thanks in advance.
****************************************************************
lst = ["902613AH1="]
databnd, err = ek.get_data(lst,fields = ['TR.FIAccruedInterest',
'TR.FiNumberAccruedDays',
'TR.CLEANPRICE',
'TR.CLEANPRICE.date',
'TR.DIRTYPRICE',
'DIRTY_PRC']
, parameters = {"Sdate":'-1D'})
Best Answer
-
hello @grigorios.mamalis ,
The Data Item Browser could give you the description and some detail you'd like to know, to access it, search for DIB in the Eikon Desktop search box.
Anyway, please see the answers to your questions below
a) can I use this Sdate argument and how? What does Sdate="0D" or "-1D" mean?
- Yes, you can use the SDate to specify the beginning of the data period,
- 0D mean Last Trading Day and -1D mean 1 day before that
- or you can use the absolute date on SDate and EDate as well, For example,
parameters={'SDate':'2021-09-01', 'EDate':'2021-09-20'}
- To see which field has SDate parameter available, you can check in DIB > search the instrument (RIC) you're interested > search for the field > on the right panel, there's the Description and Parameters tabs, click on Parameters to see which one is available for the field, this also contains the description of 0D, 1D
b) does 'TR.CLEANPRICE.date' give me the date on which the bond last traded or .. ?
c) what is the difference between 'TR.DIRTYPRICE' and "DIRTY_PRC" ?
- For questions b) and c), as this forum is primarily for API / programming-type questions - most of the forum moderators are not Content experts. So, please raise a Content query in MyRefinitiv helpdesk, which you can have direct communication with the content expert. Select 'I need help using product' and product: 'Refinitiv Eikon'.
- speaking of which, I've raised the inquiry regarding the content on case number 10434923, the content expert will give you information about this soon.
1 - Yes, you can use the SDate to specify the beginning of the data period,
Answers
-
@grigorios.mamalis I will try to address so of your points:
lst = ["902613AH1="]
databnd, err = ek.get_data(lst,fields = ['TR.ACCRUEDINTEREST.date','TR.ACCRUEDINTEREST','TR.FiNumberAccruedDays','TR.CLEANPRICE.date','TR.CLEANPRICE.calcdate','TR.CLEANPRICE','TR.DIRTYPRICE'],parameters = {"Sdate":'-100D', "EDate":'0D', 'Frq':'D'})
databndSo you have a mixture of fields which have interday timeseries available eg Clean Price / Dirty Price and Accrued Interest and also a field which is a static field eg umber of Accrued Days. You can use the Data Item Browser app (type DIB into eikon search to launch) to identify which fields have timeseries available or not. I would keep timeseries requests in one API call and static requests in another API call.
a) SDate argument can be either absolute eg '2021-09-01' or relative eg '-10D' Start Date there is accompanying EDate parameter and usually we put in an Frq 'D' parameter (default is D, could be W, M, Y etc. More information is available in reference guide.
b) I am not a content expert but we have a number of toggleable output types (you can see these in the DIB parameters), .calcdate is usually the date of the calculation. I have included both.
c) TR.DIRTYPRICE is a collected field which provides an interday timeseries history - DIRTY_PRC is a realtime streaming intraday field which does not provide any timeseries history. The TR.DIRTYPRICE for the day will be the last value but in parameters you have options to choose from CLOSE, LAST, HIGH, LOW etc.
I hope this can help.
1 -
Many thanks to both of you for your feedback.
Grigorios
0
Categories
- All Categories
- 6 AHS
- 37 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
- 367 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
- 59 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛