question

Upvotes
Accepted
1 0 0 2

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

eikon#technology
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
Upvotes
Accepted
87.1k 294 53 79

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


1726034015249.png (17.0 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.