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 /
avatar image
Question by sumit · Jan 11 at 05:02 PM · pythonstatic dataust

How can I get OTR/ OfTR/ OfTR x3 information for a historical date

Hi,

I would like to get the static flag: OTR or OfTR or OfTRx3 etc. given a CUSIP & Date (historical). 912828ZP8 - This is a example cusip which would probably give me back OTR if I put in the date: 1st June, 2020. But probably OfTR x2 if I put in the date: 1st Aug, 2020 (or something like that).

Is there a python api like:

 ek.get_data(
    list(isin_list.values),
    'TR.DV01Analytics',
    parameters={'SDate': dt, 'EDate': dt}
)[0]

to get this information?

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.

1 Reply

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by Alex Putkov. · Jan 11 at 08:35 PM

To the best of my knowledge there's nothing in the data model that would directly provide this indicator. But you could retrieve the history of ISINs corresponding to OTR and then write a function that looks up an ISIN in the OTR history table and returns its relative position to OTR on the input date.

This code retrieves the table of ISINs corresponding to OTR for the last year and the dates ISIN became OTR.

otr_df, err = ek.get_data('0#USBMK=','DSPLY_NAME')
otr_list = otr_df['Instrument'].tolist()
otr_hist_df, err = ek.get_data(otr_list,['TR.BH.ISIN','TR.BH.EffDate'],
                              {'SDate':'0D', 'EDate':'-1Y'})

The function below returns the indicator you're looking for given ISIN, date and OTR history table

def otr_ref(isin, ref_date, otr_hist_df):
    isin_row_df = otr_hist_df.loc[otr_hist_df[
        'Government Benchmark Bond ISIN']==isin]
    if len(isin_row_df.index) == 0:
        return 'Error: ISIN not found in the OTR history table'
    match_row = isin_row_df.index[0]
    otr_ric = otr_hist_df.loc[match_row,'Instrument']
    otr_ric_df = otr_hist_df.loc[
        otr_hist_df['Instrument']==otr_ric]
    #the table retrieved from Eikon is already sorted by OTR effective date
    #but just to make absolutely sure, we can sort it here
    otr_ric_df = otr_ric_df.sort_values('Benchmark Effective Date', 
                                        ascending=False)
    otr_at_refdate_row = otr_ric_df.loc[
        otr_ric_df['Benchmark Effective Date']<=ref_date].index[0]
    x = (otr_ric_df.index.get_loc(match_row) - 
         otr_ric_df.index.get_loc(otr_at_refdate_row))
    if x == 0:
        return 'OTR'
    elif x > 0:
        return f'OffTRx{x}'
    else:
        return (f'Error: date {ref_date} is earlier than ' + 
                f'the date {isin} became OTR ' +
                f'({otr_ric_df.loc[match_row,"Benchmark Effective Date"]})')

For ISIN 'US912828ZP81' it indeed returns 'OTR' on 2020-06-01 and 'OffTRx2' on 2020-08-01.

In:

print(otr_ref('US912828ZP81', '2020-06-01', otr_hist_df))
print(otr_ref('US912828ZP81', '2020-08-01', otr_hist_df))

Out:

OTR
OffTRx2
Comment
sumit

People who like this

1 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
sumit · Jan 11 at 09:22 PM 0
Share

Thanks a lot!!

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

Data point limit for get_data and get_timeseries?

Python API - Unknown field name

EPS Trailing 12 Months of a company

Replicate GOVSRCH function in Python

Where can I view list of supported parameters?

  • Feedback
  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Careers
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Calais
  • Connected Risk APIs
  • DSS
  • Data Fusion
  • Data Model Discovery
  • Datastream
  • Eikon COM
  • Eikon Data APIs
  • Elektron
    • EMA
    • ETA
    • WebSocket API
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • 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
  • TRIT
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • World-Check Data File
  • Explore
  • Tags
  • Questions
  • Badges