question

Upvotes
Accepted
7 2 2 6

Incorrect date decoded for TS1 data

I am getting incorrect snap time when query for the intraday summary from TRTH. I am making use of the sample "TRTH_OnDemand_IntradayBars.py" and using the dash framework to prompt for the start_time and end_time input.

app = dash.Dash(__name__, external_stylesheets=external_stylesheets)
app.layout = html.Div([
.............   
html.Details([
        html.Summary('Time (Default Time:00:00:00)'),
        html.H6("Start Date Time:"),
        dcc.Slider(
            id="my-starttime-slider",
            min=0,
            max=23,
            step=1,
            marks= {i: "" for i in range(23)},
            value=0),
        dcc.Slider(
            id="my-endtime-slider",
            min=0,
            max=23,
            step=1,
            marks= {i: "" for i in range(23)},
            value=0),
    html.P(id="start_time"),
    html.P(id="end_time")
@app.callback(
    [Output("start_time", "children")],
    [Input("my-starttime-slider", "value")]
)
def show_start_time(time):
    start_time = "{}:00:00".format(time)
    return ["Start Date Time: {}".format(start_time)]


@app.callback(
    [Output("end_time", "children")],
    [Input("my-endtime-slider", "value")]
)
def show_end_time(time):
    endtime = "{}:00:00".format(time)
    return ["End Date Time: {}".format(endtime)]

Below is the capture compare using my script (top) and from DS (bottom). From my script the start time of the result capture starts at Nov 25 @22:00 which is incorrect vs the DS report at 0900


Stock - 0005.HK

Summary Interval - OneHour

Query Date - Nov 25

Start time - 0900

End time - 1600

Message time stamp - LocalExchangeTime


I also write the requestBody out to an output file below and the query string looks correct.

{'ExtractionRequest': {'@odata.type': '#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.TickHistoryIntradaySummariesExtractionRequest', 'ContentFieldNames': ['Close Ask', 'Close Bid', 'High Ask', 'High Bid', 'Low Ask', 'Low Bid', 'High', 'Last', 'Low', 'Open', 'Open Ask', 'Open Bid', 'Volume', 'No. Trades', 'No. Asks', 'No. Bids'], 'IdentifierList': {'@odata.type': '#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.InstrumentIdentifierList', 'InstrumentIdentifiers': [{'Identifier': '0005.HK', 'IdentifierType': 'Ric'}], 'UseUserPreferencesForValidationOptions': 'false'}, 'Condition': {'MessageTimeStampIn': 'LocalExchangeTime', 'ReportDateRangeType': 'Range', 'QueryStartDate': '2019-11-25T09:00:00.000Z', 'QueryEndDate': '2019-11-25T16:00:00.000Z', 'SummaryInterval': 'OneHour', 'TimebarPersistence': 'true', 'DisplaySourceRIC': 'true'}}}
tick-history-rest-apirest-apits1
my-capture.png (29.4 KiB)
ds-capture.png (25.8 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.

Upvote
Accepted
11.3k 25 8 13

Hi @KAKIT.LAI,

It seems that the issue is related to timezone of the query range. If you want to specify the timezone of the QueryStartDate and QueryEndDate, you can add "DateRangeTimeZone": "Local Exchange Time Zone" in the Condition of the request body. Below is the sample.

"Condition": 
{
    "MessageTimeStampIn": "LocalExchangeTime", 
    "ReportDateRangeType": "Range", 
    "QueryStartDate": "2019-11-25T09:00:00.000Z", 
    "QueryEndDate": "2019-11-25T16:00:00.000Z", 
    "DateRangeTimeZone": "Local Exchange Time Zone", 
    "SummaryInterval": "OneHour", 
    "TimebarPersistence": "true", 
    "DisplaySourceRIC": "true"
}

If the issue still persists, please provide the entire requestBody generated by your script.

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.

Upvotes
7 2 2 6

Thanks I am missing the "DateRangeTimeZone" in the condition. Add this back and it fixed the issue. What is the value I should use for GMT under "DateRangeTimeZone"?

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.

Upvote
11.3k 25 8 13
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.

Upvotes
7 2 2 6

I noticed another issue. I tried to generate the following

Stock - 0005.HK
Date - Nov 25, 2019
DateRangeTimeZone: Local Exchange Time
MessageTimeStampIn: Local Exchange Time
Summary Interval - OneMinute
Start time - 09:00:00
End time - 11:59:00


From DS the following is the output I extraced between 0900 - 09:38

The following is from my script

I noticed between 09:20 to 0930 there was no quote updated so my script just print out the duplicate line between 09:20 - 09:29. How can I fix this?


ds.png (87.7 KiB)
myscript.png (98.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.

Upvotes
7 2 2 6

I noticed a few "extra' update observed between 09:02 - 09:17 as well. Here's are all the extra updated highlighed.


From DS

From my script


ds.png (84.2 KiB)
myscript2.png (81.6 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.

Upvote
11.3k 25 8 13

Hi @KAKIT.LAI,

I would suggest you submit a new question for another issue so that the question is visible for other users.

Anyway, the different result you found is related to the "TimebarPersistence" condition in the request. Please set "TimebarPersistence" to false to generate the same result as DS.

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.

Upvotes
7 2 2 6

Thanks Veerapath this is fixed after I set "TimebarPersistence" to false. I will raise another ticket if I have any further question.

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.

Click below to post an Idea Post Idea