question

Upvotes
Accepted
5 0 0 3

Does RFA data supports HH:MM:SS.MMM

Does RFA data and/or RFA API support HH:MM:SS.MILLISECONDS for time format? What data type to use RDM Field Dictionary ? Thanks

rfarfa-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 @support6

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

1 Answer

· Write an Answer
Upvotes
Accepted
79.2k 251 52 74

@support6

Yes, RFA supports milliseconds. The fields are:

TRDTIM_MS  "TRDTIM MS"           3853  NULL        INTEGER            15  UINT64           4
!
! Time of regular trades in milliseconds
!
SALTIM_MS  "SALTIM MS"           3854  NULL        INTEGER            15  UINT64           4
!
! Time of the last trade with precision in milliseconds - the time of the last update 
! to the field TRDPRC_1 (FID 6).
!
QUOTIM_MS  "QUOTIM MS"           3855  NULL        INTEGER            15  UINT64           4
!
! Time of best bid/ask quote update in milliseconds
!

The data type of these fields is unsigned integer 64bit which represents the number of milliseconds since midnight. You can use the below logic to convert it to HH:MM:SS.MMM.

int msec = time_ms%1000;
int seconds = (((int)(time_ms/1000)) % 60); 
int minutes = (((int)(time_ms/60000)) % 60); 
int hours = (((int)(time_ms/3600000)) % 24); 

Moreover, RFA supports nanoseconds via the following fields.

ASK_TIM_NS "ASK TIME NS"        14263  ASK_TM2_NS  INTEGER            15  TIME             8
!
! Time of best ask quote update - self describing timestamp supporting up to 
! nanosecond granularity
!
BID_TIM_NS "BID TIME NS"        14264  BID_TM2_NS  INTEGER            15  TIME             8
!
! Time of best bid quote update - self describing timestamp supporting up to 
! nanosecond granularity
!
QUOTIM_NS  "QUOTIM NS"          14265  QUOTIM2_NS  INTEGER            15  TIME             8
!
! Time of best bid/ask quote update - self describing timestamp supporting up to 
! nanosecond granularity
!
SALTIM_NS  "SALTIM NS"          14266  SALTIM2_NS  INTEGER            15  TIME             8
!
! Time of the last eligible trade - the time of the last update to the field TRDPRC_1 
! (FID 6). - self describing timestamp supporting up to nanosecond granularity

However, the availability of these fields depends on exchanges. The OMM type of the nanosecond fields is TIME. For more information, please refer to the Coding For High Precision Time article.

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.