Issue when retrieving history using the Access Layer or Content Layer in Python
Hi All,
I recently noticed an issue when retrieving history data through the Access Layer or Content Layer functions of the Data Platform Libraries for a list of RICs. There seems to be an abnormally massive wait time (I stop the application from running after 5 minutes). I am forced to revert back to using the Eikon API since that works and retrieves the data within seconds.
The issue occurs when passing a list of 17 RICs. Even if iterated over individually, it still causes an issue. Below is the code for the Access Layer and Content Layer which does not work, finally followed by the code for the Eikon API which works without any issues.
Package being used: refinitiv-data==1.0.0b16
Connection Type: Desktop Session
Access Layer - Not Working
df_result = rd.get_history(
universe=ric,
start=sDate,
end=eDate,
interval='tick',
fields=['TRDPRC_1', 'TRDVOL_1']
)
Content Layer - Not Working
result = historical_pricing.events.Definition(
universe=ric,
start=sDate,
end=eDate,
fields=['TRDPRC_1', 'TRDVOL_1']
).get_data()
Eikon API - Working Fine
df_result = ek.get_timeseries(
rics=ric,
start_date=sDate,
end_date=eDate,
interval='tick',
fields=['Timestamp', 'value', 'Volume'],
raw_output=True
)
Some help on this would be greatly appreciated. Do let me know if you need anymore information which could help with this.
More Information:
Start/End Date
startDate = '7/14/2022 2:30 PM'
endDate = '7/14/2022 3:01 PM'
startDate = datetime.strptime(startDate , '%m/%d/%Y %I:%M %p')
endDate = datetime.strptime(endDate , '%m/%d/%Y %I:%M %p')
sDate = startDate.astimezone(pytz.UTC).replace(tzinfo=None)
eDate = endDate.astimezone(pytz.UTC).replace(tzinfo=None)
List of RICs
rics_underlying = ["ADCB.AD", "ADNOCDIST.AD", "AIRA.DU", "ALDAR.AD", "ARMX.DU",
"DEWAA.DU", "DFM.DU", "DISB.DU", "DINV.DU", "DU.DU", "EMAR.DU", "EMAARDEV.DU",
"ENBD.DU", "ETISALAT.AD", "FAB.AD", "GFH.DU", "SHUA.DU"]
Best Answer
-
When you loop, does each individual request take more than 5 minutes? Did you test a single request?
I just performed a test that covers a minute and the total number of events/rows returned is over 117,000! It's also worth noting that each RIC within the basket will not have matching events so when the final result is put together, the dataframe will have a numerous number of rows.
For example, try this to see the results:
sDate = "2022-07-14T10:30:00.0000000Z"
eDate = "2022-07-14T10:31:00.0000000Z"
rd.get_history(rics_underlying, interval='tick', start=sDate, end=eDate)Because you are retrieving tick data, you may be better off requesting for individual RICs.
Another thing to consider is whether you need all fields in the response - you may only be looking at a few so this may affect the resulting time it takes and the size of the dataframe returned.
Can you share the code segment you are using to retrieve the same data via the Eikon Data API that only takes seconds?
0
Answers
-
Hi @prasad.acharya1
Can you provide more information.
- What specific issue are you encountering? Does the call time out - you mention it takes a very long time. Or is the data that does come back incorrect? Are you getting an error message? etc
- Can provide the list of 17 RICs? And the start and end dates you are using in your tests?
- Can you elaborate on "iterated over individually"? You mean you are passing in a single RIC instead of a batch of 17?
Have you looked at the examples provide within GitHub?
0 -
Hi @nick.zincone ,
Thank you for responding on this!
1. It just keeps loading, I interrupt the application after 5minutes since that is already too long. No timeout, no error message, no data.
2. Information has been added to the question.
3. Yes, using a for loop for each RIC.
Seen all the examples, but none refer to using historical_pricing.events with multiple RICs and specific fields.0 -
Yes, I faced the issue also when iterating single requests.
This is the code used through the Eikon Data API:
df_result = ek.get_timeseries(
rics=ric,
start_date=sDate,
end_date=eDate,
interval='tick',
fields=['Timestamp', 'value', 'Volume'],
raw_output=True
)I shall try out the code mentioned above and get back as soon as I can, thank you!
0 -
Hi @nick.zincone ,
Thank you for this, it works well, the only issue seems to be that it takes longer to complete execution.
Runtime using rd.get_history: 50 seconds
Runtime using ek.get_timeseries: 20 secondsAccording to the above approximate recorded runtimes, seems like ek.get_timeseries is able to retrieve data alot faster than rd.get_history.
Is there any other way using rdp that I can retrieve historic data atleast at the same speed? Maybe as bulk data for the defined set of RICs?
This would help alot if there are a set of 60 RICs (e.g. equity futures for each of the rics in rics_underlying), and need to get bid and ask historic tick data for it.
0 -
Can you provide the actual ric list you are using for get_timeseries()? According to my tests, most of the RICs you provided do not have data.
0 -
Hi @nick.zincone , the RIC list is the same as provided in the question. Probably an issue with the start date and time.
Just tested now and I am able to retrieve the data. Please use the Start/End Date code section mentioned in the question. It converts the timezone to UTC.
0
Categories
- All Categories
- 6 AHS
- 37 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 中文论坛