How to publish a price with double.MAXVALUE to subscriber using RFA.
Best Answer
-
It depends on the type of field which holds this data. If it is Real, you need to use encodeReal. You can verify it from the RDMFieldDictionary file.
!
!ACRONYM DDE ACRONYM FID RIPPLES TO FIELD TYPE LENGTH RWF TYPE RWF LEN
!------- ----------- --- ---------- ---------- ------ -------- -------
!
TRDPRC_1 "LAST" 6 TRDPRC_2 PRICE 17 REAL64 7For example, if you are using the TRDPRC_1 field, you need to call encodeReal. However, TREP may be unable to cache the data (Double.MAX_VALUE) because the value may exceed the 7 bytes (the RWF maximum field length for caching).
Therefore, you may need to create your custom fields which a negative field identifier to hold the Double.MAX_VALUE in TREP cache.
Instead of using Double.MAX_VALUE, you can set it as blank for no value.
0
Answers
-
In what language?
I'll take a guess that you mean
Double.MAX_VALUE
, hence you are referring to Java?Therefore my reply: Publish into a field of type
DOUBLE
. According to the RFA Javadocs it can hold such a value.But I'm wondering:
- Why use IEEE floating point types? In the financial world, and in particular with market data, it is almost never acceptable to be inaccurate.
- Why do you want to publish a max value?
My 2c. :-)
0 -
Thank you for you reply!
Which api should i use to encode the pirce. encodeReal or encodeDoule, is there any different should we condsider?
Why use IEEE floating point types? In the financial world, and in particular with market data, it is almost never acceptable to be inaccurate.
--the price is from future market,which means no price.
Why do you want to publish a max value?
--the price is from future market,which means no price.
0 -
Thanks for your reply.
Doule.max is a float data.
But wehen we use encode_doule api, we got a negative number which is not correct.
How to using encode_double api?
0 -
I have tested with direct connection by running QSConsumer to connect to QSProvider.
1. I have added a custom field with double type into RDMFieldDictionary file
TEST_DOUBLE "TEST DOUBLE" -12345 NULL DOUBLE 0 DOUBLE 8
Both QSProvider and QSConsumer use this local data dictionary.
2. Modify QSProvider to publish Double.MAX_VALUE in both refresh and update messages
_encoder.encodeFieldEntryInit( (short)-12345, OMMTypes.DOUBLE);
_encoder.encodeDouble(Double.MAX_VALUE);;3. Modify QSConsumer to check for Double.MAX_VALUE
if(data.getType()==OMMTypes.DOUBLE) {
double d = ((OMMNumeric)data).toDouble();
if(d == Double.MAX_VALUE) {
System.out.println("### Get Double.MAX_VALUE");
}
}The result from QSConsumer indicates that it can retrieve Double.MAX_VALUE in the custom double field (-12345 TEST_DOUBLE).
FIELD_LIST
FIELD_ENTRY 6/TRDPRC_1: 10.6000
FIELD_ENTRY 22/BID: 10.4000
FIELD_ENTRY 25/ASK: 10.8000
FIELD_ENTRY 32/ACVOL_1: 700
FIELD_ENTRY -12345/TEST_DOUBLE: ### Get Double.MAX_VALUE0
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
- 684 Datastream
- 1.4K DSS
- 614 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
- 248 ETA
- 552 WebSocket API
- 37 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
- 641 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
- 26 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 191 TREP Infrastructure
- 228 TRKD
- 915 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 89 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛