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
25 5 4 5

Missing datas with two dates (EDate, SDate)

Hello,

I have a misunderstanding between two Eikons queries (get_data) :

data_grid, err = ek.get_data("CHRW.OQ", fields=['TR.HIGHPRICE','TR.PriceClose','TR.LOWPRICE','TR.PriceOpen','TR.Volume','TR.BIDPRICE','TR.ASKPRICE','TR.HIGHPRICE.date'], parameters={'SDate':'2006-10-09'})
print (data_grid.T)
data_grid, err = ek.get_data("CHRW.OQ", fields=['TR.HIGHPRICE','TR.PriceClose','TR.LOWPRICE','TR.PriceOpen','TR.Volume','TR.BIDPRICE','TR.ASKPRICE','TR.HIGHPRICE.date'], parameters={'SDate':'2006-10-06','EDate':'2006-10-09'})
print (data_grid.T)

The first one returns all the data for the RIC "CHRW.OQ" of 2006-10-09 and the second one returns to me the data for the RIC "CHRW.OQ" from 2006-10-06 to 2006-10-09.

Except that the second command does not return me all the data for the 2006-10-09 I miss "PriceClose"; "Price Open"; "Volume"; .. Yet I get all the datas with the first command.

Why do I miss data when I ask with two dates?

Thanksdata.png

eikoneikon-data-apipythonrefinitiv-dataplatform-eikonworkspaceworkspace-data-api
data.png (40.1 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.

Thank you for your participation in the forum. Are the replies below satisfactory in resolving your query? If yes please click the 'Accept' text next to the reply. This will guide all community members who have a similar question. Otherwise please post again offering further insight into your question.
Thanks,
-AHS

Upvotes
Accepted
25 5 4 5

Hi,

Thank for your help !!

I have an equivalent problem for another ric and unfortunately your solution does not work in all cases. Can you help me ?

fields=['TR.CLOSEPRICE.date', 'TR.HIGHPRICE', 'TR.LOWPRICE','TR.ACCUMULATEDVOLUME', 'TR.OPENPRICE', 'TR.CLOSEPRICE', 'TR.BIDPRICE', 'TR.ASKPRICE']
parameters={'SDate':'2000-01-01', 'EDate':'2017-12-15', 'Frq' : 'D' }
data_grid, err = ek.get_data("CHTR.OQ", fields=fields, parameters=parameters)
print(data_grid.T) 

I get the prices for 2000-01-04.

fields=['TR.CLOSEPRICE.date', 'TR.HIGHPRICE', 'TR.LOWPRICE','TR.ACCUMULATEDVOLUME', 'TR.OPENPRICE', 'TR.CLOSEPRICE', 'TR.BIDPRICE', 'TR.ASKPRICE']
parameters={'SDate':'2000-01-04', 'EDate':'2000-01-04', 'Frq' : 'D'}
data_grid, err = ek.get_data("CHTR.OQ", fields=fields, parameters=parameters)
print(data_grid.T) 

I don't get the prices for 2000-01-04. Why ??

and on Eikon Excel I don't get a prices for 2000-01-04 ... see next attachment.

Thanks !


cas1.png (154.8 KiB)
cas2.png (24.7 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.

With Eikon Excel

excel.png (298.7 KiB)

Thank you so much for the update.

From the result, there are two issues here.

1. There is no historical data of CHTR.OQ from 01/01/2000 to 9/13/2010. For this problem, you can directly contact the Eikon support team to verify the content

2. The API incorrectly formats the null data. I will contact the API team to verify this problem

Contacted Iain Scott and Pierre Faurel to verify the problem.

The issue with null data being pushed to the bottom of the column is currently expected to be fixed by end of April.

Upvotes
78.8k 250 52 74

I can replicate this issue with Eikon Excel by using this formula.

=TR("CHRW.OQ","TR.HIGHPRICE;TR.PriceClose;TR.LOWPRICE;TR.PriceOpen;TR.Volume;TR.BIDPRICE;TR.ASKPRICE;TR.HIGHPRICE.date","Frq=D SDate=2006-10-06 EDate=2006-10-09 CH=Fd RH=IN",E5)

Both Eikon Excel and Eikon Data API get the NULL values so the problem should be in Eikon, not API.

Could you please contact Eikon team to verify the problem? You can submit a case to Eikon team by using Contact Us.


excel.png (10.4 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.

I contacted the support who provided me the command for Excel.

=RHistory("CHRW.OQ","NDA_RAW.Nda_date;"&"NDA_RAW.Nda_high;"&"NDA_RAW.Nda_low;"&"NDA_RAW.Nda_volume;"&"NDA_RAW.Nda_open;"&"NDA_RAW.Nda_last;"&"NDA_RAW.Nda_bid;"&"NDA_RAW.Nda_ask","START:06-Oct-2006 END:09-Oct-2006 INTERVAL:1D",,"CH:Fd",B2)

But the support is unable to provide me the command for Python (Eikon API Proxy).

The equivalent of "= RHistory" is get_data or get_timeseries ?

get_timeseries() would be the appropriate equivalent. I will summarise the situation in a reply to the main question.

Upvote
4.6k 26 7 22

The reason for the results seems to be in the way which fields you selected to use. If you use the fields from the Time Series Data interface (Data Item Browser or DIB app on Eikon, filter > Content Classification > Time series data), the following list of fields will be produced:

fields = ['TR.CLOSEPRICE.date','TR.CLOSEPRICE','TR.ACCUMULATEDVOLUME','TR.BIDPRICE','TR.ASKPRICE','TR.HIGHPRICE','TR.LOWPRICE','TR.OPENPRICE']

Then the API will return the correctly formatted response:

It is a little confusing, I know, but here is a good mnemonic, that you can utilise when selecting the fields:

  • Not prefixed with 'TR.', capitalised - real-time system fields, such as BID, ASK, TRDPRC_1, etc. what you can see in the Quote app in Eikon.
  • Prefixed with 'TR.', camel case - reference data fields, such as TR.Volume, TR.AssetLocationLatitude, TR.FiMaturityDate, etc;
  • Prefixed with 'TR.', capitalised - time series data through the reference db interface, such as the fields used in my example.

You can also use .get_timeseries() in Python for a pure time series API. There is a limitation in the Python API beta, when you can use only a default set of fields (we call this as "view"). The default view for equities is the trade price (TRDPRC_1), so you will only get OHLC + Volume + Count, but not bid or offer. In Excel you can request other views, such as NDA_RAW, which was recommended to you by the support desk specialist.


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.

Upvotes
25 5 4 5

missing-data.pngHi @Zhenya Kovalyov,

Thanks for your return !

If I use your command with different dates I get the same issue :

fields=['TR.CLOSEPRICE.date', 'TR.HIGHPRICE', 'TR.LOWPRICE','TR.ACCUMULATEDVOLUME', 'TR.OPENPRICE', 'TR.CLOSEPRICE', 'TR.BIDPRICE', 'TR.ASKPRICE']
parameters={'SDate':'2002-01-01', 'EDate':'2002-12-31', 'Frq' : 'D'}
data_grid, err = ek.get_data("AAPL.O", fields=fields, parameters=parameters)
data_grid.to_csv(fileName, mode='a', sep=';', index=False) 
fields=['TR.CLOSEPRICE.date', 'TR.HIGHPRICE', 'TR.LOWPRICE','TR.ACCUMULATEDVOLUME', 'TR.OPENPRICE', 'TR.CLOSEPRICE', 'TR.BIDPRICE', 'TR.ASKPRICE']
parameters={'SDate':'2002-12-01', 'EDate':'2002-12-31', 'Frq' : 'D'}
data_grid, err = ek.get_data("AAPL.O", fields=fields, parameters=parameters)
data_grid.to_csv(fileName, mode='a', sep=';', index=False) 

The last line of the first command is empty, why ?. There is a limit? (See my attchment)


missing-data.png (478.1 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.

Upvotes
78.8k 250 52 74

I have verified it with Eikon Excel and found that there is no data available for 2002-01-01.

However, the result from the API is shifted upward. The data of 2002-01-01 belongs to 2002-01-02.

The workaround is using a TR.CLOSEPRICE.calcdate field, and 'FILL':'PREVIOUS" parameter.

fields=['TR.CLOSEPRICE.date','TR.CLOSEPRICE.calcdate','TR.HIGHPRICE', 'TR.LOWPRICE','TR.ACCUMULATEDVOLUME', 'TR.OPENPRICE', 'TR.CLOSEPRICE', 'TR.BIDPRICE', 'TR.ASKPRICE']
parameters={'SDate':'2002-01-01', 'EDate':'2002-12-31', 'Frq' : 'D','CH':'Fd','RH':'IN','FILL':'PREVIOUS' }
data_grid, err = ek.get_data("AAPL.O", fields=fields, parameters=parameters)
data_grid

The data of 2002-01-01 will be the data of 2001-12-31.


aapl-api.png (10.6 KiB)
aapl.png (12.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.

The result after applying a TR.CLOSEPRICE.calcdate field, and 'FILL':'PREVIOUS" parameter:

aapl-fix.png (11.3 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.