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