Currencies via Python API

I am looking to get historical currencies data (London or Europe close) the Python API, but US CLOSE seems to be the only one that is available. Any ideas about how to pull EU/London close quotations?

import eikon as ek
import datetime as dt
import pandas as pd


ek.set_app_key(API_KEY)


start_date = dt.datetime.now()
end_date = dt.datetime.now() - dt.timedelta(days=100)


currencies_list = []   # CURRENCY CODES GO HERE
df = ek.get_timeseries(
    currencies_list,
    'CLOSE',
    start_date=start_date.strftime('%Y-%m-%d'),
    end_date=end_date.strftime('%Y-%m-%d'),
)

Best Answer

  • Hi @jhall yes we provide closes for Asia, Europe and US Sessions. You can see all the fields that are available using the Data Item Browser App (type DIB into eikon search bar) and then typing in an instrument say EUR=. See screenshot below:

    image

    So you can use for example:

    df, e = ek.get_data(['EUR=','GBP=','JPY='], ['TR.AMERICACLOSEBIDPRICE.date','TR.AMERICACLOSEBIDPRICE','TR.ASIACLOSEBIDPRICE','TR.EUROPECLOSEBIDPRICE'], {'SDate':'0D', 'EDate':'-1AW'})
    df

    image

    I hope this can help.

Answers