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
Best Answer
-
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 !
0
Answers
-
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.
0 -
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 ?
0 -
get_timeseries() would be the appropriate equivalent. I will summarise the situation in a reply to the main question.
0 -
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.
1 -
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)
0 -
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_gridThe data of 2002-01-01 will be the data of 2001-12-31.
0 -
The result after applying a TR.CLOSEPRICE.calcdate field, and 'FILL':'PREVIOUS" parameter:
0 -
With Eikon Excel
0 -
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 content2. The API incorrectly formats the null data. I will contact the API team to verify this problem
0 -
The issue with null data being pushed to the bottom of the column is currently expected to be fixed by end of April.
0
Categories
- All Categories
- 6 AHS
- 39 Alpha
- 161 App Studio
- 4 Block Chain
- 4 Bot Platform
- 16 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 367 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 59 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛