Contribution through EMA API updating garbage values

Hi Guys,
I am using Refinitiv EMA api to contribute using offstream.
I have bid as double and offer as double and I use the following to add them to a UpdateMsg.
nestedFieldList.add(EmaFactory.createFieldEntry().realFromDouble(393, bid, OmmReal.MagnitudeType.EXPONENT_NEG_5));
nestedFieldList.add(EmaFactory.createFieldEntry().realFromDouble(275, offer, OmmReal.MagnitudeType.EXPONENT_NEG_5));
nestedFieldList.add(EmaFactory.createFieldEntry().realFromDouble(22, bid, OmmReal.MagnitudeType.EXPONENT_NEG_5));
nestedFieldList.add(EmaFactory.createFieldEntry().realFromDouble(25, offer, OmmReal.MagnitudeType.EXPONENT_NEG_5));
But if the value is 25.16, its updating it as 5.160000
Could someone provide inputs around these? I had initially used EXPONENT_NEG_1 and that was also publishing garbage values.
Thanks for your help,
Cheers,
Sanjeet
Best Answer
-
Can you confirm which version of the RT-SDK you are using? I am using RTSDK-2.0.2.L1.java.rrg and with the following code:
double bid = 25.16;
double offer = 26.17;
nestedFieldList.add(EmaFactory.createFieldEntry().realFromDouble(393, bid, OmmReal.MagnitudeType.EXPONENT_0));
nestedFieldList.add(EmaFactory.createFieldEntry().realFromDouble(275, offer, OmmReal.MagnitudeType.EXPONENT_0));
nestedFieldList.add(EmaFactory.createFieldEntry().realFromDouble(22, bid, OmmReal.MagnitudeType.EXPONENT_NEG_5));
nestedFieldList.add(EmaFactory.createFieldEntry().realFromDouble(25, offer, OmmReal.MagnitudeType.EXPONENT_NEG_5));
nestedFieldList.add(EmaFactory.createFieldEntry().time(18, 11, 29, 30));
nestedFieldList.add(EmaFactory.createFieldEntry().enumValue(37, 3));I get the following:
18 TRDTIM_1 11:29:30
22 BID 25.16
25 ASK 26.17
37 DIVIDENDTP 3->"+X"
393 PRIMACT_1 25
275 SEC_ACT_1 26
Which is as I would expectYou may want to enable the low-level trace to see what values are being submitted to the server on the wire as described in How to enable tracing incoming/outgoing messages EMA Java How to enable tracing incoming/outgoing messages EMA Java receives/sends - Forum | Refinitiv Developer Community
0
Answers
-
compile 'com.thomsonreuters.ema:ema:3.2.0.2'
compile 'com.thomsonreuters.upa:upa:3.2.0.2'
compile 'com.thomsonreuters.upa.valueadd:upaValueAdd:3.2.0.2'Ok will enable the low level tracing.
Is there any documentation around MagnitudeType and how they impact the values?
0 -
MagnitudeType indicates the Order of Magnitude i.e. Order of magnitude - Wikipedia
The enum values are listed in the Reference documentation e.g. that is supplied with the RT-SDK e.g. on my PC the location is:
c:/Refinitiv/RTSDK-2.0.2.L1.java.rrg/Java/Ema/Docs/refman/emajava/com/refinitiv/ema/access/OmmReal.MagnitudeType.html
In my example above, where I set EXPONENT_0 the value was truncated to the whole number.
For the EXPONENT_NEG_5 the value was actually published as 25.16000 and 26.17000 - it was truncated in the output above.
0 -
Hi Umer,
Thanks for your reply and helping me out.
I did see the enums but I wasn't sure how they impact the values. NEG_1 definitely garbages the values.
For double values in java, what should I use? Any suggestions.
Cheers,
Sanjeet
0 -
I don't understand the question - 'For double values in java, what should I use?' - I am using doubles in my example snippet above?
I also tested with NEG_1 and it works fine - did you generate the trace?
For example:
double bid = 25.16;
double offer = 26.17;
nestedFieldList.add(EmaFactory.createFieldEntry().realFromDouble(22, bid, OmmReal.MagnitudeType.EXPONENT_NEG_2));
nestedFieldList.add(EmaFactory.createFieldEntry().realFromDouble(25, offer, OmmReal.MagnitudeType.EXPONENT_NEG_2));
nestedFieldList.add(EmaFactory.createFieldEntry().realFromDouble(393, bid, OmmReal.MagnitudeType.EXPONENT_NEG_1));
nestedFieldList.add(EmaFactory.createFieldEntry().realFromDouble(275, offer, OmmReal.MagnitudeType.EXPONENT_NEG_1));results in the following values being published:
30022 BID 25.16
30025 ASK 26.17
30275 SEC ACT 1 26.2
30353 PRIMACT 1 25.2Alternatively, you can use an integer value with the Magnitude to set the decimal point e.g.
nestedFieldList.add(EmaFactory.createFieldEntry().real(22, 12345, OmmReal.MagnitudeType.EXPONENT_NEG_2));
nestedFieldList.add(EmaFactory.createFieldEntry().real(25, 23456, OmmReal.MagnitudeType.EXPONENT_NEG_2));results in the following values being published:
30022 BID 123.45
30025 ASK 234.560 -
As per your example, your values initially are
- double bid = 25.16;
- double offer = 26.17;
But when you use nestedFieldList.add(EmaFactory.createFieldEntry().realFromDouble(393, bid, OmmReal.MagnitudeType.EXPONENT_NEG_1 the values are rounded to
30275 SEC ACT 1 26.2
30353 PRIMACT 1 25.2So there is some rounding differences between NEG_1 vs NEG_2..
In my case, the value 24.02 on ATS service gets show on Eikon as 24.02 but when I publish it on DCS_MARKETLINK, its getting truncated to 4.02000 (there are additional zeros at the end)
Similarly, the value of 25.16 is getting truncated to 5.16000
Unusually, these issues are happening only on DCS_MARKETLINK service (which is used in PROD) and not on ATS (which is used for UAT testing)
I am trying to configure tracing but I am not sure if I can activate it in PROD were I see the issue.
0 -
I am not sure I fully understand the issue with rounding? If I set the Order of Magnitude to NEG1, then rounding will take place. If I don't wish rounding to take place I would ensure I use NEG2 - or equivalent depending on the number of decimal places in the fractional part?
DCS_MARKETLINK is almost certainly using the legacy MarketFeed format and there is some incorrect format conversion going on at either the RTDS level or within whichever contribution engine you are using. You would need to discuss with your internal MarketData team to confirm the RTDS or Contribution engines configuration related to OMM->MF conversion is correct.
If they need assistance with the RTDS config they can raise a ticket with the RTDS team via My.Refinitiv. For the Contribution engine - the support path would depend on whether you are using a 3rd party one or not.
ATS uses OMM as standard so I would not expect any format conversion related issues.
0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 685 Datastream
- 1.4K DSS
- 616 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 252 ETA
- 556 WebSocket API
- 38 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 275 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 652 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 27 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 193 TREP Infrastructure
- 228 TRKD
- 917 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 90 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛