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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
5 0 1 0

Trying to retrieve historical levels of curve GBPOIS= in Eikon API (Python)

Hi, I am trying to retrieve historical levels of the curve <GBPOIS=>, but I am struggling. The answer to my previous question allowed me to do it for 0#GBBMK= by doing the following:

df, e = ek.get_data(['0#GBBMK='], ['MATUR_DATE'])
ric_list = df['Instrument'].tolist()
df2, e2 = ek.get_data(ric_list,
                      ['TR.MIDPRICE', 'TR.MIDPRICE.Date', 'TR.MIDYIELD', 'TR.MIDYIELD.Date'],
                      {'SDate': strdate, 'EDate': strdate})

If I apply the same approach to GBPOIS= it doesn't work. Note that I have tried using the correct fields listed in Data Item Browser. Could you please advise? Thanks

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpythonhistoricalois
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
Accepted
18k 21 12 20

Hi @riccardop

You can use get_timeseries, please refer to this document.



ahs.png (23.1 KiB)
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
18k 21 12 20

Hi @riccardop

I am not sure why the chain RIC does not get expanded.

Anyway, this is the workaround, you can list all the underlying RIC code manually.


And I could not find yield fields for these RIC codes.

You have to contact the Refinitiv Content Helpdesk at https://my.refinitiv.com to get help to identify what fields are carrying the (history) yield information.


ahs1.png (82.2 KiB)
ahs2.png (40.4 KiB)
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
5 0 1 0

Hi the Eikon helpdesk said that on Excel they would use:

=RHistory("GBP1MOIS=",".Timestamp;.Close","START:01-Jan-2020 END:12-Feb-2020 INTERVAL:1D",,"TSREPEAT:NO CH:Fd",B8)

How would that translate in Python? Thanks

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
5 0 1 0

Hi @chavalit.jintamalit

Using the code above I am getting:

ValueError: not enough values to unpack (expected 2, got 1)


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
18k 21 12 20

Hi @riccardop

Can you share a screenshot that you got this error please?

ValueError: not enough values to unpack (expected 2, got 1)

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
5 0 1 0

Hi @chavalit.jintamalit

Apologies, my mistake. I have re-run the script you provided, and it does work. I had edited my code and left df3, e = instead of df3 =.

Could I suggest to post code in a way that it can be copy-pasted, and not an image? (To reduce silly errors like mine!)

Thanks again.

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