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
Accepted

ek.get_data:

Hi,


I use ek.get_data to retrieve data of Open,High,Low,Close,OpenInterest,Volume, using

df, err = ek.get_data(
    instruments = ['LCOc1'],
    fields = ['TR.CLOSEPRICE.Date','TR.OPENPRICE','TR.HIGHPRICE','TR.LOWPRICE','TR.CLOSEPRICE',
              'TR.OPENINTEREST', 'TR.ACCUMULATEDVOLUME'],
    parameters = {'SDate':'2021-07-01'
                  , 'EDate': '2021-09-28'
                  , 'Frq':'D'}
)

Capture1.JPG

it seem like there is error for "Open Interes" data as there is data for 28SEP2021 which is 135673, please refer to the screenshot below that I retrieve only "Open Interest" data. I understand that this happen because there was a day that Open Interest is <NA> and there is something wrong about to sync data from all fields into a single table result.


If we use TR() function in excel we can put mode "Rh=Date" and it can handle this issue.

Is this a bug? Is there any workaround or other way to retrieve data ?


Please advise. Thank you

Vetit S.

df, err = ek.get_data(
    instruments = ['LCOc1'],
    fields = ['TR.OPENINTEREST.Date',
        'TR.OPENINTEREST'],
    parameters = {'SDate':'2021-07-01'
                  , 'EDate': '2021-09-28'
                  , 'Frq':'D'}
)
df

Capture2.JPG

eikon-data-api
capture1.jpg (83.3 KiB)
capture2.jpg (46.6 KiB)
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
Accepted
14.2k 30 5 10

@vaetit.sirasupprakchai1

As checked, there seems to be a problem with the TR.OPENINTEREST field which is returning a different date from the rest of the columns when the parameters are set as 'SDate':'2021-07-01', 'EDate': '2021-09-28' I tried putting parameters 'SDate' as '2021-07-01' and '2021-08-28', it looks fine, all dates are matched.

here's the screenshot comparing the results mentioned, the difference in the code is only SDate but in the output, date of TR.OPENINTEREST are different date-7-9.png

so I raised this issue as the case number 10502030 to helpdesk


date-7-9.png (86.5 KiB)
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.

@raksina.samasiri Thank you very much, will wait for the answer from help desk.

hi @vaetit.sirasupprakchai1 ,

The support team just updated me that the issue has been fixed, what happen was the data of July 30th was missing so the data was shifted. Plus content team is trying to figure out what's the problem and they will fix it.1633942433850.png

1633942433850.png (45.0 KiB)

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.