Main Content

emsxOrderBlotter

BloombergEMSX example order blotter

Description

example

[t,潜艇] = emsxOrderBlotter(c)displays a trader's order information.cis the Bloomberg®EMSX connection,tis the timer object associated with the event handler, and潜艇is the Bloomberg EMSX subscription list.

Examples

collapse all

Create the Bloomberg EMSX connectionc.

c = emsx('//blp/emapisvc_beta');

Open Bloomberg EMSX order blotter using the Bloomberg EMSX connectionc.

[t,subs] = emsxOrderBlotter(c)
Timer Object: timer-1 Timer Settings ExecutionMode: fixedRate Period: 1 BusyMode: drop Running: on Callbacks TimerFcn: {@processEventToBlotter [1x1 emsx]} ErrorFcn: '' StartFcn: '' StopFcn: '' subs = com.bloomberglp.blpapi.SubscriptionList@3e24da58

emsxOrderBlotterreturns the timer object output and the Bloomberg EMSX subscription list object. For details about the timer object, seetimer.

EMSX Order Blotter displays order information, such as sequence number, side, type, and broker, in a table format.

The order blotter displays the current order information for a trader.

Create the order request structureorderto define the order parameters. This code creates a buy market order for 330 shares of IBM®. This code uses the brokerBBwith the time in force set toDAYand any hand instruction. Convert the number of shares to a 32-bit signed integer usingint32.

order.EMSX_TICKER ='IBM';order.EMSX_AMOUNT = int32(330); order.EMSX_ORDER_TYPE ='MKT';order.EMSX_BROKER ='BB';order.EMSX_TIF ='DAY';order.EMSX_HAND_INSTRUCTION ='ANY';order.EMSX_SIDE ='BUY'

Create and route the order using the Bloomberg EMSX connectioncand the order request structureorder. Use the custom event handlerprocessEventToBlotterby setting the name-value pair argument'useDefaultEventHandler'tofalse.

events = createOrderAndRoute(c,order,'useDefaultEventHandler',false)
events = [] CreateOrderAndRoute = { EMSX_SEQUENCE = 381499 EMSX_ROUTE_ID = 1 MESSAGE = Order created and routed }

createOrderAndRoutecreates the order, routes the order, and returns a structureeventsthat contains an empty double.processEventToBlotterdisplays output fromcreateOrderAndRoutewith the order numberEMSX_SEQUENCE, route numberEMSX_ROUTE_ID, and message: Order created and routed.

EMSX Order Blotter displays order information, such as sequence number, side, type, and broker, in a table format.

The order blotter updates using the information for the created and routed order, where order numberEMSX_SEQUENCEis381499, using the event handler functionprocessEventToBlotter. The order blotter updates as orders are created and managed.

Close the Bloomberg EMSX connection.

close(c)

Input Arguments

collapse all

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

Output Arguments

collapse all

MATLAB timer, returned as a MATLAB object. For details, seetimer.

Bloomberg EMSX subscription list, returned as a Bloomberg EMSX subscription list object.

Version History

Introduced in R2013a