how do I get historical ticks using Python eikon package

Hello, how do I get historical ticks using Python eikon package?

For example, the Excel way to get real-time ticks is =TR(E3:E1001,"TR.InstrumentDescription;PRIMACT_1;SEC_ACT_1;CF_TIME;GV6_TEXT;CF_BID;CF_ASK","UPDFRQ=STREAM CH=Fd RH=IN")

What about getting historical ticks in Python? I tried the following but with no luck.

import eikon as ek

ek.set_app_key('{my app key here}')

list_rics = ['775109BB6=', ]

list_fields = ['TR.InstrumentDescription', 'PRIMACT_1', 'SEC_ACT_1', 'CF_TIME', 'GV6_TEXT', 'CF_BID', 'CF_ASK']

sd = '2019-09-06T06:00:00'

ed = '2019-09-06T21:00:00'

df = ek.get_timeseries(list_rics, list_fields, start_date=sd, end_date=ed, interval='tick')

print(df)

Best Answer

  • currently the fields supported by ek.get_timeseries() are; 'TIMESTAMP', 'VALUE', 'VOLUME', 'HIGH', 'LOW', 'OPEN', 'CLOSE', 'COUNT' , which for most instrument types is fine; but for bonds there need to be additional fields added. You can retrieve historical yield data for bonds on a tick basis. (via Eikon Excel you would reference BID.Close and ASK.Close for historical bid/ask levels - these have yet to be added to Eikon DAPI).

    ts = ek.get_timeseries(['775109BB6='], fields = ['VALUE'], start_date = "2019-09-06T06:00:00",
    end_date = "'2019-09-06T21:00:00", interval="tick")

    image

Answers

  • Hi,

    If you need to get the granular data you may use 'taq' (times and quotes) interval that is not yet officially supported.

    ek.get_timeseries('775109BB6=',['Bid','Bid_yield'], start_date = "2019-09-06T06:00:00", end_date = "'2019-09-06T21:00:00", interval="taq")

    image

  • @James.Perkins

    Hi James! a follow up on this one:


    As you mentioned, the bond timeseries data can be retrieved by excel plug in, and I was able to get that. Any chance this function is supported by tickHistoryRaw or python eikon api right now?


    Thank you so much for your help!