question

Upvotes
Accepted
9 3 2 6

How to confirm the OMMMsg belongs to which CURRENCY?

====================== Question 1 Begin ====================================


Fox exmaple , I subscribe two MARKET_PRICE "EUR=" "JPY="

QSConsumerDemo Login successful
ItemManager.sendRequest: Sending item requests
ItemManager: Subscribing to EUR=
ItemManager: Subscribing to JPY=
ItemManager.processEvent: Received Item Event
MESSAGE
	Msg Type: MsgType.STATUS_RESP
	Msg Model Type: MARKET_PRICE
	Indication Flags: 
	Hint Flags: HAS_ATTRIB_INFO | HAS_STATE
	State: OPEN, SUSPECT, NONE,  "Waiting for service ELEKTRON_DD UP. Item recovery in progress..."
	AttribInfo
		ServiceName: ELEKTRON_DD
		Name: EUR=
		NameType: 1 (RIC)
	Payload: None
ItemManager.processEvent: Received Item Event
MESSAGE
	Msg Type: MsgType.STATUS_RESP
	Msg Model Type: MARKET_PRICE
	Indication Flags: 
	Hint Flags: HAS_ATTRIB_INFO | HAS_STATE
	State: OPEN, SUSPECT, NONE,  "Waiting for service ELEKTRON_DD UP. Item recovery in progress..."
	AttribInfo
		ServiceName: ELEKTRON_DD
		Name: JPY=
		NameType: 1 (RIC)
	Payload: None

when Msg Type: MsgType.REFRESH_RESP , I know the following information is belongs to "EUR="

ItemManager.processEvent: Received Item Event
MESSAGE
	Msg Type: MsgType.REFRESH_RESP
	Msg Model Type: MARKET_PRICE
	Indication Flags: REFRESH_COMPLETE | CLEAR_CACHE
	Hint Flags: HAS_ATTRIB_INFO | HAS_ITEM_GROUP | HAS_PERMISSION_DATA | HAS_QOS | HAS_RESP_TYPE_NUM | HAS_SEQ_NUM | HAS_STATE
	State: OPEN, OK, NONE,  "All is well"
	Qos: (RT, JIT Filt.)
	Group: 0004010101f9eb24
	PermissionData: 030101213c ( 0x03,0x01,0x01,0x21,0x3c ) 
	SeqNum: 46318
	RespTypeNum: 0 (RespType.SOLICITED)
	AttribInfo
		ServiceName: ELEKTRON_DD
		ServiceId: 257
		Name: EUR=
		NameType: 1 (RIC)
	Payload: 2080 bytes
		FIELD_LIST
			FIELD_ENTRY 1/PROD_PERM: 213
			FIELD_ENTRY 2/RDNDISPLAY: 153
			FIELD_ENTRY 3/DSPLY_NAME: SOC GENERALE PAR
			FIELD_ENTRY 5/TIMACT: 07:46
			FIELD_ENTRY 11/NETCHNG_1: -0.0036
			FIELD_ENTRY 12/HIGH_1: 1.2238
			FIELD_ENTRY 13/LOW_1: 1.2190
			FIELD_ENTRY 15/CURRENCY: USD (840)
			FIELD_ENTRY 17/ACTIV_DATE: 25 APR 2018
			FIELD_ENTRY 19/OPEN_PRC: 1.2230
			FIELD_ENTRY 21/HST_CLOSE: 1.2230
			FIELD_ENTRY 22/BID: 1.2194
			FIELD_ENTRY 23/BID_1: 1.2195
			FIELD_ENTRY 24/BID_2: 1.2194
			FIELD_ENTRY 25/ASK: 1.2197

when Msg Type: MsgType.REFRESH_RESP , I know the following information is belongs to JPY="

ItemManager.processEvent: Received Item Event
MESSAGE
	Msg Type: MsgType.REFRESH_RESP
	Msg Model Type: MARKET_PRICE
	Indication Flags: REFRESH_COMPLETE | CLEAR_CACHE
	Hint Flags: HAS_ATTRIB_INFO | HAS_ITEM_GROUP | HAS_PERMISSION_DATA | HAS_QOS | HAS_RESP_TYPE_NUM | HAS_SEQ_NUM | HAS_STATE
	State: OPEN, OK, NONE,  "All is well"
	Qos: (RT, JIT Filt.)
	Group: 0002010101f9eb24
	PermissionData: 030101213c ( 0x03,0x01,0x01,0x21,0x3c ) 
	SeqNum: 8654
	RespTypeNum: 0 (RespType.SOLICITED)
	AttribInfo
		ServiceName: ELEKTRON_DD
		ServiceId: 257
		Name: JPY=
		NameType: 1 (RIC)
	Payload: 2060 bytes
		FIELD_LIST
			FIELD_ENTRY 1/PROD_PERM: 213
			FIELD_ENTRY 2/RDNDISPLAY: 153
			FIELD_ENTRY 3/DSPLY_NAME: CARL KLIEM   LUX
			FIELD_ENTRY 5/TIMACT: 07:46
			FIELD_ENTRY 11/NETCHNG_1: 0.35
			FIELD_ENTRY 12/HIGH_1: 109.17
			FIELD_ENTRY 13/LOW_1: 108.80
			FIELD_ENTRY 15/CURRENCY: JPY (392)
			FIELD_ENTRY 17/ACTIV_DATE: 25 APR 2018
			FIELD_ENTRY 19/OPEN_PRC: 108.80
			FIELD_ENTRY 21/HST_CLOSE: 108.81
			FIELD_ENTRY 22/BID: 109.16

But when the Msg Type: MsgType.UPDATE_RESP, How can i know the following text is belongs to "EUR=" OR "JPY="

ItemManager.processEvent: Received Item Event
MESSAGE
	Msg Type: MsgType.UPDATE_RESP
	Msg Model Type: MARKET_PRICE
	Indication Flags: DO_NOT_CONFLATE
	Hint Flags: HAS_RESP_TYPE_NUM | HAS_SEQ_NUM
	SeqNum: 8670
	RespTypeNum: 0 (UNSPECIFIED)
	Payload: 217 bytes
		FIELD_LIST
			FIELD_ENTRY 22/BID: 109.16
			FIELD_ENTRY 393/PRIMACT_1: 109.16
			FIELD_ENTRY 25/ASK: 109.17
			FIELD_ENTRY 275/SEC_ACT_1: 109.17
			FIELD_ENTRY 875/VALUE_DT1: 25 APR 2018
			FIELD_ENTRY 1010/VALUE_TS1: 07:46:47
			FIELD_ENTRY 5/TIMACT: 07:46

====================== Question 1 End====================================


====================== Question 2 Begin ====================================

As we see from the following text

ItemManager.processEvent: Received Item Event
MESSAGE
	Msg Type: MsgType.UPDATE_RESP
	Msg Model Type: MARKET_PRICE
	Indication Flags: DO_NOT_CONFLATE
	Hint Flags: HAS_RESP_TYPE_NUM | HAS_SEQ_NUM
	SeqNum: 8686
	RespTypeNum: 0 (UNSPECIFIED)
	Payload: 13 bytes
		FIELD_LIST
			FIELD_ENTRY 3275/ASIA_NETCH: 0.29
			FIELD_ENTRY 3284/EURO_NETCH: 0.14


when Msg Type : MsgType.UPDATE_RESP, There is only two item

FIELD_ENTRY 3275/ASIA_NETCH: 0.29
FIELD_ENTRY 3284/EURO_NETCH: 0.14


All the infomation i want is "BID" AND "ASK",

Does the provider will notice me the "BID" "ASK" together at the same time ??


I want to be sure of this , because we need the "BID" AND "ASK" information at the same time


at every time ,provider notice us, we need to save the information like this way

{"CURRENCY": "JPY=","BID":"100.978","ASK":"123.976"}

either give us "BID" "ASK" together or none of them provide

====================== Question 2 End ====================================

Thank you very much

treprfarfa-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.

Upvotes
Accepted
24.4k 53 17 14

Hi @peng.xiaoliang

You can set the OMMMsg.Indication.ATTRIB_INFO_IN_UPDATES value in the streaming request message’s indication flags to receive full Attribute information including the RIC name in update messages delivered on this stream.

Example code (for Java):

OMMMsg ommmsg = pool.acquireMsg();
ommmsg.setMsgType(OMMMsg.MsgType.REQUEST);
…
ommmsg.setIndicationFlags(OMMMsg.Indication.REFRESH | OMMMsg.Indication.ATTRIB_INFO_IN_UPDATES);
ommmsg.setAttribInfo(“ELEKTRON_DD”, “SAR=”, RDMInstrument.NameType.RIC);

OMMItemIntSpec ommItemIntSpec = new OMMItemIntSpec();
ommItemIntSpec.setMsg(ommmsg);
Handle itemHandle = _mainApp.getOMMConsumer().registerClient(_mainApp.getEventQueue(), ommItemIntSpec, this, null);

Example result:

ItemManager.processEvent: Received Item Event...
MESSAGE
               Msg Type: MsgType.UPDATE_RESP
               Msg Model Type: MARKET_PRICE
               Indication Flags: DO_NOT_CONFLATE
               Hint Flags: HAS_ATTRIB_INFO | HAS_RESP_TYPE_NUM | HAS_SEQ_NUM
               SeqNum: 510
               RespTypeNum: 0 (UNSPECIFIED)
               AttribInfo
                              ServiceName: ELEKTRON_DD
                              ServiceId: 2114
                              Name: SAR=
                              NameType: 1 (RIC)
               Payload: 8 bytes
                              FIELD_LIST
                                             FIELD_ENTRY 3284/EURO_NETCH: 0.0000

doc.png (53.3 KiB)
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 very much , i want the information can display in this way

the CURRENCY is togeter with the update msg

CURRENCY always exist in the FIELD_LIST

FIELD_LIST
			FIELD_ENTRY 15/CURRENCY: USD (840)
			FIELD_ENTRY 22/BID: 109.16

is there any way to do this?

Upvote
120 3 4 7

Answer to Question 1 and 2:

When you receive a REFRESH_RESP you need to store the currency code into a HashTable mapping ric to values, for instance:

mapCurrency["EUR="] = "value of currency field"

So when when you get a UPDATE_RESP you know already the currency value, the same can be used to store other non-changing values.

In order to identify the UPDATE_RESP's ric you can, as an alternative to set AttribInfo, associate a closure with each request, for instance:

Set closure as the ric string:

handle = ommConsumer.RegisterClient(eventQueue, ommItemIntSpec, this, "EUR");

Then on update you get the closure to know which RIC it belongs to:

public void ProcessEvent(Event evnt)

{

switch (evnt.Type)

...

case SessionLayerEventTypeEnum.OMMItemEvent:

OMMItemEvent oie = (OMMItemEvent)evnt;

String ric = (String)oie.Closure;

String currency = mapCurrency[ric];

Regarding BID and ASK values, you can store these values in maps upon receiving.

The values are received when someone had put an BID/SELL offer in the market (for full tick service). Then receiving it or not depend on someone (a person or robot) to put an order in the market. Some services make conflation sending values at specific intervals which is not related to market data events generated by orders being put on the book in the exchange.

Paulo.

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.

Upvote
24.4k 53 17 14

Hi @peng.xiaoliang

### Question 2 ###

Basically, the Refresh message (REFRESH_RESP) contains all field data of that item and the Update message (UPDATE_RESP) contains only "the current updated fields data in Exchange/Data Feed" from Elektron. The application cannot expected to always receive specific fields in the same update message because it is based on the actual updated from Exchange/Data feed.

  • If BID and ASIA_NETCH fields are updated in Exchange/Data feed, Elektron sends these fields in the same update message to API
  • If ASK field is updated in Exchange/Data feed, Elektron sends this field in update message to API

The only way to always get BID and ASK fields together is to subscribe as a non-streaming request with View feature to request only BID and ASK fields. The application will get only one Refresh message contains both BID and ASK per request and then that stream is closed automatically.

Using a view, a consumer requests a subset of fields with a client-based item request. The consumer specifies a set of fields in a request to the ADS/Elektron. When the ADS/Elektron receives the requested fields, it sends the subset back to the consumer.

Please note that this View feature requires the SNAP_AND_DYNAMIC_VIEW license to be deployed in the ADS server.

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.