@@ -11,18 +11,17 @@ and message schema but are introduced here as an overview.
1111
1212### Semantic data type
1313
14- The FIX semantic data type of a field tells a data domain in a broad
15- sense, for example, whether it is numeric or character data, or whether
16- it represents a time or price. Simple Binary Encoding represents all of
14+ The FIX semantic data type of a field tells a data domain interpreted at the application layer, for example, whether it is numeric or character data, or whether it represents a time or price. Simple Binary Encoding represents all of
1715the semantic data types that FIX protocol has defined across all
1816encodings. In message specifications, FIX data type is declared with
1917attribute semanticType. See the section 2.2 below for a listing of those
2018FIX types.
2119
2220### Encoding
2321
24- Encoding tells how a field of a specific data type is encoded on the
25- wire. An encoding maps a FIX data type to either a simple, primitive
22+ Encoding tells how a data element is encoded on the wire. Encoding belongs strictly to the presentation layer. It is context-free and carries no business semantics.
23+
24+ An encoding maps a FIX data type to either a simple, primitive
2625data type, such as a 32 bit signed integer, or to a composite type. A
2726composite type is composed of two or more simple primitive types. For
2827example, the FIX data type Price is encoded as a decimal, a composite
@@ -142,17 +141,10 @@ Attributes are optional unless specified otherwise.
142141| maxValue | The highest valid value of a range (inclusive unless specified otherwise). Applies to scalar data types, but not to String or data types. |
143142| semanticType | Tells the FIX semantic type of a field or encoding. It may be specified on either a field or its encoding. |
144143
145- ### Inherited attributes
146-
147- The attributes listed above apply to a field element or its encoding
148- (wire format). Any attributes specified on an encoding are inherited by
149- fields that use that encoding.
150-
151144### Non-FIX types
152145
153146Encodings may be added to SBE messages that do not correspond to listed
154- FIX data types. In that case, the encoding and fields that use the
155- encoding will not have a semanticType attribute.
147+ FIX data types. In that case, the fields that use the encoding will not have a semanticType attribute.
156148
157149Integer encoding
158150-------------------------------------------------------------------------------------------------------------------------------------------------------------
@@ -386,17 +378,17 @@ FIX Qty data type is a float type, but a decimal may be constrained to
386378integer values by setting exponent to zero.
387379
388380``` xml
389- <composite name =" intQty32" semanticType = " Qty " >
381+ <composite name =" intQty32" >
390382 <type name =" mantissa" primitiveType =" int32" />
391383 <type name =" exponent" primitiveType =" int8"
392384 presence =" constant" >0</type >
393385</composite >
394386```
395387
396- Field inherits semanticType from encoding
388+ A field uses the encoding and adds semanticType.
397389
398390``` xml
399- <field type =" intQty32" name =" OrderQty" id =" 38"
391+ <field type =" intQty32" name =" OrderQty" id =" 38" semanticType = " Qty "
400392 description =" Total number of shares" />
401393```
402394
@@ -515,7 +507,7 @@ control character (code 0).
515507This is the standard encoding for char type.
516508
517509``` xml
518- <type name =" char " primitiveType =" char" semanticType = " char " />
510+ <type name =" charType " primitiveType =" char" />
519511```
520512
521513Wire format of char encoding of "A" (ASCII value 65, hexadecimal 41)
@@ -553,10 +545,9 @@ encoding.
553545A typical string encoding specification
554546
555547``` xml
556- <type name =" string6" primitiveType =" char" semanticType =" String"
557- length =" 6" />
548+ <type name =" string6" primitiveType =" char" length =" 6" />
558549
559- <field type =" string6" name =" Symbol" id =" 55" />
550+ <field type =" string6" name =" Symbol" id =" 55" semanticType = " String " />
560551```
561552
562553Wire format of a character array in character and hexadecimal formats
@@ -568,11 +559,10 @@ M S F T
568559A character array constant specification
569560
570561``` xml
571- <type name =" EurexMarketID" semanticType =" Exchange"
572- primitiveType =" char" length =" 4" description =" MIC code"
562+ <type name =" EurexMarketID" primitiveType =" char" length =" 4" description =" MIC code"
573563 presence =" constant" >XEUR</type >
574564
575- <field type =" EurexMarketID" name =" MarketID" id =" 1301" />
565+ <field type =" EurexMarketID" name =" MarketID" id =" 1301" semanticType = " Exchange " />
576566```
577567
578568### Variable-length string encoding
@@ -628,9 +618,9 @@ Encoding specification for variable length data up to 65535 octets
628618
629619``` xml
630620<composite name =" varString" description =" Variable-length string" >
631- <type name =" length" primitiveType =" uint16" semanticType = " Length " />
621+ <type name =" length" primitiveType =" uint16" />
632622 <type name =" data" length =" 0" primitiveType =" uint8"
633- semanticType = " data " characterEncoding =" UTF-16" />
623+ characterEncoding =" UTF-16" />
634624</composite >
635625
636626<data name =" SecurityDesc" id =" 107" type =" varString" />
@@ -743,8 +733,8 @@ Encoding specification for variable length data up to 65535 octets
743733
744734``` xml
745735<composite name =" DATA" description =" Variable-length data" >
746- <type name =" length" primitiveType =" uint16" semanticType = " Length " />
747- <type name =" data" length =" 0" primitiveType =" uint8" semanticType = " data " />
736+ <type name =" length" primitiveType =" uint16" />
737+ <type name =" data" length =" 0" primitiveType =" uint8" />
748738</composite >
749739
750740<data name =" RawData" id =" 96" type =" DATA" />
@@ -797,7 +787,7 @@ required and optional elements.
797787The standard encoding specification for MonthYear
798788
799789``` xml
800- <composite name =" monthYear" semanticType = " MonthYear " >
790+ <composite name =" monthYear" >
801791 <type name =" year" primitiveType =" uint16" presence =" optional"
802792 nullValue =" 65536" />
803793 <type name =" month" primitiveType =" uint8" minValue =" 1" maxValue =" 12" />
@@ -810,7 +800,9 @@ The standard encoding specification for MonthYear
810800
811801Example MonthYear field specification
812802
813- <field type =" monthYear " name =" MaturityMonthYear " id =" 200 " />
803+ ``` xml
804+ <field type =" monthYear" name =" MaturityMonthYear" id =" 200" semanticType =" MonthYear" />
805+ ```
814806
815807Wire format of MonthYear 2014 June week 3 as hexadecimal
816808
@@ -869,7 +861,7 @@ Enumeration of time units:
869861Timestamp with variable time units:
870862
871863``` xml
872- <composite name =" UTCTimestamp" description =" UTC timestamp with precision on the wire" semanticType = " UTCTimestamp " >
864+ <composite name =" UTCTimestamp" description =" UTC timestamp with precision on the wire" >
873865 <type name =" time" primitiveType =" uint64" />
874866 <type name =" unit" primitiveType =" uint8" />
875867</composite >
@@ -878,7 +870,7 @@ Timestamp with variable time units:
878870Timestamp with constant time unit:
879871
880872``` xml
881- <composite name =" UTCTimestampNanos" description =" UTC timestamp with nanosecond precision" semanticType = " UTCTimestamp " >
873+ <composite name =" UTCTimestampNanos" description =" UTC timestamp with nanosecond precision" >
882874 <type name =" time" primitiveType =" uint64" />
883875 <type name =" unit" primitiveType =" uint8" presence =" constant" valueRef =" TimeUnit.nanosecond" />
884876</composite >
@@ -887,7 +879,7 @@ Timestamp with constant time unit:
887879Time only with variable time units:
888880
889881``` xml
890- <composite name =" UTCTime" description =" Time of day with precision on the wire" semanticType = " UTCTimeOnly " >
882+ <composite name =" UTCTime" description =" Time of day with precision on the wire" >
891883 <type name =" time" primitiveType =" uint64" />
892884 <type name =" unit" primitiveType =" uint8" />
893885</composite >
@@ -896,7 +888,7 @@ Time only with variable time units:
896888Time only with constant time unit:
897889
898890``` xml
899- <composite name =" UTCTimeNanos" description =" Time of day with millisecond precision" semanticType = " UTCTimeOnly " >
891+ <composite name =" UTCTimeNanos" description =" Time of day with millisecond precision" >
900892 <type name =" time" primitiveType =" uint64" />
901893 <type name =" unit" primitiveType =" uint8" presence =" constant" valueRef =" TimeUnit.millisecond" />
902894</composite >
@@ -905,7 +897,7 @@ Time only with constant time unit:
905897Date only specification:
906898
907899``` xml
908- <type name =" date" primitiveType =" uint16" semanticType = " UTCDateOnly " />
900+ <type name =" date" primitiveType =" uint16" />
909901```
910902
911903### Examples of date/time fields
@@ -915,7 +907,7 @@ hours, 17 minutes and 22 seconds since the UNIX epoch) with default
915907schema attributes
916908
917909``` xml
918- <composite name =" UTCTimestampNanos" description =" UTC timestamp with nanosecond precision" semanticType = " UTCTimestamp " >
910+ <composite name =" UTCTimestampNanos" description =" UTC timestamp with nanosecond precision" >
919911<type name =" time" primitiveType =" uint64" />
920912<type name =" unit" primitiveType =" uint8" presence =" constant" valueRef =" TimeUnit.nanosecond" />
921913</composite >
@@ -930,7 +922,7 @@ byte order
930922since midnight UTC) with default schema attributes
931923
932924``` xml
933- <composite name =" UTCTimeOnlyNanos" description =" UTC time of day with nanosecond precision" semanticType = " UTCTimeOnly " >
925+ <composite name =" UTCTimeOnlyNanos" description =" UTC time of day with nanosecond precision" >
934926 <type name =" time" primitiveType =" uint64" />
935927 <type name =" unit" primitiveType =" uint8" presence =" constant" valueRef =" TimeUnit.nanosecond" />
936928</composite >
@@ -944,7 +936,7 @@ Wire format of UTCTimeOnly
944936default schema attributes
945937
946938``` xml
947- <type name =" date" primitiveType =" uint16" semanticType = " UTCDateOnly " />
939+ <type name =" date" primitiveType =" uint16" />
948940```
949941
950942Wire format of UTCDateOnly
@@ -964,7 +956,7 @@ time at the market instead of UTC time.
964956The standard encoding specification for LocalMktDate
965957
966958``` xml
967- <type name =" localMktDate" primitiveType =" uint16" semanticType = " LocalMktDate " />
959+ <type name =" localMktDate" primitiveType =" uint16" />
968960```
969961
970962Local time encoding
@@ -997,7 +989,7 @@ elements within the composite encoding. See section 4.4.4.3 below.
997989Standard TZTimestamp encoding specification
998990
999991``` xml
1000- <composite name =" tzTimestamp" semanticType = " TZTimestamp " >
992+ <composite name =" tzTimestamp" >
1001993 <type name =" time" primitiveType =" uint64" />
1002994 <type name =" unit" primitiveType =" uint8" />
1003995 <!-- Sign of timezone offset is on hour subfield -->
@@ -1036,7 +1028,7 @@ elements within the composite encoding. See section 4.4.4.3 below.
10361028Standard TZTimeOnly encoding specification
10371029
10381030``` xml
1039- <composite name =" tzTimeOnly" semanticType = " TZTimeOnly " >
1031+ <composite name =" tzTimeOnly" >
10401032 <type name =" time" primitiveType =" uint64" />
10411033 <type name =" unit" primitiveType =" uint8" />
10421034 <!-- Sign of timezone offset is on hour subfield -->
@@ -1169,13 +1161,7 @@ Standard encoding specifications for required and optional Boolean
11691161fields
11701162
11711163``` xml
1172- <enum name =" booleanEnum" encodingType =" uint8" semanticType =" Boolean" >
1173- <validValue name =" false" >0</validValue >
1174- <validValue name =" true" >1</validValue >
1175- </enum >
1176-
1177- <enum name =" optionalBoolean" encodingType =" uint8" presence =" optional"
1178- nullValue =" 255" semanticType =" Boolean" >
1164+ <enum name =" booleanEnum" encodingType =" uint8" >
11791165 <validValue name =" false" >0</validValue >
11801166 <validValue name =" true" >1</validValue >
11811167</enum >
@@ -1184,7 +1170,9 @@ fields
11841170Example optional Boolean field
11851171
11861172``` xml
1187- <field type =" optionalBoolean" name =" SolicitedFlag" id =" 377" />
1173+ <field type =" requiredBoolean" name =" SolicitedFlag" id =" 377" presence =" required" semanticType =" Boolean" />
1174+
1175+ <field type =" optionalBoolean" name =" SolicitedFlag" id =" 377" presence =" optional" nullValue =" 255" semanticType =" Boolean" />
11881176```
11891177
11901178Wire format of true value as hexadecimal
0 commit comments