fix2struct

Convert FIX message to structure array

Description

example

fixstruct = fix2struct(fixstr) converts raw FIX messages in the cell array fixstr to a structure array fixstruct.

Examples

collapse all

For this example, assume that a counterparty sends you two raw FIX messages in fixstr. The FIX protocol version is 4.4.

Convert raw FIX messages in fixstr to a structure array fixstruct.

fixstruct = fix2struct(fixstr)
fixstruct = 

     BeginString: {2x1 cell}
         ClOrdID: {2x1 cell}
            Side: {2x1 cell}
    TransactTime: {2x1 cell}
         OrdType: {2x1 cell}
          Symbol: {2x1 cell}
       HandlInst: {2x1 cell}
         MsgType: {2x1 cell}
        OrderQty: {2x1 cell}

The structure array fixstruct contains a structure for each raw FIX message in fixstr. The structure fields correspond to the FIX tags in the raw FIX message.

Display the order type for each FIX message.

fixstruct.OrdType
ans = 

    'D'
    'D'

Both FIX messages specify previously quoted orders.

Input Arguments

collapse all

FIX message, specified as a cell array of one or more raw FIX messages.

Data Types: cell

Output Arguments

collapse all

FIX message, specified as a structure array containing the converted raw FIX messages in fixstr. The structure fields and values correspond to the FIX tag names and values in the raw FIX message.

Introduced in R2015b