Daily Exchange rate through EIKON Python API

I am trying to fetch the daily Exchange rate from EIKON API solution. Please see the below code.

start_date          = '2019-01-01'
end_date            = '2019-03-01' 
field               = ['BID','ASK']
ric                 = ['ZAR=','GBPZAR=']
params              = parameters={'SDate': start_date, 'EDate': end_date,'Frq': 'D'}
 
data,err            = ek.get_data(ric,field,params)

The Output is only showing results of the current date.

Can someone help?

  Instrument      BID      ASK
0 ZAR= 14.4942 14.4992
1 GBPZAR= 19.8543 19.8783


Best Answer

Answers

  • Hi @alankar.gupta ,


    Have you tried the CODECREATOR app on Eikon/Workspace?

    Using it, I was able to look for different Bid and Ask fields to test, and I found some that seem to work as expected:


    start_date ='2019-01-01'
    end_date = '2019-03-01'
    field = ['TR.BIDPRICE','TR.ASKPRICE']
    ric = ['ZAR=','GBPZAR=']
    params = {'SDate': start_date, 'EDate': end_date, 'Frq': 'D'}


    df2, err = ek.get_data(instruments=ric,
                           fields=field,
                           parameters=params)
    df2


    Do let me know if this works as you wish.

  • Hi @jonathan.legrand How do I print the date beside the records?