QuickFIX/J Documentation:
http://www.quickfixj.org/documentation/QuickFIX/J Support:
http://www.quickfixj.org/support/Ivan,
By default QFJ uses doubles everywhere. You can re-generate the source
code to use BigDecimals instead - this is what we do in the
Marketcetera Trading Platform.
See
http://www.quickfixj.org/quickfixj/usermanual/usage/codegen.htmlfor more information. You can specify -Dgenerator.decimal=true or
change the build.xml file to have
<property name="generator.decimal" value="true" />
in order to recompile QFJ to use only BigDecimals.
On Tue, Sep 8, 2009 at 1:04 PM, Ivan Voras<
[hidden email]> wrote:
> QuickFIX/J Documentation:
http://www.quickfixj.org/documentation/> QuickFIX/J Support:
http://www.quickfixj.org/support/>
>
> Hi,
>
> I am receiving a stream of market data that should nominally have the
> scale of 4 decimal places to the right of the decimal dot, and seeing
> raw protocol data I can confirm that this really is so. However, the
> way I'm getting the data is via the getValue() method on the instance
> of MDEntryPx, which returns the "double" data type.
>
> Internally, the application immediately converts this value to
> BigDecimal but I have noticed that the "double" value gets converted
> literarily, with all the imprecision and problems in representation of
> floating point numbers; e.g. all values have garbage decimals after
> the 10th or so decimal place and some of them convert as a
> semi-infinite sequences of 1s or 9s.
>
> I'd like to ask:
>
> a) why has this, seemingly dubious, design decision been make instead
> of using BigDecimal all over the place and
>
> b) if there is really no way to get a direct conversion between the
> ASCII data as transmitted by the protocol and the application, is it
> safe enough to use .scale() on the BigDecimal after the conversion
> from double with 4 as the scale and the HALF_UP rounding mode?
>
> --
> f+rEnSIBITAhITAhLR1nM9F4cIs5KJrhbcsVtUIt7K1MhWJy1A==
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.
http://p.sf.net/sfu/bobj-july> _______________________________________________
> Quickfixj-users mailing list
>
[hidden email]
>
https://lists.sourceforge.net/lists/listinfo/quickfixj-users>
--
Toli Kuznets
http://www.marketcetera.com: Open-Source Trading Platform
download.run.trade.
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.
http://p.sf.net/sfu/bobj-july_______________________________________________
Quickfixj-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quickfixj-users