Main Content

bloombergEMSX

Create Bloomberg EMSX connection

Since R2021a

Description

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

Creation

Description

Local Connection

example

c = bloombergEMSX(servicename) creates a connection to the local Bloomberg EMSX communications server using the service servicename with the Bloomberg EMSX C++ interface.

Remote Connection

example

c = bloombergEMSX(servicename,authid,serverip) creates a connection to a remote EMSX server using the specified service name, authentication identifier, and server IP address.

example

c = bloombergEMSX(servicename,authid,serverip,portnumber) also specifies the port number of the machine running the EMSX Server process.

example

c = bloombergEMSX(servicename,authid,serverip,portnumber,terminalip) also specifies the IP address of the machine you use to access the Bloomberg Terminal for the remote connection.

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

'//blp/emapisvc'

Bloomberg EMSX authentication identifier, specified as a character vector or string scalar.

This input argument is required for Bloomberg EMSX Server. If you are using Bloomberg EMSX Desktop, specify an empty character vector or string scalar because this input argument is not required.

Bloomberg EMSX Server IP address, specified as a character vector or string scalar. This address is the IP address of the machine running the Bloomberg EMSX Server process.

This input argument is required for Bloomberg EMSX Server. If you are using Bloomberg EMSX Desktop, specify an empty character vector or string scalar because this input argument is not required.

Example: '111.222.333.44'

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

This input argument is required for Bloomberg EMSX Server. If you are using Bloomberg EMSX Desktop, specify an empty array because this input argument is not required.

Bloomberg Terminal IP address, specified as a character vector or string scalar. This address is the IP address of the machine you use to access the Bloomberg Terminal.

Example: '111.222.333.44'

Properties

expand all

This property is read-only.

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

Example: [1x1 datafeed.internal.BLPSession]

This property is read-only.

Bloomberg EMSX service, specified as a character vector.

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

Example: '//blp/emapisvc_beta'

This property is read-only.

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

Data Types: char

This property is read-only.

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

Example: 8194

Data Types: double

This property is read-only.

User, specified as a Bloomberg API C++ object for Bloomberg EMSX Server. For Bloomberg EMSX Desktop, this property is empty.

Example: [1×1 com.bloomberglp.blpapi.impl.by]

Object Functions

expand all

ordersObtain Bloomberg EMSX order subscription
routesObtain Bloomberg EMSX route subscription
closeClose Bloomberg EMSX connection
createOrderCreate Bloomberg EMSX order
routeOrderRoute Bloomberg EMSX order
routeOrderWithStratRoute Bloomberg EMSX order with strategies
groupRouteOrderRoute group of Bloomberg EMSX orders
groupRouteOrderWithStratRoute group of Bloomberg EMSX orders with strategies
createOrderAndRouteCreate and route Bloomberg EMSX order
createOrderAndRouteWithStratCreate and route Bloomberg EMSX order with strategies
createBasketCreate basket of Bloomberg EMSX orders
manualFillFill Bloomberg EMSX orders manually
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
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 using the Bloomberg EMSX C++ interface. You can place test calls using this service.

c = bloombergEMSX('//blp/emapisvc_beta');
c = 
 
  bloombergEMSX with properties:

    Session: [1×1 datafeed.internal.BLPSession]
    Service: '//blp/emapisvc_beta'
    Ipaddress: "111.222.333.44"
    Port: 8194.00
    User: []

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

  • Bloomberg EMSX session object

  • Bloomberg EMSX service

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

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

  • Bloomberg API C++ object

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 using the Bloomberg EMSX C++ interface. You can place live calls using this service.

c = bloombergEMSX('//blp/emapisvc')
c = 
 
  bloombergEMSX with properties:

    Session: [1×1 datafeed.internal.BLPSession]
    Service: '//blp/emapisvc'
    Ipaddress: "111.222.333.44"
    Port: 8194.00
    User: []

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

  • Bloomberg EMSX session object

  • Bloomberg EMSX service

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

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

  • Bloomberg API C++ object

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)

Obtain broker information using a Bloomberg EMSX test connection to a remote server.

Create a connection c to the Bloomberg EMSX remote server using the Bloomberg EMSX C++ interface. Specify the service name, authentication identifier, and server IP address.

servicename = '//blp/emapisvc_beta';
authid = 'abcdef123';
serverip = '111.222.333.44';
c = bloombergEMSX(servicename,authid,serverip)
c = 

  bloombergEMSX with properties:

    Session: [1×1 datafeed.internal.BLPSession]
    Service: '//blp/emapisvc_beta'
    Ipaddress: "111.222.333.44"
    Port: 8194.00
    User: []

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

  • Bloomberg EMSX session object

  • Bloomberg EMSX service

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

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

  • Bloomberg API C++ object

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)

Obtain broker information using a Bloomberg EMSX test connection to a remote server with a port number.

Create a connection c to the Bloomberg EMSX remote server using the Bloomberg EMSX C++ interface. Specify the service name, authentication identifier, server IP address, and port number.

servicename = '//blp/emapisvc_beta';
authid = 'abcdef123';
serverip = '111.222.333.44';
portnumber = 5678;
c = bloombergEMSX(servicename,authid,serverip,portnumber)
c = 
 
  bloombergEMSX with properties:

    Session: [1×1 datafeed.internal.BLPSession]
    Service: '//blp/emapisvc_beta'
    Ipaddress: "111.222.333.44"
    Port: 5678.00
    User: []

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

  • Bloomberg EMSX session object

  • Bloomberg EMSX service

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

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

  • Bloomberg API C++ object

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)

Obtain broker information using a Bloomberg EMSX test connection to a remote server with a port number and Bloomberg Terminal IP address.

Create a connection c to the Bloomberg EMSX remote server using the Bloomberg EMSX C++ interface. Specify the service name, authentication identifier, server IP address, and port number. Also, specify the IP address of the machine you use to access the Bloomberg Terminal.

servicename = '//blp/emapisvc_beta';
authid = 'abcdef123';
serverip = '111.222.333.44';
portnumber = 8194;
terminalip = '5555.222.333.44';
c = bloombergEMSX(servicename,authid,serverip,portnumber,terminalip)
c = 
 
  bloombergEMSX with properties:

    Session: [1×1 datafeed.internal.BLPSession]
    Service: '//blp/emapisvc_beta'
    Ipaddress: "111.222.333.44"
    Port: 8194.00
    User: []

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

  • Bloomberg EMSX session object

  • Bloomberg EMSX service

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

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

  • Bloomberg API C++ object

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)

Version History

Introduced in R2021a