Main Content

deleteOrder

删除BloombergEMSX order

Description

example

events= deleteOrder(c,ordernum)deletes a Bloomberg®EMSX order using the Bloomberg EMSX connectioncand order number or structureordernum.deleteOrderreturns a status message using the default event handler.

example

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

example

deleteOrder(___,'useDefaultEventHandler',false)deletes a Bloomberg EMSX order using any of the input arguments in the previous syntaxes and a custom event handler. Write a custom event handler to process the events associated with deleting orders. This syntax does not have an output argument because the custom event handler processes the contents of the event queue. If you want to use the default event handler instead, set the flag'useDefaultEventHandler'totrueand use theeventsoutput argument. By default, the flag'useDefaultEventHandler'is set totrue.

example

___= deleteOrder(c,ordernum,options)uses theoptionsstructure to customize the output, which is useful to preconfigure and save your options for repeated use. The availableoptionsstructure fields aretimeOutanduseDefaultEventHandler. Use theeventsoutput argument whenuseDefaultEventHandleris set totrueand omit this output argument whenuseDefaultEventHandleris set tofalse.

Examples

collapse all

To delete a Bloomberg EMSX order, create the connectioncusingemsx, set up the order subscription usingorders, and create an order usingcreateOrder. For an example showing these activities, seeCreate and Manage Bloomberg EMSX Order.

Define the structureordernumthat contains the order sequence numberEMSX_SEQUENCEfor the order to delete.

ordernum.EMSX_SEQUENCE = 335877;

删除the order using the Bloomberg EMSX connectioncandordernum.

事件= deleteOrder (c,ordernum)
events = STATUS: '0' MESSAGE: 'Order deleted'

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

  • Bloomberg EMSX status

  • Bloomberg EMSX message

Unsubscribe from order events using the Bloomberg EMSX subscription list objectsubs. This code assumesorderscreatessubs.

c.Session.unsubscribe(subs)

Close the Bloomberg EMSX connection.

close(c)

To delete a Bloomberg EMSX order, create the connectioncusingemsx, set up the order subscription usingorders, and create an order usingcreateOrder. For an example showing these activities, seeCreate and Manage Bloomberg EMSX Order.

删除the order using the Bloomberg EMSX connectioncand the order sequence number335877for the order to delete.

事件= deleteOrder (c,335877)
events = STATUS: '0' MESSAGE: 'Order deleted'

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

  • Bloomberg EMSX status

  • Bloomberg EMSX message

Unsubscribe from order events using the Bloomberg EMSX subscription list objectsubs. This code assumesorderscreatessubs.

c.Session.unsubscribe(subs)

Close the Bloomberg EMSX connection.

close(c)

To delete a Bloomberg EMSX order, create the connectioncusingemsx, set up the order subscription usingorders, and create an order usingcreateOrder. For an example showing these activities, seeCreate and Manage Bloomberg EMSX Order.

Define the structureordernumthat contains the order sequence numberEMSX_SEQUENCEfor the order to delete.

ordernum.EMSX_SEQUENCE = 335877;

删除the order using the Bloomberg EMSX connectioncandordernum. Set the timeout value to 200 milliseconds.

事件= deleteOrder (c,ordernum,'timeOut',200)
events = STATUS: '0' MESSAGE: 'Order deleted'

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

  • Bloomberg EMSX status

  • Bloomberg EMSX message

Unsubscribe from order events using the Bloomberg EMSX subscription list objectsubs. This code assumesorderscreatessubs.

c.Session.unsubscribe(subs)

Close the Bloomberg EMSX connection.

close(c)

To delete a Bloomberg EMSX order, create the Bloomberg EMSX connectioncusingemsx, set up the order subscription usingorders, and create an order usingcreateOrder. For an example showing these activities, seeCreate and Manage Bloomberg EMSX Order.

Define the structureordernumthat contains the order sequence numberEMSX_SEQUENCEfor the order to delete.

ordernum.EMSX_SEQUENCE = 335877;

Suppose you create a custom event handler function calledeventhandlerwith input argumentc. Runeventhandlerusingtimer. Start the timer to runeventhandlerimmediately usingstart. For details, seeWriting and Running Custom Event Handler Functions.

t = timer('TimerFcn',{@c.eventhandler},'Period',1,...'ExecutionMode','fixedRate') start(t)

tis the MATLAB®timer object. For details, seetimer.

删除the order using the Bloomberg EMSX connectioncandordernum. Set the flag'useDefaultEventHandler'tofalseso thateventhandlerprocesses the events associated with deleting an order.

deleteOrder(c,ordernum,'useDefaultEventHandler',false)

Unsubscribe from order events using the Bloomberg EMSX subscription list objectsubs. This code assumesorderscreatessubs. Stop the timer to stop data updates usingstop.

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

If you are done processing data updates, delete the timer usingdelete.

delete(t)

Close the Bloomberg EMSX connection.

close(c)

To delete a Bloomberg EMSX order, create the connectioncusingemsx, set up the order subscription usingorders, and create an order usingcreateOrder. For an example showing these activities, seeCreate and Manage Bloomberg EMSX Order.

Define the structureordernumthat contains the order sequence numberEMSX_SEQUENCEfor the order to delete.

ordernum.EMSX_SEQUENCE = 335877;

Create a structureoptions. To use the default event handler, set the fielduseDefaultEventHandlertotrue. Set the fieldtimeOutto 200 milliseconds. Delete the order using the Bloomberg EMSX connectionc,ordernum, and options structureoptions.

options.useDefaultEventHandler = true; options.timeOut = 200; events = deleteOrder(c,ordernum,options)
events = STATUS: '0' MESSAGE: 'Order deleted'

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

  • Bloomberg EMSX status

  • Bloomberg EMSX message

Unsubscribe from order events using the Bloomberg EMSX subscription list objectsubs. This code assumesorderscreatessubs.

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.

Order numbers to delete, specified as a structure or an integer to denote one or more order sequence numbers.

Data Types:struct|int32

Timeout value, specified as a nonnegative integer. This integer denotes the time, in milliseconds, that the event handler listens to the event queue for each iteration of the code. The event handler can be a default or custom event handler.

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 theoptionsstructure.

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,eventsis a structure containing the current contents of the event queue. Otherwise,eventsis an empty double.

Version History

Introduced in R2013a