Upgrade from Eikon -> Workspace. Learn about programming differences.

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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
55 5 8 7

Get Data / Date Filter / Options Volumes

Hello,

I'm using the below get_data formula:


lst_dt = (datetime.now() - timedelta(days=1)).strftime("%Y-%m-%d")

fst_dt = (datetime.now() - timedelta(days =5)).strftime("%Y-%m-%d")

list_rics = ["1SB2175E2"]

list_fields_1 = ['TR.AccumulatedVolume.date','TR.AccumulatedVolume']

print("load data from",fst_dt,"to",lst_dt)





df_a,e = ek.get_data(list_rics,list_fields_1, {'SDate':fst_dt,'EDate':lst_dt})

df_a = df_a.rename({'TR.AccumulatedVolume.date':'Date'},axis=1)

df_a = df_a.rename({'Accumulated Volume':'Volume'},axis=1)

df_a = df_a.rename(columns = {"Instrument":"Reuters Ticker"})

print(df_a)


And getting the below result:

  Reuters Ticker                  Date  Volume
0      1SB2175E2  2022-03-23T00:00:00Z      49


It suggests that my date filter is not working, as 23rd of March should be excluded as it is before my "SDate" and there should be something for the 5th of April (volume was 100 lots on that day which matches my "EDate").

How to use correctly those date filters?


Thanks in advance.


Adding as well a second question:

https://www.theice.com/marketdata/reports/13

As seen in the report reachable on this link, a good part of the volumes in options are going through blocks. Can you please explain to me how to get those volumes? What fields should I use? Thanks.

eikoneikon-data-apipythonapidate
icon clock
10 |1500

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

1 Answer

· Write an Answer
Upvotes
32.2k 40 11 19

Hello @emmanuel.chaslin ,

On your first question, the issue appears to be specific to this instrument. Because:

from datetime import datetime
from datetime import timedelta
lst_dt = (datetime.now() - timedelta(days=1)).strftime("%Y-%m-%d")
fst_dt = (datetime.now() - timedelta(days =5)).strftime("%Y-%m-%d")

list_rics = ['1SB2175E2']
list_fields_1 = ['TR.AccumulatedVolume.date','TR.AccumulatedVolume']

print("load data from",fst_dt,"to",lst_dt)

df_a,e = ek.get_data(list_rics,list_fields_1, {'SDate':fst_dt,'EDate':lst_dt})
print(df_a)

results in

load data from 2022-04-01 to 2022-04-05
  Instrument                  Date  Accumulated Volume
0  1SB2175E2  2022-03-23T00:00:00Z                  49

while:

from datetime import datetime
from datetime import timedelta
lst_dt = (datetime.now() - timedelta(days=1)).strftime("%Y-%m-%d")
fst_dt = (datetime.now() - timedelta(days =5)).strftime("%Y-%m-%d")

list_rics = ['IBM']
list_fields_1 = ['TR.AccumulatedVolume.date','TR.AccumulatedVolume']

print("load data from",fst_dt,"to",lst_dt)

df_a,e = ek.get_data(list_rics,list_fields_1, {'SDate':fst_dt,'EDate':lst_dt})
print(df_a)

results in:

load data from 2022-04-01 to 2022-04-05
  Instrument                  Date  Accumulated Volume
0        IBM  2022-04-01T00:00:00Z             4012373
1        IBM  2022-04-04T00:00:00Z             2811100
2        IBM  2022-04-05T00:00:00Z             3107181

So am going to get this looked into by product development, will get back with information when available, thanks for your patience!

---

For your second question, it is always better to ask separate question separately as this makes them easily findable an referenceable.

This question is on Eikon content and Eikon content experts will be the best resource to engage. Suggest to submit directly via Refinitiv Helpdesk Online -> Content -> Eikon and inquiry into obtaining this data via Eikon Excel. Once you have the Excel formula, it can usually be translated into EDAPI calls and we can help with that. Try to provide the complete details of the content that you require to identify, and not to mention that you have an API question or issue, in order to avoid being routed back to this forum.

icon clock
10 |1500

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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