Login Page - Create Account

DTC Protocol Discussion Forum


Date/Time: Fri, 29 Nov 2024 16:33:27 +0000



Post From: market depth volume precision

[2015-09-20 09:58:57]
vbmithr - Posts: 204
There is one thread where you talked about making the quantity value in a DTC integer Order message to also be an integer but the problem is we cannot just simply do that. There has to be a specification written and followed which defines how that integer is converted to a floating-point number in the same way there is a specification like this for price values.

Yes, but these always need to be a specifiation written and followed sowewhere. Buying 1.23 of something or 123443 of something has only a meaning when there is a specification of what this quantity means. Maybe in the first case you implicitely it is some currency, say USD, and that it a number of USDs. But you still follow an "implicit" specification. So yes this specification must be written somewhere, could be in security definition actually :)

The whole idea behind using integers in a market data feed is for compactness and/or accuracy. If the price and quantity/volume data is originally as integers and needs to remain as integers, you might as well just put those integers into doubles. There should not be any precision issue most likely, and not an accuracy problem either because it is only holding an integer.

It is clear that most of the times, the denomination of quantity/price are precise enough, but still, exact quantities should not be represented by doubles, there is no reason really to do this.

If I follow you, the only reason why you want to use doubles is because of the implicit convention that the "dot" is placed after the canonical amount of currency (when it's in USD, 12.23 means 12$ and 23 cents), but then, you can just as well adopt a global convention like in bitcoin (1e-8 is the smallest amount of currency) and express all prices like this.

Apart from "FIX uses float for prices" I don't see much a reason to use them.