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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
7 0 0 0

Confusion for get_data() function result

Hi all,


I am using python api to get daily volume and auction volume for instrument. However, I have confusing result as follow:


search_field =

['TR.Volume',

'TR.Volume.date',

'TR.Turnover',

'TR.NUMBEROFTRADES',

'TR.OPENINGAUCTIONVOLUME',

'TR.CLOSINGAUCTIONVOLUME',

'TR.INTRADAYAUCTIONVOLUME',

'TR.OPENINGAUCTIONPRICE',

'TR.CLOSINGAUCTIONPRICE',

'TR.INTRADAYAUCTIONPRICE']


result1 =

ek.get_data(['CFCG.DE'],search_fields,

{'SDate': '2020-03-02','EDate': '2020-03-05','Frq': 'D' })


result1

( Instrument Volume Date Turnover Number of Trades \

0 CFCG.DE 5188 2020-03-02T00:00:00Z 5468.40 4

1 CFCG.DE 10701 2020-03-03T00:00:00Z 11688.65 7

2 CFCG.DE 3400 2020-03-04T00:00:00Z 3830.00 2

3 CFCG.DE 20765 2020-03-05T00:00:00Z 21014.45 8


Opening Auction Volume Closing Auction Volume Intraday Auction Volume \

0 1089.0 NaN NaN

1 1277.0 NaN 40.0

2 NaN NaN 8517.0

3 NaN NaN NaN


Opening Auction Price Closing Auction Price Intraday Auction Price

0 1.05 1.020 NaN

1 1.00 1.070 1.11

2 NaN 1.100 1.01

3 NaN 0.995 NaN , None)


result2 =

ek.get_data(['CFCG.DE'],search_fields,

{'SDate': '2020-03-02','EDate': '2020-03-04','Frq': 'D' })


( Instrument Volume Date Turnover Number of Trades \

0 CFCG.DE 5188 2020-03-02T00:00:00Z 5468.40 4

1 CFCG.DE 10701 2020-03-03T00:00:00Z 11688.65 7

2 CFCG.DE 3400 2020-03-04T00:00:00Z 3830.00 2


Opening Auction Volume Closing Auction Volume Intraday Auction Volume \

0 1089.0 NaN NaN

1 1277.0 NaN 40.0

2 NaN NaN NaN


Opening Auction Price Closing Auction Price Intraday Auction Price

0 1.05 1.02 NaN

1 1.00 1.07 1.11

2 NaN 1.10 NaN , None)


result3 = vol= ek.get_data(['CFCG.DE'],search_fields,

{'SDate': '2020-03-04','EDate': '2020-03-04','Frq': 'D' })


( Instrument Volume Date Turnover Number of Trades \

0 CFCG.DE 3400 2020-03-04T00:00:00Z 3830 2


Opening Auction Volume Closing Auction Volume Intraday Auction Volume \

0 NaN NaN NaN


Opening Auction Price Closing Auction Price Intraday Auction Price

0 NaN 1.1 NaN , None)


Let us focus for date 2020-03-04 for result1,result2 and result3. As it can be seen at the above, the data for this particular date are consistent for result1, result2 and result3 except for Intraday Auction Volume. For result1, the intraday auction volume is 8517 for date 2020-03-04, while for result2 and result3 they are both NaN (no volume). This is inconsistent in my opinion as they are all supposed to be the same regardless how many dates I extract from the get_data() function. Kindly need your help. Thanks.


eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpython
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.

1 Answer

Upvotes
Accepted
18k 21 12 20

Hi @YunaValianta.Aulia

The 8517 value is for 2020-03-05.


ahs.png (36.7 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.

Hi @chavalit.jintamalit

So does it mean I cant search for multiple field with get_data()? For example I want to find at once TR.Volume and TR.INTRADAYTURNOVER? I tried:

result1 = ek.get_data(['CFCG.DE'],['TR.Volume.date','TR.Volume','TR.INTRADAYAUCTIONVOLUME.date','TR.INTRADAYAUCTIONVOLUME'],{'SDate':'2020-03-02','EDate': '2020-03-06', 'Frq':'D'})


But this results in two columns with the same name 'Date' such that python is unable to separate which date belongs to which field.


My second question, in your answer when we search for result between 2020-03-02 to 2020-03-05, why eikon API simply skips 2020-03-04 entirely? Why cant it keep 2020-03-04 in the data frame and gives result as NaN?


Many thanks.

Hi @YunaValianta.Aulia

You can use get_data() to request for multiple fields but if the fields are from different databases, the date may not be aligned.

TR.Volume and TR.INTRADAYAUCTIONVOLUME are from different databases.

Please see this post for more information, https://community.developers.refinitiv.com/questions/56148/how-to-sort-an-ekget-data-request-by-instrument-an.html


For second question:

If there is no data point, there will be no record.

For example:

ahs.png (44.6 KiB)
1584446866202.png (29.8 KiB)
Click below to post an Idea Post Idea