RDC Support query for CITIC Bank
Best Answer
-
I suppose because those price are from a market place where quoting is still done in fractions. I can't tell from your screenshot exactly what that market is, but in all of the world there are still a few (very few) market places left where quoting is still done in fractions, meaning "910 3/8" instead of "910.375".
Quoting in fractions is a historical left-over. Most market places went through a process known as "decimalisation" about 10-15 years ago where quoting was changed from using fractions to using decimals. But as I said, there are still some markets left where quoting is done in fractions (hint of where to look for this in the world: Americans like to hang onto strange ways of measurement :-))
The RFA API has functionality to deal with fractions behind your back. It is only when you do things like "toString()" that you'll see that that the actual value is a fractional, not decimal. So it is not really something that you need to concern yourself with as a developer. However, for display purposes it is more correct to display the value as "910 3/8" (nine-hundred and ten plus three eigths) rather than "910.375".
2
Answers
-
Hello @pengbiyang
Some string as an end of every price that the client sees is the fraction of price. That means REF_PRICE =910 2/8 is 910.25 in decimal format. This is calculated from 910 + 2/8(0.25).
An application can print a price in fraction format e.g. 910 2/8 when it calls OMMData.toString() method. The method applies a hint automatically. The hint is used in the REAL types (REAL, REAL32 or REAL64) which is the type of price fields. The hint specifies denominators for fractions, specifies exponents, or indicates the value is blank. If the client would like to print a price which hint is fraction divisor in decimal format e.g. 910.25 instead of 910 2/8, the application has to perform this by itself.
The example snipped source code in RFA Java to print decimal format instead of fraction divisor e.g. 910.25 instead of 910 2/8 is shown below:
private static void decodePrimitive(OMMData data)
{
if (data == null)
return;
if( data.isBlank())
return;
short dataType = data.getType();
switch (dataType)
{
case OMMTypes.REAL:
case OMMTypes.REAL_4RB:
case OMMTypes.REAL_8RB:
{
OMMNumeric ommNum = ((OMMNumeric)data);
//getLongValue() is to get the long part of real which is used in conjunction with hint.
//For example: 910 2/8, the long value is 7282 and the hint is DIVISOR_8.
long value = ommNum.getLongValue();
byte hint = ommNum.getHint();
prnDecimalofFractionalREAL(data, hint, value);
break;
}
//another case
...
}
}
private static void prnDecimalofFractionalREAL(OMMData data, byte hint, long value)
{
//check if the data is a fraction divisor e.g. 910 2/8
if(hint >= com.reuters.rfa.omm.OMMNumeric.DIVISOR_1) {
//Example: 910 2/8, the long value is 7282 and the hint is DIVISOR_8.
//DIVISOR_8 value is 25 while DIVISOR_1 value is 22.
//exponent = 25-22 =3
byte exponent = (byte) ((byte)hint - (byte)OMMNumeric.DIVISOR_1);
//divisor = 2^3 = 8
long divisor = (long)(Math.pow(2, exponent));
//decimalValue 7282/8 = 910.25
double decimalValue = (double)((double)value/(double)divisor);
//output: OMMData.toString() of REAL is 910 2/8; Decimal is 910.25
System.out.println("OMMData.toString() of REAL is "
+ data.toString() + "; Decimal is " + decimalValue);
}
}For more details of hint and REAL types (e.g. price fields), please refer to [RFA_Java_Package]/Docs/refman/rfajava/com/reuters/rfa/omm/OMMNumeric.html
Hope this help.
0
Categories
- All Categories
- 6 AHS
- 38 Alpha
- 161 App Studio
- 4 Block Chain
- 4 Bot Platform
- 16 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 367 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 59 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛