question

Upvotes
Accepted
262 12 15 18

I am accessing TRTH v2 data using API and using python as main language

Case# 05661407

When I download data for a 'TickHistoryTimeAndSalesExtractionRequest' I receive timestamps expressed with microseconds precision. Data is stored under CSV column 'Date-Time' with microseconds pricision. 2017-07-04T06:00:00.125483119Z In the old TRTH we used to have two separate fields and we could express the format of the date using the following (C++ api) request.dateFormat = ns2__RequestDateFormat__YYYYMMDD; Date[G], Time[G] ,20170723,06:23:23.001 The format of the time is in milliseconds format.

Question:

1) how to tell TRTH v2 to provide DATE in format YYYYMMDD

2) how to tell TRTH v2 to provide timestamp in millisecond + same format of v1

3) how to split timestamps in 2 separate fields (Date[G] and Time[G])

pythontick-history-rest-apirest-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.

1 Answer

· Write an Answer
Upvotes
Accepted
13.7k 26 8 12

@Beera.Rajesh, using existing TRTH v2 API functionality, it is not possible to do what you request.

Side note: the date format can be specified, but only when you create a report template (not when you use an OnDemand request), and this only for the few fields of FormatType Date (like field "Trade - Date", which is not necessarily populated). But most time stamps are delivered in fields of FormatType Text (like "Trade - Exchange Time").

In other words, the solution is that you parse the returned data to deliver the formats you want.

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.