conversion of stock prices to home currency in time series or any function for conversion

hello,


i have a query on .....As the stocks in the list of time series function are in different currencies, what code can be used in a function:

  1. to get the currency
  2. convert all those in to home currency?


thanks in advance


RS

Tagged:

Answers

  • @rupa

    Thank you for reaching out to us.

    To work with currency conversions, it is easier to use the get_data method. The code looks like this:

    df, err = ek.get_data(
        ["VOES.VI","UPM.HE"],
        [
            "TR.PriceClose.Date", "TR.PriceClose","TR.PriceClose.Currency",
             "TR.PriceClose(curn=USD).Date", "TR.PriceClose(curn=USD)","TR.PriceClose(curn=USD).Currency"
        ],
        {"SDate":"2024-08-21","EDate":"2024-08-24","Frq":"D"})


    df

    1726034015249.png

    You can use the Data Item Browser tool to search for fields and parameters that can be used in the get_data method.