With the previous Increased Precision release we started the successive rollout of fractional number representation to all our services (including real-time, historical and aggregated data), allowing to enable precision mode in properties.
Now the increased precision is available by default for dxFeed Java API.
Increased precision for price, turnover, size and volume fields
dxFeed enhances its systems to extend number representation to 64 bit. It now supports mantissas of up to 16 decimal digits and exponents ranging from -127 to 127 decimal positions.
“asDouble” methods are added to allow access to the increased precision in sizes and volumes. They return the values of size and volume fields as floating point numbers with fractions.
Example:
- getVolume returns total volume as integer number
- getVolumeAsDouble returns total volume as a floating point number with fractions
Technical details
To enable the support of increased precision, do the following:
- Migrate to dxFeed Java API version 3.297 or higher for streaming feed The increased precision mode will be enabled by default. To disable, use the JVM properties (-Ddxscheme.wide=false).
- For other APIs, please contact dxFeed Help Desk
- Use “asDouble” methods to get access to the increased precision in sizes and volumes for the following fields:
- Candle:
- volume
- bidVolume
- askVolume
- openInterest
- Order:
- size
- Quote:
- bidSize
- askSize
- TimeAndSale:
- size
- Trade,TradeETH:
- size
- dayVolume
- Candle:
NOTE: You will have to update your services to handle both ‘NaN’ and ‘0’ values in the fields mentioned above in the data you stream or download irrespective of whether you’re enabling the increased precision.
Please refer to dxFeed Help Desk if you have any questions or concerns.