question

Upvotes
Accepted
1 0 0 1

Setting TickHistoryTimeAndSalesExtractionRequest.Condition.DateRangeTimeZone="UTC" has no effect on SFCJ0

Hello,


I am requesting TickHistoryTimeAndSalesExtractionRequest for SFCJ0 for time range between 2020-04-01T00:00:00.000000000Z and 2020-04-01T23:59:59.999999999Z:

The data I receive starts at 2020-04-01T04:00:01.012562364Z and end at 2020-04-02T03:59:58.911651052Z, I would expect it to start at or after (near) 2020-04-01T00:00:00.000000000Z and end before (near) 2020-04-02T00:00:00.000000000Z, because I set DateRangeTimeZone = "UTC", ReportDateRangeType = ReportDateRangeType.Range, MessageTimeStampIn = TickHistoryTimeOptions.GmtUtc.


Am I doing anything wrong? I use the latest available version of RESTAPIToolkit for .NET.

var extractionRequest = new TickHistoryTimeAndSalesExtractionRequest
                {
                    IdentifierList = new InstrumentIdentifierList
                    {
                        InstrumentIdentifiers = new[]
                        {
                            new InstrumentIdentifier
                            {
                                Identifier = "SFCJ0",
                                IdentifierType = IdentifierType.Ric
                            }
                        },
                        ValidationOptions = new InstrumentValidationOptions
                        {
                            AllowHistoricalInstruments = true
                        },
                        UseUserPreferencesForValidationOptions = false
                    },
                    Condition = new TickHistoryTimeAndSalesCondition
                    {
                        ReportDateRangeType = ReportDateRangeType.Range,
                        TimeRangeMode = TickHistoryTimeRangeMode.Inclusive,
                        DateRangeTimeZone = "UTC",
                        QueryStartDate = DateTime.Parse("2020-04-01"),
                        QueryEndDate = DateTime.Parse("2020-04-01").AddDays(1).AddTicks(-1),
                        ApplyCorrectionsAndCancellations = false,
                        ExtractBy = TickHistoryExtractByMode.Ric,
                        MessageTimeStampIn = TickHistoryTimeOptions.GmtUtc,
                        SortBy = TickHistorySort.SingleByRic,
                        DisplaySourceRIC = false
                    },
                    ContentFieldNames = fields
                };
tick-history-rest-api
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hello @hrayr

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?


If so please can you click the 'Accept' text next to the appropriate reply. This will guide all community members who have a similar question.

Thanks,


AHS

@hrayr

Hi,

Please let us know if you have any update on this question.

If it is still an issue, please post again to offer further insight into your question.

Regards,

AHS

Upvotes
Accepted
11.3k 25 9 14

Hi @hrayr,

It could be due to the DateTime object you used for the QueryStartDate and QueryEndDate. The DateTime object somehow is converted using local timezone. The similar issue has been found here.

Please use DateTimeOffset instead.

QueryStartDate = new DateTimeOffset(2020, 4, 1, 0,0,0,System.TimeSpan.Zero), 
QueryEndDate = new DateTimeOffset(2020, 4, 1, 23, 23, 59, System.TimeSpan.Zero),
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
32.2k 40 11 20

Hello @hrayr,

I have retested with TRTH C# .Net Example Application,

Replaced IBM.N with SFCJ0 midified fields

 ContentFieldNames = new[]
                {
                    "Trade - Price",
                    "Trade - Volume",
                    "Trade - Exchange Tim
                }

and extended printed data.

I see result data T01:00:00 - T21:14:39. This is consistent with result I get via Postmen, testing same request for SFCJ0.

MessageTimeStampIn in your request is same as in example. The difference must be elsewhere in code, as the result you describe differs.

I think example is easy to try on your side and should allow to see if you get the expected result on your side, then can copy into your custom request?



icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.