question

Upvotes
Accepted
23 2 4 10

How to handle fraction value in the fieldentry

I am trying to get details of itemname 'US30YT=TWEB' with rfa8 java. I can see two field entries -

FIELD_ENTRY 22/BID: 95 56/256
FIELD_ENTRY 25/ASK: 95 64/256

are returning fraction values. How to handle this situation

treprfarfa-apifieldsOMMADS
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
426 2 4 4
@applicationdevelopment,The notation of REAL values are decided by the Hing value of OMMNumeric object.US30YT=TWEB and US30YWI=TWEB are not exchange RICs. They are created by Tradeweb and Tradeweb provider may have given different hint values to the REAL data of the two RICs. RFA Java developers guide 10.3.2.10 Decoding OMMNumerics has detailed explanations of decoding the OMMNumeric data. If you add the following statements to the decoder process, you will be able to see the native value of REAL:
else if (data.getType() == OMMTypes.REAL) {
	 	 OMMNumeric real64 = ((OMMNumeric) data);
        	 byte _hint = real64.getHint();
        	 long _longVal= real64.getLongValue();        	 
        	 ps.println("[" + _hint+ "]["+longVal+"]");
        }

For instance, just now US30YT=TWEB returned ASK as "[30][24284]" where hint value 30 is "DIVISOR_256" and we can translate the value to 24284/256 and yield the value "94 220/256".

As for US30YTWI=TWEB, the ASK returned "?[10][31280]", hint value 10 is EXPONENT_NEG4. Therefor, the true value should be 31280*(10**(-4)) and hence gives the value "3.1280"

Thanks,

--- Steve

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
9.5k 10 5 7

Hello @applicationdevelopment

To convert a REAL field(fraction value) to double, you can use OMMNumeric.toDouble() which returns numeric converted to a double.

The example source code:

double doubleData = ((OMMNumeric) data).toDouble();  
System.out.print(fiddef.getName()+" string is " 
 + data + " and value is " + doubleData);

The example output:

BID string is 95 20/256 and value is 95.078125			
ASK string is 95 32/256 and value is 95.125

For more detail of OMMNumeric's methods, please refer to <RFAJ package>\Docs\refman\rfajava\com\reuters\rfa\omm\OMMNumeric.html

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.

Thank you for your quick response. We were comparing the responses for the two instrument codes US30YT=TWEB and US30YTWI=TWEB.

The refresh response for US30YTWI=TWEB comes back with decimal(double) notation for ASK and BID fields by US30YT=TWEB returns fractional notated value (e.g. 95 64/256) for the same ASK and BID fields.

Any reason why the field entry values are returned with different notation between these two instruments ?

thanks

Click below to post an Idea Post Idea