TR.CLOSEPRICE currency conversion does not work

Hello,


I am looking to pull historical prices for a large number of ISINs across different asset classes. I am using the following formula:

df2, err=ek.get_data("ANN4327C1220",["TR.CLOSEPRICE(Adjusted=1).date","TR.CLOSEPRICE(Adjusted=1).value", TR.CLOSEPRICE(Adjusted=1).date.currency
],
{"SDate":"2015-12-31","EDate":"2022-12-31","Frq":"M","curn":"DKK"})


Unfortunately, the currency conversion does not work for some ISINs, including the one in the example. The currency column of df2 in the example is notably empty. Is it possible to solve this issue? If not, how can I obtain the currency of the item "TR.CLOSEPRICE" for a series of ISIN please?


Thank you.


Best,

David

Best Answer

  • aramyan.h
    Answer ✓

    Hi @dpi.eco ,


    Thank you for your question. I have tested you code and the currency conversion works when I use the RIC for the instrument. Please see below:

    df2, err=ek.get_data("HDUGF.PK",
    ["TR.ISIN", "TR.CLOSEPRICE.date","TR.CLOSEPRICE.value", "TR.CLOSEPRICE.currency"],
    {"SDate":"2015-12-31","EDate":"2022-12-31","Frq":"M", "Curn":"DKK"})
    df2

    screenshot-2023-04-17-at-142915.png


    Hope this helps and please let me know should you have any further questions.


    Best regards,

    Haykaz

Answers

  • Dear Haykaz,


    Thank you for your reply. I tried your answer and the currency conversion indeed works. However, if I search for TR.RIC using the ISIN in my example, I get HUDN.AS^J22 and not HDUGF.PK. The two RIC give slightly different price series. Is it possible to search for the Currency of the price of the original ISIN?


    Thank you.


    Best,

    David


  • Hi @dpi.eco ,


    The one with ^ symbols are delisted ones, so you would need the HDUGF.PK.

    Actually, what I would advise is to use our latest RD Libraries for Python. As a first step you may a symbol conversion which will return the RIC you are after:

    from refinitiv.data.content import symbol_conversion
    response = symbol_conversion.Definition(
    symbols= 'ANN4327C1220',
    from_symbol_type="ISIN",
    to_symbol_types="RIC"
    ).get_data()

    response.data.df

    screenshot-2023-04-17-at-150520.png

    And then you can use the same code as before but using the RD Lib:

    rd.get_data(
    universe=['HDUGF.PK'],
    fields= ["TR.ISIN", "TR.CLOSEPRICE.date","TR.CLOSEPRICE.value", "TR.CLOSEPRICE.currency"],
    parameters = {"SDate":"2015-12-31","EDate":"2022-12-31","Frq":"M", "Curn":"DKK"})


    Hope this helps.


    P.S I checked with ISIN in RD as well but unfortunately it didn't work there either.

    Best regards,

    Haykaz