emsx

Create Bloomberg EMSX connection

Description

The emsx function creates an emsx object, which represents a Bloomberg® EMSX connection. After you create an emsx object, you can use the object functions to create and route orders, and manage orders and routes. For details about Bloomberg EMSX, see the EMSX API Programmers Guide.

Creation

Syntax

c = emsx(servicename)

Description

example

c = emsx(servicename) creates a connection to the local Bloomberg EMSX communications server using the service servicename.

Input Arguments

expand all

Bloomberg EMSX service name, specified as one of these connection types.

Connection TypeBloomberg EMSX Service Name

Test

'//blp/emapisvc_beta'

Production

'//bmp/emapisvc'

Properties

expand all

Bloomberg EMSX session, specified as a Bloomberg EMSX session object.

Example: [1x1 com.bloomberglp.blpapi.Session]

Bloomberg EMSX service, specified as a Bloomberg EMSX service object.

The emsx function sets this property using the servicename input argument.

Example: [1x1 com.bloomberglp.blpapi.impl.aQ]

IP address of the machine running Bloomberg EMSX, specified as a character vector.

Data Types: char

Port number of the machine running Bloomberg EMSX, specified as a numeric scalar.

Example: 8194

Data Types: double

Object Functions

expand all

closeClose Bloomberg EMSX connection
ordersObtain Bloomberg EMSX order subscription
routesObtain Bloomberg EMSX route subscription
createOrderCreate Bloomberg EMSX order
routeOrderRoute Bloomberg EMSX order
routeOrderWithStratRoute Bloomberg EMSX order with strategies
groupRouteOrderWithStratRoute multiple Bloomberg EMSX orders with strategies
createOrderAndRouteCreate and route Bloomberg EMSX order
createOrderAndRouteWithStratCreate and route Bloomberg EMSX order with strategies
modifyOrderModify Bloomberg EMSX order
modifyRouteModify Bloomberg EMSX route
modifyRouteWithStratModify Bloomberg EMSX route with strategies
deleteOrderDelete Bloomberg EMSX order
deleteRouteDelete Bloomberg EMSX active shares
processEventSample Bloomberg EMSX event handler
emsxOrderBlotterBloomberg EMSX example order blotter
getBrokerInfoObtain Bloomberg EMSX broker and strategy information
getAllFieldMetaDataObtain Bloomberg EMSX field information

Examples

collapse all

First, create a Bloomberg EMSX test service connection. Then, obtain broker information.

Create a connection c to the Bloomberg EMSX test service. You can place test calls using this service.

 c = emsx('//blp/emapisvc_beta') 
c = 
 
  emsx with properties:

      Session: [1x1 com.bloomberglp.blpapi.Session]
      Service: [1x1 com.bloomberglp.blpapi.impl.aQ]
    Ipaddress: 'localhost'
         Port: 8194

MATLAB® returns c as the connection to the Bloomberg EMSX test service with the following properties:

  • Bloomberg EMSX session object

  • Bloomberg EMSX service object

  • IP address of the machine running the Bloomberg EMSX test service

  • Port number of the machine running the Bloomberg EMSX test service

Define the broker and strategy information structure brokerstrat. Obtain broker information using the Bloomberg EMSX connection c and structure brokerstrat.

The EMSX_BROKERS field lists the Bloomberg EMSX brokers.

brokerstrat.EMSX_TICKER = 'ABCD US Equity';

r = getBrokerInfo(c,brokerstrat)
 r = 
 
        EMSX_BROKERS: {2x1 cell} 

Close the Bloomberg EMSX connection.

close(c)

First, create a Bloomberg EMSX production service connection. Then, obtain broker information.

Create a connection c to the Bloomberg EMSX production service. You can place live calls using this service.

c = emsx('//bmp/emapisvc')
c = 
 
  emsx with properties:

      Session: [1x1 com.bloomberglp.blpapi.Session]
      Service: [1x1 com.bloomberglp.blpapi.impl.aQ]
    Ipaddress: 'localhost'
         Port: 8194

MATLAB returns c as the connection to the Bloomberg EMSX test service with the following properties:

  • Bloomberg EMSX session object

  • Bloomberg EMSX service object

  • IP address of the machine running the Bloomberg EMSX production service

  • Port number of the machine running the Bloomberg EMSX production service

Define the broker and strategy information structure brokerstrat. Obtain broker information using the Bloomberg EMSX connection c and structure brokerstrat.

The EMSX_BROKERS field lists the Bloomberg EMSX brokers.

brokerstrat.EMSX_TICKER = 'ABCD US Equity';

r = getBrokerInfo(c,brokerstrat)
 r = 
 
        EMSX_BROKERS: {2x1 cell} 

Close the Bloomberg EMSX connection.

close(c)

Introduced in R2013a