question

Upvotes
Accepted
7 1 1 3

How to identify a Quote vs Trade.

I am using EMA SDK for Java. Which field that I can use to differentiate if the update is a Quote/Trade? Let me know if there are any gotchas. By gotchas, I meant special cases where the handling needs to be special.

elektronrefinitiv-realtimeelektron-sdkrrtema-apielektron-message-apitradequote
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
9.5k 10 5 7

Hello @purvesh.yadav

UpdateTypeNum component in update message indicates the general content of the update as shown in the 6.2.3 Market Price Update Message section in EMAJ_RDMUsageGuide.pdf:

You can call UpdateMsg.updateTypeNum() to return UpdateTypeNum which can be trade, quote or both etc. As the snipped example below:

import com.thomsonreuters.ema.rdm.*;
…
   if(updateMsg.updateTypeNum()==EmaRdm.INSTRUMENT_UPDATE_QUOTE) {
        //process update contains quote info
   } else if (updateMsg.updateTypeNum()==EmaRdm.INSTRUMENT_UPDATE_TRADE) {
       //process update contains trade info
   }  else if (updateMsg.updateTypeNum()==EmaRdm.INSTRUMENT_UPDATE_QUOTES_TRADE)            {                 
      //process update contains both trade and quote info 
 } 
  ...

Hope this help.


updatetypenum.png (30.7 KiB)
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.

The link to the PDF is not working for me.

What do you think about the RefreshMsg? Since it is a snapshot, ideally, it should have the information about the last known quote and trade. Please correct me if I am wrong. If I am correct then I can do the same thing that I need to do for EmaRdm.INSTRUMENT_UPDATE_QUOTES_TRADE. Correct?

Upvotes
9.5k 10 5 7

Hello @purvesh.yadav

According to Market Price Refresh Message, there is no UpdateTypeNum component. Refresh messages contains the latest values of all available fields of the instrument so it contains all information(all updateTypeNums types). That's why it does not have UpdateTypeNum and you cannot check UpdateTypeNum in Refresh Message.

You can refer to Market Price Update Message and another message types in EMA Java RDM Usage Guide.

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.

I wasn't saying to use UpdateTypeNum from Refresh message. I was just trying to say that since it is a snapshot of all the latest information therefore, it will have relevant information related to last Quote and last Trade. So, I can use the same code that I need to write to handle EmaRdm.INSTRUMENT_UPDATE_QUOTES_TRADE.

Click below to post an Idea Post Idea