sendMessage

发送修复消息修理传单发动机

Description

example

status= sendMessage(c,fixmsg)sends the FIX messagefixmsg使用FIX Flyer™发动机连接c

Examples

collapse all

First, create a FIX Flyer Engine connection. Then, add a FIX Flyer event listener to the FIX Flyer Engine connection. Subscribe to FIX sessions. Create and send two FIX messages.

创建修复传单引擎连接cusing these arguments:

  • 用户名username

  • Passwordpassword

  • IP地址ipaddress

  • Port numberport

username ='user'; password ='pwd'; ipaddress ='127.0.0.1'; port = 7002; c = fixflyer(username,password,ipaddress,port);

Add the FIX Flyer event listener to the FIX Flyer Engine connection. Use the sample event handling listenerFixExamplelistener.to listen for and display the FIX Flyer Engine event data in the Workspace browser. To access the code for the listener, enter编辑FixExamplelistener.m.。或者,要以另一种方式处理事件数据,您可以编写自定义事件处理侦听器功能。有关详细信息,请参阅Create Functions in Files(matlab)。

Process the FIX Flyer Engine eventseusing the sample event handling listenerFixExamplelistener.。Specifyeas any letter.FixExamplelistener.returns a handle to the listenerlh

lh = addListener(c,@(~,e)fixExampleListener(e,c));

Subscribe to FIX sessions and set up the FIX Flyer Application Manager. Register with the FIX Flyer session. Connect the FIX Flyer Application Manager to the FIX Flyer Engine and start the internal receiving thread.

c.sessionid = flyer.core.session.sessionId('Α',。。。'Beta','fix.4.4'); c.FlyerApplicationManager.setLoadDefaultDataDictionary(false); c.FlyerApplicationManager.registerFIXSession(。。。flyer.apps.fixsessionsubscription(。。。C.SessionId,True,0));C.FlyerApplicationManager.Connect;c.flyerApplicationManager.Start;

Create a FIX message using table固定装置。This table contains two FIX messages. The first row in the table represents a sell side transaction for 100 shares of symbolABC。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 second row in the table has the same order field variables, except that the order identifier is unique across orders. The FIX protocol version is 4.4.

固定装置= 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''符号'。。。'HandlInst''MsgType''OrderQty'});

Send the FIX message using the FIX message固定装置

status包含发送的每个修复消息的修复传单引擎消息状态。如果修复消息已成功发送,status包含一个logical zero.statushas an entry for each FIX message in固定装置

status = sendMessage(c,fixtable)
status = 0 0

The MATLAB®Workspace variablefixResponseStructcontains the returned FIX messages from the FIX Flyer Engine.

Close the FIX Flyer Engine connection.

close(c)

Input Arguments

collapse all

修理传单发动机connection, specified as afixflyer.目的。

FIX message, specified as a table or structure.

Example:固定装置= 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''符号'。。。
'HandlInst' 'MsgType' 'OrderQty'});

Data Types:table|struct

Output Arguments

collapse all

Sent message status, returned as an array of logical zeroes or ones. The array contains an entry for each FIX message infixmsg。If a FIX message is sent successfully,status包含一个zero. Otherwise,status包含一个1

在R2015B中介绍