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,

Best Answer

  • 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

Answers

  • 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

  • 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?

  • Thanks a lot for your help.