How can I return the corresponding dates in a timeseries query using Refinitiv Data Platform in p...

...ython?
Let s say I want to query the field TR.PriceClose on FRX.TO over the period 2019-05-31 and 2019-07-15. What should I do to get the timeseries of prices along with the corresponding dates?
When query ["TR.PriceCloseDate", "TR.PriceClose"] together the results do not seem to be aligned. I observe a very unstable behavior of the results depending of the time range I query. Sometimes I get duplicated dates with different prices. And sometimes the prices are shifted leaving NaN at the end of the time series.
Best Answer
-
Thank you very much for the code sample. And apologies for the confusion, I didn't realize you were using Datagrid endpoint on RDP, as it's not officially launched yet.
I see two issues here. One is duplicate rows returned for some dates like 2019-06-04. This issue is not specific to Datagrid service on RDP, and it is being investigated by Refinitiv Support as the case number 09625208.
The other issue is specific to Datagrid service on RDP and the situation when there are NULL values at the top of the result set. These values are being erroneously pushed to the bottom of the result set, and this is how you get the dates and the values misaligned in the response to the request with parameters2. This issue is a bug in the Datagrid service on RDP. I'm reporting it to the development team that owns the service. However, since the service is not officially launched and is not yet supported by Refinitiv Helpdesk, there's no case number for this issue.
0
Answers
-
I'm afraid I haven't been able to reproduce the dates and close prices not aligning or returning different values for duplicate dates when requesting
ek.get_data('FRX.TO',['TR.PriceCloseDate','TR.PriceClose'],
{'SDate':'2019-07-15','EDate':'2019-05-31'})If you have a specific example, where the dates and prices are not aligned or where different prices are returned for duplicate dates, it would be very helpful if you could share it.
What I have been able to reproduce is numerous duplicate rows returned in response to the above request. For this issue I opened a support case on your behalf with Refinitiv Helpdesk. Refinitiv Support will investigate the issue and keep you informed of the results of their investigation. For you reference the case number is 09625208.
0 -
I am using Refinitiv Data Platform Python API.
Here is the code I am using. You get different results for 2019-06-13 and 2019-06-14 for example depending on the timeframe requested (parameters1 or parameters2)import pandas as pd
import requests
import json
import rdpToken
RDP_version = '/beta1'
base_URL = 'https://api.refinitiv.com';
category_URL = '/data/datagrid'
endpoint_URL = '/'
url = base_URL + category_URL + RDP_version + endpoint_URL
parameters1 = {
'SDate': '2019-05-31',
'EDate': '2019-07-15',
'Frq': 'D',
}
parameters2 = {
'SDate': '2019-06-10',
'EDate': '2019-06-14',
'Frq': 'D',
}
requestData = {
'universe': ['FRX.TO'],
'fields': ['TR.PriceCloseDate', 'TR.PriceClose'],
'parameters': parameters2
}
accessToken = rdpToken.getToken()
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + accessToken
}
response = requests.post(url, headers=headers, data=json.dumps(requestData))
if response.status_code == 200:
jResp = json.loads(response.text)
columns = [x['name'] for x in jResp['headers']]
df = pd.DataFrame(jResp['data'], columns=columns)
print(df)0
Categories
- All Categories
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 684 Datastream
- 1.4K DSS
- 613 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 248 ETA
- 552 WebSocket API
- 37 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 275 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 629 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 26 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 191 TREP Infrastructure
- 228 TRKD
- 915 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 86 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛