QueryStartDate and QueryEndDate timezone in TickHistoryTimeAndSalesExtractionRequest condition
I have been using the TRTH v2 RESTful API for a while to retrieve time and sales data. Recently we found that the data we retrieved no longer match what we requested. Upon investigation, it seems that the QueryStartDate and QueryEndDate in the condition field of the query is now interpreted in local timezone rather than in UTC, despite that we have specified it in the same universal time format as before (i.e., with a "Z" suffix), and it is also what is suggested in the document. The "document" refers to "User Guide for Tick History 11.3 REST API" found at https://developers.thomsonreuters.com/thomson-reuters-tick-history-trth/thomson-reuters-tick-history-trth-rest-api/docs?content=11928&type=documentation_item (see Chapter 8, page 54).
The "Z" suffix is commonly known as the UTC designator (https://www.w3.org/TR/NOTE-datetime), so if the example in the documentation contain that suffix, I expect that the datetime string is specified in UTC. And it actually has been the case before.
Is it a bug introduced in recent version?
FYI, Here is the full request body we sent:
'{"ExtractionRequest": {"@odata.type": "#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.TickHistoryTimeAndSalesExtractionRequest", "ContentFieldNames": ["Trade - Price", "Trade - Accumulated Volume", "Trade - Volume", "Trade - Market VWAP", "Trade - Qualifiers", "Quote - Bid Price", "Quote - Bid Size", "Quote - Ask Price", "Quote - Ask Size", "Quote - Qualifiers", "Auction - Price", "Auction - Volume", "Auction - Qualifiers", "Correction - Original Price", "Correction - Original Volume", "Correction - Qualifiers", "Correction - Price", "Correction - Volume", "Quote - 30 Day ATM IV Call", "Quote - 60 Day ATM IV Call", "Quote - 90 Day ATM IV Call", "Quote - 30 Day ATM IV Put", "Quote - 60 Day ATM IV Put", "Quote - 90 Day ATM IV Put", "Market Conditions - Qualifiers", "Correction - Exchange/Contributor ID"], "Condition": {"ApplyCorrectionsAndCancellations": false, "QueryStartDate": "2018-03-13T08:00:00Z", "QueryEndDate": "2018-03-13T09:00:00Z", "ReportDateRangeType": "Range", "SortBy": "SingleByTimestamp", "MessageTimeStampIn": "GmtUtc", "DisplaySourceRIC": true}, "IdentifierList": {"@odata.type": "#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.InstrumentIdentifierList", "InstrumentIdentifiers": [{"Identifier": "0#CL:", "IdentifierType": "ChainRIC"}], "ValidationOptions": {"AllowHistoricalInstruments": true}, "UseUserPreferencesForValidationOptions": false}}}'
And here are what we found in the resulting notes text:
Extraction Services Version 11.3.38483 (495cc9d47079), Built Mar 8 2018 22:15:21
User ID: 9013345
Extraction ID: 2000000021735140
Schedule: 0x061de3616bfb2f96 (ID = 0x0000000000000000)
Input List (1 items): (ID = 0x061de3616bfb2f96) Created: 2018-03-28 09:10:18 Last Modified: 2018-03-28 09:10:18
Report Template (26 fields): _OnD_0x061de3616bfb2f96 (ID = 0x061de36178ab2f96) Created: 2018-03-28 09:05:14 Last Modified: 2018-03-28 09:05:14
Schedule dispatched via message queue (0x061de3616bfb2f96), Data source identifier (67BE977CC50946058D5E1FD88204895C)
Schedule Time: 2018-03-28 09:05:17
Processing started at 2018-03-28 09:05:17
Processing completed successfully at 2018-03-28 09:10:18
Extraction finished at 2018-03-28 01:10:18 UTC, with servers: tm01n01, TRTH (101.855 secs)
Instrument <CHR,0#CL:> expanded to 107 RIC instances: CLF0 to CLZ9.
Quota Message: INFO: Tick History Futures Quota Count Before Extraction: 14; Instruments Approved for Extraction: 1; Tick History Futures Quota Count After Extraction: 14, 41.1764705882353% of Limit; Tick History Futures Quota Limit: 34
Manifest: #RIC,Domain,Start,End,Status,Count
Manifest: CLF0,Market Price,2018-03-13T00:00:30.840897962Z,2018-03-13T00:59:37.979349209Z,Active,191
Manifest: CLF1,Market Price,,,Inactive,0
Manifest: CLF2,Market Price,,,Inactive,0
Manifest: CLF24,Market Price,,,Inactive,0
Manifest: CLF25,Market Price,,,Inactive,0
Manifest: CLF26,Market Price,,,Inactive,0
Manifest: CLF27,Market Price,,,Inactive,0
Manifest: CLF3,Market Price,,,Inactive,0
Manifest: CLF9,Market Price,2018-03-13T00:00:00.297905008Z,2018-03-13T00:59:44.306972932Z,Active,4047
Manifest: CLG0,Market Price,,,Inactive,0
Manifest: CLG1,Market Price,,,Inactive,0
...
Note that while the request is for data between "2018-03-13T08:00:00Z" and "2018-03-13T09:00:00Z", what we actually received are data between 2018-03-13T00:00Z and 2018-03-13T00:59Z.
Best Answer
-
Hi @kkto,
This could be due to the Data Range Time Zone issue fixed in TRTH REST API 11.3 release. You can refer to this advisory.
In release 11.3 (available on January 8, 2018), the "QueryStartDate" and "QueryEndDate" parameter use the Time Zone set in your user preferences. You can also set the timezone via the DateRangeTimeZone parameter in the request.
Below is the sample value of UTC time, if you want to set the QueryStartDate and QueryEndDate in UTC.
"Condition": {
...
"DateRangeTimeZone": "UTC"
}0
Answers
-
It does fix the problem. Thanks a lot!
May I also ask where is the setting documented, and what are the permissible values of the setting?
0 -
It does fix the problem. Thanks a lot!
May I also ask where is the DateRangeTimeZone setting documented, and what are the permissible values of the setting?
0 -
The available parameters are defined in the REST API Reference Tree. The value of the DateRangeTimeZone can be either .Net Timezone ID or .Net Timezone Name. However, some time zone names are unsupported, so the .Net Timezone ID is recommended to be used. I can get the available .Net Timezone IDs in my machine. The list is attached.
For more information:
0 -
Although I accept the answer, I think we still need an update to the API manual. In particular, if the timestamp is not in UTC, it should not be suffixed with a "Z" character in the example request. The DateRangeTimeZone parameter should also be described somewhere.
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
- 60 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛