Upgrade from Eikon -> Workspace. Learn about programming differences.

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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
39 3 2 9

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 512.0 KiB each and 1.0 MiB total.

Upvote
Accepted
5.5k 21 2 6

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 512.0 KiB each and 1.0 MiB total.

Upvotes
39 3 2 9

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 512.0 KiB each and 1.0 MiB total.

Upvotes
39 3 2 9

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 512.0 KiB each and 1.0 MiB total.

Upvotes
5.5k 21 2 6

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 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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