question

Upvotes
Accepted
36 6 1 14

How to fetch time stamp in response message of a Stock Ric

Greetings everyone!

On behalf of one Chinese client, could I ask a question about timestamp, the RIC is JD.NB.

In their client application, they tried to use FID=378 or FID=18 to fetch the timestamp of any stock info update. But seems not every response message contains timestamp from those two FIDs. As followed is one example client provided, could I ask which FID we should use to get timestamp for every response message? Or what is the normal practice for such a requirement?

Thank you very much in advance!

---

MESSAGE

ServiceName:ELEKTRON_DD

Name:JD.NB

NameType:1

RIC INFO:

14206/BLKTIM_MS: Fri Feb 19 01:00:27 CST 2016

6908/BLKTRDVOL: 9000

13551/PRE_2ET230: 43

3422/PROV_SYMB: JD

6401/DDS_DSO_ID: 8202

1/PROD_PERM: 7944

3183/LIST_MKT: Q

728/BCAST_REF: JD.O

11641/PRE_4TX084: @

7065/PRE_INT186: 30

13437/PRE_2ET116: 1

12820/IPO_FLAG: N 2

1404/ODD_VOLUME: 94322.0

8311/BCASTREF32: JD.O

4760/THRESH_IND: 11

8493/PRE_4TX046: XNAS

373/IRGVOL: 300.0

43/BLKVOLUM: 181412.0

14/PRCTCK_1: ?1

13552/PRE_2ET231: 1354

3308/CLASS_CODE: A

19/OPEN_PRC: 25.9

8992/CAN_EXID: 0

21/HST_CLOSE: 25.72

3598/CRSTRD_PRC: 25.9

8980/IRG_EXID: 1354

42/BLKCOUNT: 10.0

198/LOT_SIZE_A: 100.0

6577/SH_SAL_RES: N1

6480/SPS_SP_RIC: .[SPSNB3

1080/PREF_DISP: 8097

6585/CAN_COND: 0

11/NETCHNG_1: -0.34

178/TRDVOL_1: 100.0

6638/TRADE_EXID: NAS43

8667/PRE_24T036: 4014084

8550/LMT_CAL_CD: 2

372/IRGPRC: 25.3384

4742/CUSIP_CD: 47215P106

78/OFFCL_CODE: 00047215P106

12819/INVERS_IND: N 2

9210/BLK_DATE: Thu Feb 18 08:00:00 CST 2016

3694/MNEMONIC: JD

9063/IRGTIM_MS: 62254960

118/PRC_QL_CD: 0

3263/PREV_DISP: 5320

79/HSTCLSDATE: Wed Feb 17 08:00:00 CST 2016

9243/PRE_DT132: Thu Feb 18 08:00:00 CST 2016

30/BIDSIZE: 700.0

869/OFF_CD_IND: CUS4

3888/FIN_STATUS: N

12818/ETP_FLAG: N 2

5357/CONTEXT_ID: 2229.0

13/LOW_1: 25.01

8511/PRE_4TX064: @O X

3861/BLK_PRC1: 25.37

8665/PRE_24T034: 000003OW9T

1044/GV4_FLAG:

77/NUM_MOVES: 17093.0

3855/QUOTIM_MS: 62568499

6/TRDPRC_1: 25.38

6614/TRD_STATUS: N 1

56/PCTCHNG: -1.3219

11622/PRE_4TX065: @F o

374/IRGCOND: DAP2365

14249/PRE_117_MS: Thu Feb 18 22:30:01 CST 2016

3/DSPLY_NAME: JD.COM INC ADR

5520/IRG_TRDID: 000003YYTF

1709/RDN_EXCHD2: NXB1042

16/TRADE_DATE: Thu Feb 18 08:00:00 CST 2016

1465/ADJUST_CLS: 25.72

3854/SALTIM_MS: 62556960

259/RECORDTYPE: 113

378/INSCOND: 0

6615/HALT_RSN: UN23

60/CLOSE_BID: 25.71

8636/NA_MSG_TYP: Q

3984/TRD_TYPE: T

3580/BID_ASK_DT: Wed Feb 17 08:00:00 CST 2016

53/TRD_UNITS: 4DP 4

22/BID: 25.38

15/CURRENCY: USD840

32/ACVOL_1: 6041194.0

6918/AC_VOL_CRS: 128488

12784/TEST_MSG: 1

4349/IRGDATE: Thu Feb 18 08:00:00 CST 2016

61/CLOSE_ASK: 25.72

6922/ODD_TRDVOL: 16

13416/LOTSZUNIT2: SHARE53

32743/ACVOL_UNS: 6041194

8947/M_SHS_PROP: SHSMF_ 6

4343/LOT_IND: RO3

7066/PRE_INT187: 63

8547/M_SHS_COND: N

4757/IRGSALCOND: @4 W

31/ASKSIZE: 616.0

14251/PRE_119_MS: Fri Feb 19 01:22:36 CST 2016

3386/QUOTE_DATE: Thu Feb 18 08:00:00 CST 2016

25/ASK: 25.39

3900/TRADE_ID: 4014131

4756/LSTSALCOND: @

13402/COR_EXID: 0

12846/PRE_1ET145: 0

4763/RETRAN_IND: 11

9244/PRE_DT133: Thu Feb 18 08:00:00 CST 2016

12/HIGH_1: 25.9

4205/ODD_PRC: 25.38

13417/IPO_QR_CD: 0

8634/INST_CLA_N: Z

4179/LEVERAGE: 0.0

9057/HLT_RSMRSN: 0

40/CTS_QUAL: 0

131/PRC_QL2: 0

13495/PRE_2ET174: 43

8666/PRE_24T035: 106865

8927/INST_PHASE: T 3

treprfarfa-apifieldstime-stamp
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
Accepted
426 2 4 4

You can use FID 3854: SALTIM MS and FID 3855: QUOTIM_MS. If the update is a quote, FID 3855 should be presented, otherwise, the update message should be a trade and FID 3854 should be presented. Both fields can be converted to a long from the OMM Data and can be convert to a formatted time string using standard Java Datetime formatting functions.

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
9.5k 10 5 7

You can use the following example source code to convert SALTIM_MS or QUOTIM_MS to be time:

//millisecData is a String which is value of SALTIM_MS or QUOTIM_MS

double milliseconds = Double.parseDouble(millisecData);

//1. Divide the milliseconds value by 1000.

double seconds = milliseconds / 1000.0d;

//2. Take the result in (1) and divide by 60

double minutes = seconds / 60.0d;

//3. Take the result in (2) and divide by 60.

//When you round down the result, you will get the hour value

double hours = minutes / 60.0d;

int hr = (int)hours;

//4. Take the number after the decimal points from (3) and multiply by 60.

//When you round down the result, you will get the minute value.

double remainder_min = (hours) - hr;

double remainder_sec = (remainder_min) * 60;

int min = (int)remainder_sec;

//5. Take the number after the decimal points from (4) and multiply by 60;

//When you round down the result, you will get the second value.

double remainder_ms = (remainder_sec) - min;

double remainder_msec = (remainder_ms) * 60;

int sec = (int)remainder_msec;

//6. Take the number after decimal from (5) and multiply by 1000;

//When you round down the result, you will get the millisecond value.

double remainder_milisec = (remainder_msec) - sec;

double milisec_raw = remainder_milisec * 1000;

int ms = (int)Math.round(milisec_raw);

System.out.format("Time is %02d:%02d:%02d.%03d%n",hr,min,sec,ms);

Example output:

QUOTIM_MS: 24369090

Time is 06:46:09.090

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