question

Upvotes
Accepted
5 3 2 1

Websocket receive some characters as ???

We are working on web socket API feed integration with ERT Cloud. using EDP.

when we receive data from web socket. we see some characters as ???.

Any help would be greatly appreciated.

i.e

"Fields": {

"TRDPRC_1": 100.986,

"NETCHNG_1": -0.114,

"PRCTCK_1": "???",

"CURRENCY": "USD",

"TRADE_DATE": "2020-04-29",

"TRDTIM_1": "13:26:24",

"HST_CLOSE": 101.1,

"ACVOL_1": 106,

refinitiv-realtimetreprdp-apiwebsocketsrrtoADS
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
Accepted
7.6k 15 6 9

@cbhavsar

Please change the codes when you get a string from

Encoding.ASCII.GetString

to

Encoding.UTF8.GetString


As far as I understand .NET Console mode does not use UTF-8 if want to display the update/down arrow you can add

Console.OutputEncoding = Encoding.UTF8;

Before you print the output and redirect the output to file and open it in a text editor which support UTF-8

You should see the output like the below output from .NET EDP example.

RECEIVED:
{
....
SENT:
{
  "ID": 2,
  "Key": {
    "Name": "/TRI.N",
    "Service": "ELEKTRON_DD"
  }
}
RECEIVED:
[
  {
    "ID": 2,
    "Type": "Refresh",
    "Key": {
      "Service": "ELEKTRON_DD",
      "Name": "/TRI.N"
    },
    "State": {
      "Stream": "Open",
      "Data": "Ok",
      "Text": "*All is well"
    },
    "Qos": {
      "Timeliness": "Realtime",
      "Rate": "JitConflated"
    },
    "PermData": "AwEBQBfA",
    "SeqNumber": 22656,
    "Fields": {
      "PROD_PERM": 4017,
      "RDNDISPLAY": 64,
      "DSPLY_NAME": "THOMSON REUTER/d",
      "RDN_EXCHID": "NYS",
      "TRDPRC_1": 67.89,
      "TRDPRC_2": 67.89,
      "TRDPRC_3": 67.89,
      "TRDPRC_4": 67.89,
      "TRDPRC_5": 67.85,
      "NETCHNG_1": -1.9,
      "HIGH_1": 69.7,
      "LOW_1": 67.85,
      "PRCTCK_1": "⇩",
      "CURRENCY": "USD",
      "TRADE_DATE": "2020-05-06",
      "TRDTIM_1": "20:00:00",
      "OPEN_PRC": 69.05,
      "HST_CLOSE": 69.79,
      "BID": 0.0,
      "BID_1": 67.87,
      "BID_2": 67.83,
      "ASK": 0.0,
      "ASK_1": 67.91,
      "ASK_2": 67.86,
      "NEWS": "YYYY",
      "NEWS_TIME": "22:33:22",
      "BIDSIZE": 0,
      "ASKSIZE": 0,
      "ACVOL_1": 187929,
      "EARNINGS": 0.9095,
      "YIELD": 2.2389,
      "PERATIO": 74.6487,
      "DIVIDENDTP": "  ",
      "DIVPAYDATE": "2020-06-15",
      "EXDIVDATE": "2020-05-20",
      "CTS_QUAL": "CLS",
      "BLKCOUNT": 2,
      "BLKVOLUM": 24530,
      "TRD_UNITS": "6DP ",
      "PCTCHNG": -2.7225,
      "DJTIME": null,
      "CLOSE_BID": 67.92,
      "CLOSE_ASK": 67.93,
      "DIVIDEND": 1.52,
      "UPLIMIT": 0.0,
      "LOLIMIT": 0.0,
      "NUM_MOVES": 2014,
      "OFFCL_CODE": "000884903709",
      "HSTCLSDATE": "2020-05-05",
      "YRHIGH": 82.5,
      "YRLOW": 52.23,
      "TURNOVER": null,
      "BOND_TYPE": null,
      "BCKGRNDPAG": null,
      "YCHIGH_IND": null,
      "YCLOW_IND": null,
      "CUM_EX_MKR": "   ",
      "PRC_QL_CD": "   ",
      "PRC_QL2": "D15",
      "TRDVOL_1": null,
      "LOT_SIZE_A": 100,
      "RECORDTYPE": 113,
      "BID_MMID1": null,
      "ASK_MMID1": null,
      "OPTION_XID": "XABCEH",
      "YRHIGHDAT": "2020-02-25",
      "YRLOWDAT": "2020-03-23",
      "IRGPRC": 67.9,
      "IRGVOL": 26,
      "IRGCOND": "ODD",
      "TIMCOR": null,
      "INSPRC": null,
      "INSVOL": null,
      "INSCOND": null,
      "SALTIM": "22:30:00",
      "BCAST_REF": "TRI.TO",
      "OFF_CD_IND": "CUS",
      "GEN_VAL3": 0.0,
      "GEN_VAL4": 0.0,
      "GV1_TEXT": " ",
      "GV2_TEXT": " ",
      "GV3_TEXT": " ",
      "GV4_TEXT": "   I",
      "SEQNUM": 2327797,
      "PRNTYP": " ",
      "QUOTIM": "20:00:00",
      "GV1_FLAG": "S",
      "GV2_FLAG": " ",
      "GV3_FLAG": " ",
      "GV4_FLAG": " ",
      "OFF_CD_IN2": null,
      "OFFC_CODE2": "CMNPTKzBegXA",
      "EXCHTIM": "22:30:00",
      "YRHI_IND": "Yr.High ",
      "YRLO_IND": "Yr.Low  ",
      "PREF_DISP": 5752,
      "VOL_X_PRC1": 68.6355,
      "CLOSE_TIME": "00:04:07",
      "ODD_VOLUME": 31849,
      "ADJUST_CLS": 67.89,
      "STOCK_TYPE": " ",
      "IMP_VOLT": null,
      "RDN_EXCHD2": "NYS",
      "YEAR_FCAST": "08O",
      "IRGVAL": 16,
      "LIST_MKT": "N",
      "PCT_ABNVOL": 1.2261,
      "BC_10_50K": 2,
      "BC_50_100K": null,
      "BC_100K": null,
      "PMA_50D": 68.4324,
      "PMA_150D": 71.251,
      "PMA_200D": 70.3269,
      "VMA_10D": 153280,
      "VMA_25D": 168059,
      "VMA_50D": 236033,
      "OPN_NETCH": -0.74,
      "PREV_DISP": 0,
      "PRC_QL3": "RPB",
      "52WK_HIGH": 82.5,
      "52WK_LOW": 52.23,
      "MPV": "INT ",
      "OFF_CLOSE": 67.89,
      "QUOTE_DATE": "2020-05-06",
      "VWAP": 68.6355,
      "PROV_SYMB": "TRI",
      "52W_HDAT": "2020-02-25",
      "52W_HIND": null,
      "52W_LDAT": "2020-03-23",
      "52W_LIND": null,
      "BID_ASK_DT": "2020-05-06",
      "CRSTRD_PRC": null,
      "ISIN_CODE": "CA8849037095",
      "MNEMONIC": "TRI",
      "LOLIMIT_2": null,
      "UPLIMIT_2": null,
      "TRDTIM_MS": 72001765,
      "SALTIM_MS": 81000001,
      "QUOTIM_MS": 72000022,
      "TIMCOR_MS": null,
      "BLK_PRC1": 67.89,
      "PDTRDPRC": null,
      "PREDAYVOL": null,
      "PDTRDDATE": null,
      "SEQNUM_QT": 34431492,
      "FIN_STATUS": "N",
      "LS_SUBIND": " ",
      "IRG_SUBIND": " ",
      "TRADE_ID": "52983577262411",
      "MKT_STATUS": "3",
      "TRD_TYPE": "3",
      "IPO_PRC": null,
      "ODD_PRC": 67.9,
      "RCS_AS_CLA": " ",
      "IMB_ACT_TP": null,
      "IMB_SH": null,
      "IMB_SIDE": null,
      "IMB_TIM_MS": null,
      "TRD_THRU_X": " ",
      "IRG_TDTH_X": " ",
      "IRGDATE": "2020-05-06",
      "TURN_BLOCK": 1677563.46,
      "DOM_EQ_ID": "CMNPTKzBegXA",
      "DOM_OPT_ID": "PWXYZ",
      "CUSIP_CD": "884903709",
      "LSTSALCOND": "   M",
      "IRGSALCOND": "   I",
      "INSSALCOND": null,
      "THRESH_IND": "1",
      "CANCEL_IND": null,
      "RETRAN_IND": "1",
      "CONTEXT_ID": 1070,
      "IRG_TRDID": "52983577204016",
      "PRC_TICK": 0.01,
      "VWAP_VOL": 187929,
      "OPEN_T_MS": 48600708,
      "POST_PANEL": "08O",
      "IRG_SEQNO": 2287123,
      "INS_SEQNO": null,
      "OFF_CL_TIM": "00:04:07",
      "DDS_DSO_ID": 8310,
      "SPS_SP_RIC": ".[SPSCDSAM0202",
      "SETL_TYPE": "NRM",
      "BOOK_STATE": "N",
      "HALT_REASN": " ",
      "SH_SAL_RES": "N",
      "BID_COND_N": "R",
      "ASK_COND_N": "R",
      "CAN_PRC": null,
      "CAN_VOL": null,
      "CAN_COND": null,
      "CAN_COND_N": null,
      "CAN_TRD_ID": null,
      "REPORT_VOL": 187929,
      "TRD_STATUS": "N ",
      "HALT_RSN": "  ",
      "HALT_DATE": "2020-03-18",
      "CTRDTIM_MS": null,
      "CTRDTIM": null,
      "INSTRD_TIM": null,
      "OFF_CLS_DT": "2020-05-06",
      "CAN_DATE": null,
      "INSTRD_DT": null,
      "PD_SEQNO": null,
      "BLKTRDVOL": 13994,
      "PDACVOL": null,
      "AC_VOL_CRS": 0,
      "ODD_TRDVOL": 26,
      "ELG_NUMMOV": 1031,
      "BLK_SEQNO": 2288124,
      "ODD_SEQNO": 2287123,
      "CRS_SEQNO": null,
      "CRS_TRDVOL": null,
      "CRS_NUMOV": null,
      "PREMKT_VOL": null,
      "AFTMKT_VOL": null,
      "AC_TRN_CRS": null,
      "SEE_RIC": null,
      "BCASTREF32": null,
      "QTE_ORIGIN": "S",
      "CAN_TDTH_X": null,
      "CAN_SUBIND": null,
      "PD_TDTH_X": null,
      "PD_SUBIND": null,
      "INS_TDTH_X": null,
      "INS_SUBIND": null,
      "XMIC_CODE": "XNYS",
      "CRSSALCOND": null,
      "PD_SALCOND": null,
      "RCS_AS_CL2": null,
      "PD_TRDID": null,
      "PERIOD_CD2": null,
      "INS_TRDID": null,
      "BLK_TRDID": "52983577260855",
      "CRS_TRDID": null,
      "ODD_TRDID": "52983577204016",
      "REG_PILOT": null,
      "INST_PHASE": "   ",
      "RETAIL_INT": "   ",
      "LIMIT_IND2": "LPB",
      "LIMIT_INDQ": "   ",
      "MK_STATUS": null,
      "LULD_TM_MS": 72030010,
      "INSTIM_MS": null,
      "IRGTIM_MS": 71999925,
      "LULD_T2_MS": null,
      "BLK_DATE": "2020-05-06",
      "CRS_DATE": null,
      "ODD_DATE": "2020-05-06",
      "HLT_RSM_DT": "2020-03-18",
      "PREMKT_DT": null,
      "AFTMKT_DT": null,
      "LMT_REFPR2": null,
      "AUC_EX_NO": null,
      "PREMKT_PRC": null,
      "AFTMKT_PRC": null,
      "ODDSALCOND": "   I",
      "BLKSALCOND": " 6  ",
      "SECUR_ST": "F",
      "BLK_FLAG": null,
      "VWAP_FLAG": null,
      "CAN_TERMS": null,
      "NBBO_IND": "4  ",
      "HELD_T_IND": "   ",
      "LMT_TYPE": null,
      "LMT_TYPE2": null,
      "BLKTIM_MS": "20:00:01.764",
      "PDTRDTM_MS": null,
      "ORDRECV_MS": "20:00:00.022",
      "TRDRECV_MS": "22:30:00",
      "ORDREC2_MS": null,
      "TRDREC2_MS": null,
      "CRSTIM_MS": null,
      "HLT_RSM_MS": "17:11:17.154",
      "ODDTIM_MS": "19:59:59.925",
      "HALT_TM_MS": "16:56:17.05",
      "OFF_CLS_MS": "00:04:07.842",
      "PREMKT_NS": null,
      "AFTMKT_NS": null,
      "CNTX_VER_N": null,
      "DM_TYPE": null,
      "ELG_ACVOL": 156080,
      "ELG_TNOV": 10713819.5,
      "ODDTRN_UNS": 2184783.155,
      "TRNOVR_UNS": 12898602.655,
      "ACVOL_UNS": 187929
    }
  }
]
RECEIVED:
[
  {
    "Type": "Ping"
  }
]


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
25.4k 90 13 26

Hi @cbhavsar

The PRCTCK_1 field is an enumerated field and it can contain an UpTick or DownTick symbol - what I suspect may be happening here is that the ERT in Cloud server may not be doing the appropriate conversion - fairly certain I would expect to receive "⇧"’ etc

Normally for a non-websocket connection, the developer receives a hex enum value for uptick/downtick and they can then process + convert that accordingly for display purposes.

I will try and do some research here but I recommend you raise a support ticket with the "ERT in Cloud" team so they can investigate further.

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.

Thanks Umer.

Upvote
28k 68 18 14

Hello @cbhavsar

The PRCTCK_1 field is enumerates field that contains direction of price movement ("TICK:UP/DOWN" ) from the previous trade or "Last" price.

I have tested with market_price_edpgw_service_discovery.py ERT in Cloud demo application and the dmo shows "\u21e9" which is a unicode character for downward arrow.

RECEIVED on session1:
[
  {
    "Fields":{
      ...
      "NETCHNG_1":-1.9,
      "OPEN_PRC":69.05,
      "PRCTCK_1":"\u21e9",
      "TRDPRC_1":67.89,
      "TRDPRC_2":67.89,
      "TRDPRC_3":67.89,
      "TRDPRC_4":67.89,
      "TRDPRC_5":67.85,
     
    },
    "ID":2,
    "Key":{
      "Name":"/TRI.N",
      "Service":"ELEKTRON_DD"
    },
 ...
    "Type":"Refresh"
  }
]

Do you encounter this issue with all items? Do you environment/application handle unicode characters?

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.

Yes Wasin , I get ??? value all the time. I am using C# based implementation.

I just checked on c# sample application MarketPriceEdpGwAuthenticationExample it is coming as ???


i.e.

"ID": 2,

"Type": "Refresh",

"Key": {

"Service": "ELEKTRON_DD",

"Name": "/TRI.N"

},

"State": {

"Stream": "Open",

"Data": "Ok",

"Text": "*All is well"

},

"Qos": {

"Timeliness": "Realtime",

"Rate": "JitConflated"

},

"PermData": "AwEBQBfA",

"SeqNumber": 22656,

"Fields": {

"PROD_PERM": 4017,

"RDNDISPLAY": 64,

"DSPLY_NAME": "THOMSON REUTER/d",

"RDN_EXCHID": "NYS",

"TRDPRC_1": 67.89,

"TRDPRC_2": 67.89,

"TRDPRC_3": 67.89,

"TRDPRC_4": 67.89,

"TRDPRC_5": 67.85,

"NETCHNG_1": -1.9,

"HIGH_1": 69.7,

"LOW_1": 67.85,

"PRCTCK_1": "???",

"CURRENCY": "USD",

"TRADE_DATE": "2020-05-06",

"TRDTIM_1": "20:00:00",


Upvotes
5 3 2 1

Hi,

I just checked on c# sample application MarketPriceEdpGwAuthenticationExample it is coming as ???


i.e.

"ID": 2,

"Type": "Refresh",

"Key": {

"Service": "ELEKTRON_DD",

"Name": "/TRI.N"

},

"State": {

"Stream": "Open",

"Data": "Ok",

"Text": "*All is well"

},

"Qos": {

"Timeliness": "Realtime",

"Rate": "JitConflated"

},

"PermData": "AwEBQBfA",

"SeqNumber": 22656,

"Fields": {

"PROD_PERM": 4017,

"RDNDISPLAY": 64,

"DSPLY_NAME": "THOMSON REUTER/d",

"RDN_EXCHID": "NYS",

"TRDPRC_1": 67.89,

"TRDPRC_2": 67.89,

"TRDPRC_3": 67.89,

"TRDPRC_4": 67.89,

"TRDPRC_5": 67.85,

"NETCHNG_1": -1.9,

"HIGH_1": 69.7,

"LOW_1": 67.85,

"PRCTCK_1": "???",

"CURRENCY": "USD",

"TRADE_DATE": "2020-05-06",

"TRDTIM_1": "20:00:00",


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
25.4k 90 13 26

Hi @cbhavsar

I can also confirm that using a C# example I see '???' - but with Python, for example, I see "\u21e9 " - so this could be related to .NET or the Json dll etc.

Are you able to raise a support ticket so it can be investigated offline in more detail?

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
5 3 2 1

Yes, I am looking to open support ticket for the same

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
5 3 2 1

Yes it is working as suggested Thanks.

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.