FIXTradingCommunity / fix-simple-binary-encoding

A FIX standard for binary message encoding
Other
263 stars 69 forks source link

Semantic type with Decimal encoding for a field which is not a Price, Qty, Amt or Percentage #51

Closed RFrenkel closed 6 years ago

RFrenkel commented 7 years ago

Hi Don and company, Which Semantic type should I use for a field that requires a decimal encoding, but is not a Price, Qty, Amt or Percentage type? It looks to me that SBE should allow for generic Decimal semantic type which isn't limiting the fields to be of any of the above FIX types.

donmendelson commented 7 years ago

In FIX, the base type of Price, Qty, Amt and Percentage is called "float". It may be used as a semantic type if it doesn't fit those specific categories.

(The FIX Repository contains the datatype taxonomy and mapping to other standards. Float and its subtypes all map to xs:decimal in FIXML.)

RFrenkel commented 7 years ago

I have been using Float in these cases, but the RC4 documentation doesn't allow for a Float to be presented as decimal encoding: https://github.com/FIXTradingCommunity/fix-simple-binary-encoding/blob/master/v1-0-RC4/doc/02FieldEncoding.md

Could the documentation be updated to allow for it?

donmendelson commented 7 years ago

I see your point. There is confusion between FIX semantic type float and IEEE floating point primitive. The FIX semantic type system doesn't properly distinguish between floating point and fixed point numbers or between binary and exact decimal numbers.

donmendelson commented 7 years ago

Discussed on June 21 call.

There are issues with the FIX datatype taxonomy. The float type is used represent ratios, rates, price increments and more. This should be clarified.

Nevertheless, semanticType attribute is metadata for the application layer. SBE implementations should not restrict wire format based on semantic type.