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

Best Answer

Answers

  • 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.

    image


    image

    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.

  • 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

  • Hi @chavalit.jintamalit

    Using the code above I am getting:

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


  • Hi @riccardop

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

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

  • 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.