Wrong currency or null value returned in Refinitiv Data Library

Hi.
The following request returns either wrong values or null values.

instruments = [".MIEUG0000PEU", ".FTAWPACXJAR", ".TRIFREMLVNU", ".dMIGB0ECISGGB", ".dMIWO0EC0SGGB", 
".MIJP0200BGGB", ".MIUGG200BGGB", ".MIAXK200BGGB", ".MIUS0200BGGB", ".MIEF0EC0SGGB" ]
rd.get_data(universe = instruments, fields = ["TR.IndexCalculationCurrency"])

1686746247216.png


However, when I check in Workspace, the correct data can be retrieved

1686746988232.png


Can you have a look, please?

Thanks



Best Answer

  • Jirapongse
    Answer ✓

    You can also use Eikon Data API in Codebook.

    The code looks like this:

    import refinitiv.data.eikon as ek


    ek.set_app_key('DEFAULT_CODE_BOOK_APP_KEY')
    instruments = [".MIEUG0000PEU", ".FTAWPACXJAR", ".TRIFREMLVNU", ".dMIGB0ECISGGB", ".dMIWO0EC0SGGB", 
                   ".MIJP0200BGGB", ".MIUGG200BGGB", ".MIAXK200BGGB", ".MIUS0200BGGB", ".MIEF0EC0SGGB" ]
    df, err = ek.get_data(instruments, fields = ["CF_CURR"])
    df

    The output is:

    1686911681633.png

Answers

  • Hi @yaokoffi.kouassi

    Try using the field: CF_CURR

    1686751951593.png

  • Hi @nick.zincone and thank you for your reply.

    I tried to use CF_CURR field and the response is not satisfying.

    Instead of getting the string value of the currency, I retrieved the digital currency code as you can see below

    1686907631749.png


    I've read this post which allows to resolve the currency code in RDP which is in my mind a hack.

    As the code I'm currently designing is for an external user, I prefer to have an elegant solution.


    Question : is there a parameter I can put in the get_data parameter field to resolve the currency code ?

    Thanks


  • Hi @yaokoffi.kouassi

    What about this?

    You try to get a currency from the TR.PriceClose.currency. However it seems that the second instrument is a bit different with the currency code "US2" and is not recognized, therefore you may try this workaround:

    rd.get_data(universe = instruments, fields = ["AVAIL(TR.PriceClose.currency,TR.IndexCalculationCurrency)"])
  • Hi @marcin.bunkowski01 ,

    Fantastic! in your code above, If I use TR.ClosePrice.currency instead of TR.PriceClose.currency, then the output is correct.

    1686911031478.png


    Thank you for your help.

  • Thanks @Jirapongse!

    Your piece of code works as well.

    However, I've been advised to use Refinitiv Data Library instead of EIkon Data API.