主要内容

modifyOrder

调整BloombergEMSX order

Description

example

events= modifyOrder(c,modorder)修改彭博社®EMSX order using the Bloomberg EMSX connectionc和modify order request structuremodordermodifyOrder使用默认事件处理程序返回状态消息。

example

events= modifyOrder(c,modorder,'timeOut',timeout)specifies a timeout valuetimeoutfor the execution of the default event handler.

example

修改订单(___,'useDefaultEventHandler',false)使用上一个语法和自定义事件处理程序中的任何输入参数修改彭博社EMSX订单。编写一个自定义事件处理程序来处理与修改订单相关的事件。该语法没有输出参数,因为自定义事件处理程序处理事件队列的内容。如果要使用默认事件处理程序,请设置标志“ underefeaulteventhandler”to真的和use theeventsoutput argument. By default, the flag“ underefeaulteventhandler”被设定为真的

example

___= modifyOrder(c,modorder,options)uses theoptions自定义输出的结构,这对于预配置很有用,并保存您的选项以重复使用。可用options结构体fields aretimeOutUsedefaultEventHandler。利用theeventsoutput argument when the flagUsedefaultEventHandler被设定为真的和omit this output argument whenUsedefaultEventHandler被设定为false

Examples

collapse all

要修改彭博社EMSX订单,请创建连接cusingemsx, set up the order subscription usingorders,并使用createOrder。For an example showing these activities, see创建和管理Bloomberg EMSX订单

Define the structuremodorder其中包含顺序序列编号EMSX_SEQUENCE, 安全EMSX_TICKER, and the number of sharesemsx_amount。This code modifies the order number728905for 200 shares of IBM®。使用数字转换为32位签名的整数INT32

modorder.emsx_secorence = int32(728905);modorder.emsx_ticker ='IBM'; modorder.EMSX_AMOUNT = int32(200);

使用彭博EMSX连接修改订单cmodorder

events = modifyOrder(c,modorder)
events = EMSX_SEQUENCE: 728905 MESSAGE: 'Order Modified'

The default event handler processes the events associated with modifying the order.modifyOrderreturnseventsas a structure that contains these fields:

  • Bloomberg EMSX order number

  • Bloomberg EMSX message

Unsubscribe from order events using the Bloomberg EMSX subscription list objectsubs。This code assumes thatorders创建subs

c.Session.unsubscribe(subs)

Close the Bloomberg EMSX connection.

close(c)

要修改彭博社EMSX订单,请创建连接cusingemsx, set up the order subscription usingorders,并使用createOrder。For an example showing these activities, see创建和管理Bloomberg EMSX订单

Define the structuremodorder其中包含顺序序列编号EMSX_SEQUENCE, 安全EMSX_TICKER, and the number of sharesemsx_amount。This code modifies the order number728905IBM的200股。使用数字转换为32位签名的整数INT32

modorder.emsx_secorence = int32(728905);modorder.emsx_ticker ='IBM'; modorder.EMSX_AMOUNT = int32(200);

使用彭博EMSX连接修改订单cmodorder。Set the timeout value to 200 milliseconds.

事件= modifyOrder(C,Modorder,'timeOut',200)
events = EMSX_SEQUENCE: 728905 MESSAGE: 'Order Modified'

The default event handler processes the events associated with modifying the order.modifyOrderreturnseventsas a structure that contains these fields:

  • Bloomberg EMSX order number

  • Bloomberg EMSX message

Unsubscribe from order events using the Bloomberg EMSX subscription list objectsubs。This code assumes thatorders创建subs

c.Session.unsubscribe(subs)

Close the Bloomberg EMSX connection.

close(c)

要修改彭博社EMSX订单,请创建彭博社EMSX连接cusingemsx, set up the order subscription usingorders,并使用createOrder。For an example showing these activities, see创建和管理Bloomberg EMSX订单

Define the structuremodorder其中包含顺序序列编号EMSX_SEQUENCE, 安全EMSX_TICKER, and the number of sharesemsx_amount。This code modifies the order number728905IBM的200股。使用数字转换为32位签名的整数INT32

modorder.emsx_secorence = int32(728905);modorder.emsx_ticker ='IBM'; modorder.EMSX_AMOUNT = int32(200);

假设您创建一个称为的自定义事件处理程序功能eventhandler带有输入参数c。跑eventhandlerusing计时器。Start the timer to runeventhandlerimmediately usingstart。有关详细信息,请参阅编写和运行自定义事件处理程序功能

t =计时器('TimerFcn',{@c.eventhandler},'Period',1,。。。'ExecutionMode','fixedRate') start(t)

tis the MATLAB®计时器object. For details, see计时器

使用彭博EMSX连接修改订单cmodorder。Set the flag“ underefeaulteventhandler”tofalseso thateventhandlerprocesses the events associated with modifying an order.

修改订单(c,modorder,“ underefeaulteventhandler”,错误的)

Unsubscribe from order events using the Bloomberg EMSX subscription list objectsubs。This code assumes thatorders创建subs。停止计时器停止使用数据更新stop

c.Session.unsubscribe(subs) stop(t)

If you are done processing data updates, delete the timer using删除

删除(t)

Close the Bloomberg EMSX connection.

close(c)

要修改彭博社EMSX订单,请创建连接cusingemsx, set up the order subscription usingorders,并使用createOrder。For an example showing these activities, see创建和管理Bloomberg EMSX订单

Define the structuremodorder其中包含顺序序列编号EMSX_SEQUENCE, 安全EMSX_TICKER, and the number of sharesemsx_amount。This code modifies the order number728905IBM的200股。使用数字转换为32位签名的整数INT32

modorder.emsx_secorence = int32(728905);modorder.emsx_ticker ='IBM'; modorder.EMSX_AMOUNT = int32(200);

Create a structureoptions。要使用默认事件处理程序,请设置字段UsedefaultEventHandlerto真的。Set the fieldtimeOut到200毫秒。使用彭博EMSX连接修改订单c,modorder和选项结构options

options.usedefaulteventhandler = true;options.timeout = 200;事件= modifyOrder(C,Modorder,选项)
events = EMSX_SEQUENCE: 728905 MESSAGE: 'Order Modified'

The default event handler processes the events associated with modifying the order.modifyOrderreturnseventsas a structure that contains these fields:

  • Bloomberg EMSX order number

  • Bloomberg EMSX message

Unsubscribe from order events using the Bloomberg EMSX subscription list objectsubs。This code assumes thatorders创建subs

c.Session.unsubscribe(subs)

Close the Bloomberg EMSX connection.

close(c)

Input Arguments

collapse all

Bloomberg EMSX service connection, specified as a connection object created usingemsx

修改订单请求,指定为包含这些字段的结构。

利用getallfieldmetadatato view all available fields formodorder。使用数字转换为32位签名的整数INT32

Field

Description

EMSX_SEQUENCE

Bloomberg EMSX order sequence number

EMSX_TICKER

Bloomberg EMSX ticker symbol

emsx_amount

彭博社EMSX股票数量

例子:modorder.emsx_secorence = int32(728905);
modorder.emsx_ticker ='XYZ';
modorder.EMSX_AMOUNT = int32(100);

Data Types:struct

超时值,指定为非负整数。该整数表示时间为毫秒的时间,即事件处理程序听代码的每次迭代的事件队列。事件处理程序可以是默认或自定义事件处理程序。

Data Types:double

Options for a custom event handler or timeout value, specified as a structure. To reuse the settings for specifying a custom event handler or timeout value for the event handler, use theoptions结构体。

For example, specify using a custom event handler and a timeout value of 200 milliseconds.

options.useDefaultEventHandler = false; options.timeOut = 200;

Data Types:struct

Output Arguments

collapse all

Event queue contents, returned as a double or structure.

If the event queue contains events,events是包含事件队列的当前内容的结构。否则,eventsis an empty double.

Version History

在R2013a中引入