For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
29 2 1 5

Refinitiv call get_data() returning Price instead of yield

Hi,

I have this piece of code:

data = ek.get_timeseries(
                ['GB10YT=RR','GBIL0E31='],
                start_date="2021-09-01",
                end_date="2021-09-08",
                interval="daily"
            )


As you can see below, I get the Cash bnd yields (OHLC) - but for the inflation bond, I get the prices (and not the yields).

How can I fix this?

Thanks,

Sumit

python
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvote
Accepted
1.4k 6 2 2

Hi @sumit


Please use 'get_data' and the Data Item Browser as per this video to select the fields of interest. E.g.:

data, err = ek.get_data(
    instruments=['GB10YT=RR','GBIL0E31='],
    fields=['TR.ASKPRICE.date',
            'TR.CLEANPRICE', 'TR.BIDYIELD',
            'TR.ASKPRICE', 'TR.ASKYIELD',
            'TR.MIDPRICE', 'TR.MIDYIELD',
            'TR.HIGHPRICE', 'TR.HIGHYIELD',
            'TR.LOWPRICE', 'TR.LOWYIELD',
            'TR.OPENPRICE', 'TR.OPENYIELD',
            'TR.OPENASKPRICE', 'TR.HIGHASKPRICE',
            'TR.DIRTYPRICE'],
    parameters={
        'SDate': '2021-09-01',
        'EDate': '2021-09-08',
        'Frq': 'D'})

This example comes - in part - from this article and its source code on GitHub.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
29 2 1 5

hi @jonathan.legrand ,

Thanks. Just to check - is TR.MIDYIELD the official close?


Regards

Sumit

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
29 2 1 5

Also for GBIL0E31= , the TR.MIDYIELD seems to be always nan. Any reason why?

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
1.4k 6 2 2

Hi @sumit, for content questions such as the last two, please refer to the Refinitiv Help Desk.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea