Trailing zeroes seem to be dropped from BID and ASK
Hi All,
We seem to be receiving BID and ASK fields with the trailing zeroes dropped.
We are currently using RFA Version: 7.5.0.L1.all.rrg
We notice that the upstream TREP system seems to be sending valid data but when we receive it we seem to be loosing the Trailing 0s (hence loosing the decimal precision).
This was sent from TREP:
Sipc message Sent: Len: 84 HdrLen: 6 Flags: 0 ProtId: 2 FD: 183
Tue Jun 22 04:07:35.307811 2021
SSL Update: srvcId: 18 ItemName: AUDGBP=TEST1 DataLen: 59
Data(59):
<FS>316<US>XX<GS>AUDGBP=TEST1<US><RS>
16<US>22 JUN 2021<RS>
5<US>04:07<RS>
22<US>+1.5490<FS>
Sipc message Sent: Len: 84 HdrLen: 6 Flags: 0 ProtId: 2 FD: 183
Tue Jun 22 04:07:42.316894 2021
SSL Update: srvcId: 18 ItemName: AUDGBP=TEST1 DataLen: 59
Data(59):
<FS>316<US>XX<GS>AUDGBP=TEST1<US><RS>
16<US>22 JUN 2021<RS>
5<US>04:07<RS>
25<US>+1.5500<FS>
However this is what we are receiving from our service (as per logs):
2021-07-01 14:35:42.813 +1000 pool-2-thread-1 TRACE MarketDataClient Processing: BID
2021-07-01 14:35:42.434 +1000 pool-2-thread-1 DEBUG MarketDataClient Received MARKET_DATA_ITEM_EVENT (data), value = 1.549, name = BID
2021-07-01 14:35:42.813 +1000 pool-2-thread-1 TRACE MarketDataClient Processing: ASK
2021-07-01 14:36:58.806 +1000 pool-2-thread-1 DEBUG MarketDataClient Received MARKET_DATA_ITEM_EVENT (data), value = 1.55, name = ASK
We have set downloadDataDictionary=true
Which means we receive the RDMFieldDictionary file from TREP
BID and ASK have the following configuration in the above file:
LENGTH: 17
RWF TYPE: REAL64
RWF LEN: 7
The following was suggested by @adam.centofanti, https://community.developers.refinitiv.com/questions/27828/rfa-8-java-api-market-price-decimal-precision.html
but sadly I could not go anywhere with it as my knowledge is very limited when it comes to RFA library.
Please let me know how we can best resolve this issue.
Regards,
Mithun.
Best Answer
-
You can try RawData() and convert it to a string.
byte[] test = field.RawData();
if(test != null) {
System.out.println("Raw: "+ new String(test));
}The output looks like this:
Raw: 0.7470
HIGH_1: 0.747 --> Hint Type:6, Hint Size:1, Hint Data:200
Answers
-
You can use Hint to determine the decimal places.
System.out.print(field.Name());
System.out.print(": ");
System.out.println(field.StringData()+" --> Hint Type:"+field.HintType()+", Hint Size:"+field.HintSize()+", Hint Data:"+field.HintData());
The output is:
HIGH_1: 0.747 --> Hint Type:6, Hint Size:1, Hint Data:20
LOW_1: 0.7456 --> Hint Type:6, Hint Size:1, Hint Data:20
CURRENCY: 840 --> Hint Type:6, Hint Size:2, Hint Data:261
ACTIV_DATE: 02 JUL 2021 --> Hint Type:6, Hint Size:2, Hint Data:258
OPEN_PRC: 0.7467 --> Hint Type:6, Hint Size:1, Hint Data:20
HST_CLOSE: 0.7469 --> Hint Type:6, Hint Size:1, Hint Data:20
BID: 0.7456 --> Hint Type:6, Hint Size:1, Hint Data:20
BID_1: 0.7456 --> Hint Type:6, Hint Size:1, Hint Data:20
BID_2: 0.7455 --> Hint Type:6, Hint Size:1, Hint Data:20Hint Type: 6 represents TIBMSG_UINT. Hint Data:20 represents HINT_DECIMAL_4.
0 -
Thank you for the reply @Jirapongse.
After applying the above changes, I get the following logs in the console:
Processing: BID
Received MARKET_DATA_ITEM_EVENT (data), value = 1.55, name = BID, Hint Type = 6, Hint Size = 1, Hint Data = 20
Processing: ASK
Received MARKET_DATA_ITEM_EVENT (data), value = 1.555, name = ASK, Hint Type = 6, Hint Size = 1, Hint Data = 20The issue here is we are loosing the zero's, i.e., we are receiving 1.55 instead of 1.5500 similar case with ask wherein we are receiving 1.555 instead of 1.5550.
Is there anything else we have to do to retain the trailing 0s?
0 -
Thank you for that!
Looks like the raw data is able to return the trailing zeroes:
Processing: BID Received MARKET_DATA_ITEM_EVENT (data), value = 1.55, name = BID, Hint Type = 6, Hint Size = 1, Hint Data = 20, Raw Data = +1.5500
Processing: ASK Received MARKET_DATA_ITEM_EVENT (data), value = 1.555, name = ASK, Hint Type = 6, Hint Size = 1, Hint Data = 20, Raw Data = +1.5550Is there an elegant solution to do this using RFA library itself rather than this (hacky) way, i.e., convert into byte array, check if null or empty and then convert to string?
Since we receive thousands of updates in a minute adding this logic may not be efficient in the long run, is there somewhere we can instruct not to remove trailing zeroes within the RFA framework itself?
0 -
RDC team provided the following response:
RFA truncates the prevailing zeros off the end of the BID/ASK fields. This is by design.
The MDSubDemo application gets 6 digit value from RFA as we can see this by printing field.rawData().
The application can use the same instead of using field.StringData(). This method is from TIB implementation and we don’t have control over it.
So it is suggested to use rawData and there wont be any fix from RFA.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
- 687 Datastream
- 1.4K DSS
- 622 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
- 254 ETA
- 557 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
- 276 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
- 673 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
- 229 TRKD
- 918 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
- 48 中文论坛