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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
3 0 0 1

Proper parameters for retrieving bid ask information via Eikon Data API via Python.

Hello,
I would like to obtain tick data for equities. The example here is 'ADVANC.BK'. However, the function (1) gives all 'nan' responses. Since function (2) works well, I doubt the parameters in 'fields' are specified incorrectly. Please help correct the function (1) where they are needed.

(1) ek.get_timeseries(rics=['ADVANC.BK'],fields=['TR.PRICE','TR.BIDSIZE', 'TR.ASKPRICE', 'TR.BIDSIZE','TR.ASKSIZE'], start_date = "2019-09-24T06:00:00", end_date = "2019-09-30T09:30:00",interval="daily")

(2) ek.get_timeseries(rics=['CNYQM7R1Y=TPSC'],fields = ['Value'],start_date = "2019-09-24T06:00:00", end_date = "2019-09-30T09:30:00",interval="tick")

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpythonwebsockets
1575025038920.png (17.5 KiB)
1575025085220.png (25.1 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
Accepted
3.8k 4 4 6

Hi @tanaj

Try this:

ts=ek.get_timeseries("ADVANC.BK",['Bid','Ask','Bidsize','Asksize','Count','Trdprc_1'], start_date = "2019-12-01T06:00:00", end_date = "'2019-12-03T21:00:00", interval="tas")
ts.tail()



ahs.jpg (91.9 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Thank you Marcin !

Hello Marcin,

I copy/paste your code but result is totally different (screenshot attached)

I'm using API v1.0.2 (18 December)

Looks like timeseries service still provides only a limited fields. Is it planned to be able to use others fields like Bid,Ask,... I know it's possible with .NET API but I really don't want to use it. Python is more convenient.

Thanks

Marc

test.png

test.png (235.4 KiB)
Upvotes
18k 21 12 20

Hi @tanaj

Please refer to the API document at https://docs-developers.refinitiv.com/1575026507514/14684/book/en/eikon/index.html#get_timeseries

get_timeseries supports only 'TIMESTAMP', 'VALUE', 'VOLUME', 'HIGH', 'LOW', 'OPEN', 'CLOSE', 'COUNT' fields !


So if you want to retrieve TR.xxx fields, you have to use get_data()

Since I am not sure what data you try to retrieve(bid ask bidsize asksize in historical? Not so sure what does it mean), here is an example for both get_timeseries and get_data:

And this is for interval = tick (I use .tail() because there are a lot of records)

For get_data, you can use Data Item Browser to explore what fields(with parameters) are available or contect Refinitiv Content Helpdesk.




ahs.png (56.2 KiB)
ahs3.png (14.1 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
3 0 0 1

Dear @chavalit.jintamalit, I apologize for not being exact with the data specification. The data I am trying to retrieve are 1) Bid price 2) Ask price 3) Bid size 4) Ask size 5) Trading Volume 6) Price of last trade. All are with the frequency of 'tick'. Data range is from 24-09-2019 to 30-09-2019. Put it simply, I would like to get the data in the picture below with two additional columns for bid size and ask size via Python. (ADVANC.BK >> Price & Charts >> Time & Sales). The function (1) (in the original question) parameters should be changed from "interval='daily'" to "interval="'tick'". Please help me correct the function (1) in order to retrieve such data.


1575339525615.png (97.3 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
18k 21 12 20

Hi @tanaj

The data you are looking for, they cannot be retrieved using Python API.


You can refer to API document at https://docs-developers.refinitiv.com/1575347810533/14684/book/en/eikon/index.html#get_timeseries

Check the fields and interval that the API is currently supporting.


There is another API, .NET API which allow you to retrieve this data.

Please visit https://developers.refinitiv.com/eikon-apis/net-apis-use-custom-applications

Then go to Download >> Usage Example Time series API
Then modify the TimeSeriesRequestExample following this sample code:


ahs2.png (23.0 KiB)
ahs1.png (498.8 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Thank you Chavalit. I wil definitely try .NET API.

Click below to post an Idea Post Idea