Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

table2fix

Convert table containing FIX tags to cell array of FIX messages

Syntax

fixstr = table2fix(fixtable)

Description

example

fixstr = table2fix(fixtable) converts the FIX messages in the table fixtable to raw FIX messages in the cell array fixstr.

Examples

collapse all

Create two FIX messages using a table fixtable. The FIX protocol version is 4.4. The first row in the table represents a sell side transaction for 100 shares of symbol ABC. The order type is a previously quoted order. The order handling instruction is a private automated execution. The order transaction time is the current moment. The message type indicates a new order. The second row in the table has the same order field variables except that the order identifier is unique across orders.

fixtable = table({'FIX.4.4';'FIX.4.4'}, ...
    {'338';'339'},{'2';'2'}, ...
    {datestr(now);datestr(now)}, ...
    {'D';'D'},{'ABC';'ABC'}, ...
    {'1';'1'},{'D';'D'},{'100';'100'}, ...
    'VariableNames',{'BeginString' ...
    'CLOrdId' 'Side' 'TransactTime' ...
    'OrdType' 'Symbol' ...
    'HandlInst' 'MsgType' 'OrderQty'});

Convert the FIX messages in the table fixtable to a cell array of the raw FIX messages fixstr.

fixstr = table2fix(fixtable)
fixstr =

  2×1 cell array

    '8=FIX.4.4 35=D 11=338 54=2 60=16-Aug-2016 14:56:01 40=D 55=ABC 21=1 38...'
    '8=FIX.4.4 35=D 11=339 54=2 60=16-Aug-2016 14:56:01 40=D 55=ABC 21=1 38...'

Each character vector is a raw FIX message that contains FIX tags and values. The space in between the tag and value pairs is a SOH character. This character is not printable and has a hexadecimal value of 0x01.

Input Arguments

collapse all

FIX message, specified as table. The table variables correspond to FIX tag names. Each row contains the values you specify for the FIX message. Specify the values for each variable as a cell array of character vectors or string array.

Example: fixtable = table({'FIX.4.4';'FIX.4.4'},...
{'338';'339'},{'2';'2'},...
{datestr(now);datestr(now)},...
{'D';'D'},{'ABC';'ABC'},...
{'1';'1'},{'D';'D'},{'100';'100'},...
'VariableNames',{'BeginString' ...
'CLOrdId' 'Side' 'TransactTime' ...
'OrdType' 'Symbol' ...
'HandlInst' 'MsgType' 'OrderQty'});

Data Types: table

Output Arguments

collapse all

FIX message, returned as a cell array of one or more converted raw FIX messages. The number of messages in the output argument depends on the number of messages that you specify in the input argument.

Introduced in R2015b

Was this topic helpful?