Upgrade from Eikon -> Workspace. Learn about programming differences.

For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
3 0 0 3

Get a dataframe of FX rates from foreign currency to USD

Hi,

I am trying to get populate the following table with the relevant FX rates into a dataframe using python and eikon api.


FX ratesUSDAUD
USDSGD
USDMYR
USDCNY
USDHKD


Can anybody help?

Thanks,

eikon-data-apipython api
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.

Upvote
Accepted
25.3k 87 12 25

Hi @hlteh3388

You can use your Eikon Desktop application to help you identify the relevant RICS e.g. you could use INRAUD=R, IRNSGD=R and so on.

I discovered the above by starting to type INRAUD etc into the main search bar.

Likewise, to help identify which Fields you want you can use the Data Item Browser in Eikon too e.g. by typing 'INRSGD=R DIB and then clicking on the Data Item Browser lookup, you can explore the various FIDS available for that RIC.

1645436043822.png


1645436043822.png (49.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.

Upvotes
25.3k 87 12 25

Hi @hlteh3388

Have you tried something like this?

df, err = ek.get_data(
    instruments = ['AUD=','SGD=','MYR=','CNY=','HKD='],
    fields = ['DSPLY_NAME','BID','ASK','ACVOL_1','NUMB_BIDS','QUOTIM_MS','TIMACT']
)
display(df)

to output:

1645434248632.png


1645434248632.png (17.1 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.

Upvotes
3 0 0 3

Hi umer.nalla,

This is quite close to what I want. I haven't decided on the base currency. If I want to change my base currency to INR, what should I do?

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.

Upvotes
3 0 0 3

Thanks a lot for your help.

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.