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

image

image


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'}}}

Welcome!

It looks like you're new here. Sign in or register to get started.

Best Answer

  • 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.

Answers

Welcome!

It looks like you're new here. Sign in or register to get started.

Welcome!

It looks like you're new here. Sign in or register to get started.