question

Upvotes
Accepted
1 0 0 2

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

refinitiv-realtime-sdk
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.

Upvote
Accepted
20.3k 73 10 20

Hi @sanjeet.karamchandani

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 expect

You 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



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.

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?

Upvotes
20.3k 73 10 20

Hi @sanjeet.karamchandani

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.


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.

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

Upvotes
20.3k 73 10 20

Hi @sanjeet.karamchandani

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

Alternatively, 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.56


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.

As per your example, your values initially are

  1. double bid = 25.16;
  2. 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.2

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

Upvotes
20.3k 73 10 20

Hi @sanjeet.karamchandani

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.

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.

Click below to post an Idea Post Idea