Code covered by the BSD License  

Highlights from
Algorithmic Trading with Bloomberg EMSX and MATLAB

image thumbnail

Algorithmic Trading with Bloomberg EMSX and MATLAB

by

 

Files used in the webinar which can be viewed at http://www.optinum.co.za/webinars/contact_main.php

Algorithmic Trading with MATLAB and Bloomberg EMSX: Online System

Algorithmic Trading with MATLAB and Bloomberg EMSX: Online System

This demo uses our simple intraday moving average strategy to develop a trading system. Based on historical and current data, the decision engine decides whether or not to trade, and sends orders to the desktop trade executation system in real time. The desktop trade execution system is Bloomberg EMSX. We will use Bloomberg API's test server and one of their dummy broker's, BB.

Contents

Pre-Trading Tasks

Add BLPAPI3.jar to java class path javaaddpath('C:\blp\API\blpapi3.jar')

Connect to Bloomberg V3 Communications Server For the data

b = blp;

Connect to the EMSX API Production Server c = emsx('//blp/emapisvc');

Connect to EMSX API Test Server This creates a Bloomberg EMSX connection object.

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

Fetch equity data from Bloomberg BLP datafeed

equity = 'SBK'; % Ticker symbol for equity around which we will develop the strategy. This can be changed.

startTime = today;
endTime = now;
annualScaling = sqrt(250*7*60);

Ticker = strcat(equity,' Equity');

% Get raw tick data:
todaysData = timeseries(b,Ticker,{startTime,endTime}); % gives back trade, time stamp, price, quantity

todaysTimes = cell2mat(todaysData(:,2));
todaysPrices = cell2mat(todaysData(:,3));

Execute strategy

% Parameters:
lagParam = 43;
leadParam = 34;

First Trade

currentPrices = todaysPrices(end-(lagParam - 1):end);
currentTimes = todaysTimes(end-(lagParam - 1):end);

signal = constructTradingSignal(currentPrices,leadParam,lagParam);

if signal ~= 0
    executeTrades(c, equity, signal)
end

Go for 5 minutes

presentTime = now;
initialTime = presentTime;

while presentTime <= initialTime + 5/60/24;
    newData = timeseries(b,Ticker,{endTime,presentTime}); % get raw tick data between now and endTime

    newPrices = [currentPrices; cell2mat(todaysData(:,3))];% append to previous data
    newTimes = [currentTimes; cell2mat(todaysData(:,2))];

    signal = constructTradingSignal(currentPrices,leadParam,lagParam);

    if signal ~= 0
        executeTrades(c, equity, signal)
    end

    % update times
    endtTime = presentTime;
    presentTime = now;
end

Save Results

save OnlineSystemCurrentTicker20130902
Warning: com.bloomberglp.blpapi.Session@57cb7ea is not serializable 
Warning: com.bloomberglp.blpapi.Session@57cb7ea is not serializable 
Warning: com.bloomberglp.blpapi.Session@3f0e6676 is not serializable 
Warning: Service //blp/emapisvc_beta

Operations = {

    OPERATION CreateOrder = {

        Request = {

            TYPE CreateOrderRequest(SEQUENCE) {

                DEFINITION EMSX_SIDE {

                    Min Value = 1

                    Max Value = 1

                    TYPE SideEnum(ENUMERATION) {

                        SideEnum(STRING) {

                            BUY = BUY

                            BUYM = BUYM

                            COVR = COVR

                            SELL = SELL

                            SHRT = SHRT

                            SHRX = SHRX

                            SLPL = SLPL

                            B/O = B/O

                            B/C = B/C

                            S/C = S/C

                            S/O = S/O

                        } // End ConstantsList

                    } // End Type: SideEnum

                } // End Definition: EMSX_SIDE

                DEFINITION EMSX_AMOUNT {

                    Min Value = 1

                    Max Value = 1

                    TYPE Int32

                } // End Definition: EMSX_AMOUNT

                DEFINITION EMSX_TICKER {

                    Min Value = 1

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_TICKER

                DEFINITION EMSX_ORDER_TYPE {

                    Min Value = 1

                    Max Value = 1

                    TYPE OrderTypeEnum(ENUMERATION) {

                        OrderTypeEnum(STRING) {

                            CD = CD

                            FUN = FUN

                            LMT = LMT

                            LOC = LOC

                            MKT = MKT

                            MOC = MOC

                            OC = OC

                            SL = SL

                            ST = ST

                            PEG = PEG

                        } // End ConstantsList

                    } // End Type: OrderTypeEnum

                } // End Definition: EMSX_ORDER_TYPE

                DEFINITION EMSX_TIF {

                    Min Value = 1

                    Max Value = 1

                    TYPE TifEnum(ENUMERATION) {

                        TifEnum(STRING) {

                            DAY = DAY

                            FOK = FOK

                            GTC = GTC

                            GTD = GTD

                            GTX = GTX

                            IOC = IOC

                            OPG = OPG

                            CLO = CLO

                        } // End ConstantsList

                    } // End Type: TifEnum

                } // End Definition: EMSX_TIF

                DEFINITION EMSX_HAND_INSTRUCTION {

                    Min Value = 1

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_HAND_INSTRUCTION

                DEFINITION EMSX_LIMIT_PRICE {

                    Min Value = 0

                    Max Value = 1

                    TYPE Float64

                } // End Definition: EMSX_LIMIT_PRICE

                DEFINITION EMSX_BROKER {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_BROKER

                DEFINITION EMSX_ACCOUNT {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_ACCOUNT

                DEFINITION EMSX_NOTES {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_NOTES

                DEFINITION EMSX_GTD_DATE {

                    Min Value = 0

                    Max Value = 1

                    TYPE Int32

                } // End Definition: EMSX_GTD_DATE

                DEFINITION EMSX_EXEC_INSTRUCTION {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_EXEC_INSTRUCTION

                DEFINITION EMSX_SETTLE_DATE {

                    Min Value = 0

                    Max Value = 1

                    TYPE Int32

                } // End Definition: EMSX_SETTLE_DATE

                DEFINITION EMSX_STOP_PRICE {

                    Min Value = 0

                    Max Value = 1

                    TYPE Float64

                } // End Definition: EMSX_STOP_PRICE

                DEFINITION EMSX_P_A {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_P_A

                DEFINITION EMSX_EXCHANGE_DESTINATION {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_EXCHANGE_DESTINATION

                DEFINITION EMSX_ODD_LOT {

                    Min Value = 0

                    Max Value = 1

                    TYPE Int32

                } // End Definition: EMSX_ODD_LOT

                DEFINITION EMSX_CFD_FLAG {

                    Min Value = 0

                    Max Value = 1

                    TYPE Int32

                } // End Definition: EMSX_CFD_FLAG

                DEFINITION EMSX_RELEASE_TIME {

                    Min Value = 0

                    Max Value = 1

                    TYPE Int32

                } // End Definition: EMSX_RELEASE_TIME

                DEFINITION EMSX_GET_WARNINGS {

                    Min Value = 0

                    Max Value = 1

                    TYPE Int32

                } // End Definition: EMSX_GET_WARNINGS

                DEFINITION EMSX_ORDER_ORIGIN {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_ORDER_ORIGIN

                DEFINITION EMSX_CLEARING_ACCOUNT {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_CLEARING_ACCOUNT

                DEFINITION EMSX_CLEARING_FIRM {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_CLEARING_FIRM

                DEFINITION REQUEST_EXT {

                    Min Value = 0

                    Max Value = unbounded

                    TYPE String

                } // End Definition: REQUEST_EXT

                DEFINITION EMSX_LOCATE_REQ {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_LOCATE_REQ

                DEFINITION EMSX_LOCATE_BROKER {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_LOCATE_BROKER

                DEFINITION EMSX_LOCATE_ID {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_LOCATE_ID

                DEFINITION EMSX_STRATEGY_PARAMS {

                    Min Value = 0

                    Max Value = 1

                    TYPE Strategy(SEQUENCE) {

                        DEFINITION EMSX_STRATEGY_NAME {

                            Min Value = 1

                            Max Value = 1

                            TYPE String

                        } // End Definition: EMSX_STRATEGY_NAME

                        DEFINITION EMSX_STRATEGY_FIELDS {

                            Min Value = 1

                            Max Value = 20

                            TYPE FieldData(SEQUENCE) {

                                DEFINITION EMSX_FIELD_DATA {

                                    Min Value = 1

                                    Max Value = 1

                                    TYPE String

                                } // End Definition: EMSX_FIELD_DATA

                            } // End Type: FieldData

                 
Warning: com.bloomberglp.blpapi.Session@3f0e6676 is not serializable 
Warning: Service //blp/emapisvc_beta

Operations = {

    OPERATION CreateOrder = {

        Request = {

            TYPE CreateOrderRequest(SEQUENCE) {

                DEFINITION EMSX_SIDE {

                    Min Value = 1

                    Max Value = 1

                    TYPE SideEnum(ENUMERATION) {

                        SideEnum(STRING) {

                            BUY = BUY

                            BUYM = BUYM

                            COVR = COVR

                            SELL = SELL

                            SHRT = SHRT

                            SHRX = SHRX

                            SLPL = SLPL

                            B/O = B/O

                            B/C = B/C

                            S/C = S/C

                            S/O = S/O

                        } // End ConstantsList

                    } // End Type: SideEnum

                } // End Definition: EMSX_SIDE

                DEFINITION EMSX_AMOUNT {

                    Min Value = 1

                    Max Value = 1

                    TYPE Int32

                } // End Definition: EMSX_AMOUNT

                DEFINITION EMSX_TICKER {

                    Min Value = 1

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_TICKER

                DEFINITION EMSX_ORDER_TYPE {

                    Min Value = 1

                    Max Value = 1

                    TYPE OrderTypeEnum(ENUMERATION) {

                        OrderTypeEnum(STRING) {

                            CD = CD

                            FUN = FUN

                            LMT = LMT

                            LOC = LOC

                            MKT = MKT

                            MOC = MOC

                            OC = OC

                            SL = SL

                            ST = ST

                            PEG = PEG

                        } // End ConstantsList

                    } // End Type: OrderTypeEnum

                } // End Definition: EMSX_ORDER_TYPE

                DEFINITION EMSX_TIF {

                    Min Value = 1

                    Max Value = 1

                    TYPE TifEnum(ENUMERATION) {

                        TifEnum(STRING) {

                            DAY = DAY

                            FOK = FOK

                            GTC = GTC

                            GTD = GTD

                            GTX = GTX

                            IOC = IOC

                            OPG = OPG

                            CLO = CLO

                        } // End ConstantsList

                    } // End Type: TifEnum

                } // End Definition: EMSX_TIF

                DEFINITION EMSX_HAND_INSTRUCTION {

                    Min Value = 1

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_HAND_INSTRUCTION

                DEFINITION EMSX_LIMIT_PRICE {

                    Min Value = 0

                    Max Value = 1

                    TYPE Float64

                } // End Definition: EMSX_LIMIT_PRICE

                DEFINITION EMSX_BROKER {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_BROKER

                DEFINITION EMSX_ACCOUNT {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_ACCOUNT

                DEFINITION EMSX_NOTES {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_NOTES

                DEFINITION EMSX_GTD_DATE {

                    Min Value = 0

                    Max Value = 1

                    TYPE Int32

                } // End Definition: EMSX_GTD_DATE

                DEFINITION EMSX_EXEC_INSTRUCTION {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_EXEC_INSTRUCTION

                DEFINITION EMSX_SETTLE_DATE {

                    Min Value = 0

                    Max Value = 1

                    TYPE Int32

                } // End Definition: EMSX_SETTLE_DATE

                DEFINITION EMSX_STOP_PRICE {

                    Min Value = 0

                    Max Value = 1

                    TYPE Float64

                } // End Definition: EMSX_STOP_PRICE

                DEFINITION EMSX_P_A {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_P_A

                DEFINITION EMSX_EXCHANGE_DESTINATION {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_EXCHANGE_DESTINATION

                DEFINITION EMSX_ODD_LOT {

                    Min Value = 0

                    Max Value = 1

                    TYPE Int32

                } // End Definition: EMSX_ODD_LOT

                DEFINITION EMSX_CFD_FLAG {

                    Min Value = 0

                    Max Value = 1

                    TYPE Int32

                } // End Definition: EMSX_CFD_FLAG

                DEFINITION EMSX_RELEASE_TIME {

                    Min Value = 0

                    Max Value = 1

                    TYPE Int32

                } // End Definition: EMSX_RELEASE_TIME

                DEFINITION EMSX_GET_WARNINGS {

                    Min Value = 0

                    Max Value = 1

                    TYPE Int32

                } // End Definition: EMSX_GET_WARNINGS

                DEFINITION EMSX_ORDER_ORIGIN {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_ORDER_ORIGIN

                DEFINITION EMSX_CLEARING_ACCOUNT {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_CLEARING_ACCOUNT

                DEFINITION EMSX_CLEARING_FIRM {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_CLEARING_FIRM

                DEFINITION REQUEST_EXT {

                    Min Value = 0

                    Max Value = unbounded

                    TYPE String

                } // End Definition: REQUEST_EXT

                DEFINITION EMSX_LOCATE_REQ {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_LOCATE_REQ

                DEFINITION EMSX_LOCATE_BROKER {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_LOCATE_BROKER

                DEFINITION EMSX_LOCATE_ID {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_LOCATE_ID

                DEFINITION EMSX_STRATEGY_PARAMS {

                    Min Value = 0

                    Max Value = 1

                    TYPE Strategy(SEQUENCE) {

                        DEFINITION EMSX_STRATEGY_NAME {

                            Min Value = 1

                            Max Value = 1

                            TYPE String

                        } // End Definition: EMSX_STRATEGY_NAME

                        DEFINITION EMSX_STRATEGY_FIELDS {

                            Min Value = 1

                            Max Value = 20

                            TYPE FieldData(SEQUENCE) {

                                DEFINITION EMSX_FIELD_DATA {

                                    Min Value = 1

                                    Max Value = 1

                                    TYPE String

                                } // End Definition: EMSX_FIELD_DATA

                            } // End Type: FieldData

                 
Warning: com.bloomberglp.blpapi.Session@3f0e6676 is not serializable 
Warning: Service //blp/emapisvc_beta

Operations = {

    OPERATION CreateOrder = {

        Request = {

            TYPE CreateOrderRequest(SEQUENCE) {

                DEFINITION EMSX_SIDE {

                    Min Value = 1

                    Max Value = 1

                    TYPE SideEnum(ENUMERATION) {

                        SideEnum(STRING) {

                            BUY = BUY

                            BUYM = BUYM

                            COVR = COVR

                            SELL = SELL

                            SHRT = SHRT

                            SHRX = SHRX

                            SLPL = SLPL

                            B/O = B/O

                            B/C = B/C

                            S/C = S/C

                            S/O = S/O

                        } // End ConstantsList

                    } // End Type: SideEnum

                } // End Definition: EMSX_SIDE

                DEFINITION EMSX_AMOUNT {

                    Min Value = 1

                    Max Value = 1

                    TYPE Int32

                } // End Definition: EMSX_AMOUNT

                DEFINITION EMSX_TICKER {

                    Min Value = 1

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_TICKER

                DEFINITION EMSX_ORDER_TYPE {

                    Min Value = 1

                    Max Value = 1

                    TYPE OrderTypeEnum(ENUMERATION) {

                        OrderTypeEnum(STRING) {

                            CD = CD

                            FUN = FUN

                            LMT = LMT

                            LOC = LOC

                            MKT = MKT

                            MOC = MOC

                            OC = OC

                            SL = SL

                            ST = ST

                            PEG = PEG

                        } // End ConstantsList

                    } // End Type: OrderTypeEnum

                } // End Definition: EMSX_ORDER_TYPE

                DEFINITION EMSX_TIF {

                    Min Value = 1

                    Max Value = 1

                    TYPE TifEnum(ENUMERATION) {

                        TifEnum(STRING) {

                            DAY = DAY

                            FOK = FOK

                            GTC = GTC

                            GTD = GTD

                            GTX = GTX

                            IOC = IOC

                            OPG = OPG

                            CLO = CLO

                        } // End ConstantsList

                    } // End Type: TifEnum

                } // End Definition: EMSX_TIF

                DEFINITION EMSX_HAND_INSTRUCTION {

                    Min Value = 1

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_HAND_INSTRUCTION

                DEFINITION EMSX_LIMIT_PRICE {

                    Min Value = 0

                    Max Value = 1

                    TYPE Float64

                } // End Definition: EMSX_LIMIT_PRICE

                DEFINITION EMSX_BROKER {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_BROKER

                DEFINITION EMSX_ACCOUNT {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_ACCOUNT

                DEFINITION EMSX_NOTES {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_NOTES

                DEFINITION EMSX_GTD_DATE {

                    Min Value = 0

                    Max Value = 1

                    TYPE Int32

                } // End Definition: EMSX_GTD_DATE

                DEFINITION EMSX_EXEC_INSTRUCTION {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_EXEC_INSTRUCTION

                DEFINITION EMSX_SETTLE_DATE {

                    Min Value = 0

                    Max Value = 1

                    TYPE Int32

                } // End Definition: EMSX_SETTLE_DATE

                DEFINITION EMSX_STOP_PRICE {

                    Min Value = 0

                    Max Value = 1

                    TYPE Float64

                } // End Definition: EMSX_STOP_PRICE

                DEFINITION EMSX_P_A {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_P_A

                DEFINITION EMSX_EXCHANGE_DESTINATION {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_EXCHANGE_DESTINATION

                DEFINITION EMSX_ODD_LOT {

                    Min Value = 0

                    Max Value = 1

                    TYPE Int32

                } // End Definition: EMSX_ODD_LOT

                DEFINITION EMSX_CFD_FLAG {

                    Min Value = 0

                    Max Value = 1

                    TYPE Int32

                } // End Definition: EMSX_CFD_FLAG

                DEFINITION EMSX_RELEASE_TIME {

                    Min Value = 0

                    Max Value = 1

                    TYPE Int32

                } // End Definition: EMSX_RELEASE_TIME

                DEFINITION EMSX_GET_WARNINGS {

                    Min Value = 0

                    Max Value = 1

                    TYPE Int32

                } // End Definition: EMSX_GET_WARNINGS

                DEFINITION EMSX_ORDER_ORIGIN {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_ORDER_ORIGIN

                DEFINITION EMSX_CLEARING_ACCOUNT {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_CLEARING_ACCOUNT

                DEFINITION EMSX_CLEARING_FIRM {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_CLEARING_FIRM

                DEFINITION REQUEST_EXT {

                    Min Value = 0

                    Max Value = unbounded

                    TYPE String

                } // End Definition: REQUEST_EXT

                DEFINITION EMSX_LOCATE_REQ {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_LOCATE_REQ

                DEFINITION EMSX_LOCATE_BROKER {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_LOCATE_BROKER

                DEFINITION EMSX_LOCATE_ID {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_LOCATE_ID

                DEFINITION EMSX_STRATEGY_PARAMS {

                    Min Value = 0

                    Max Value = 1

                    TYPE Strategy(SEQUENCE) {

                        DEFINITION EMSX_STRATEGY_NAME {

                            Min Value = 1

                            Max Value = 1

                            TYPE String

                        } // End Definition: EMSX_STRATEGY_NAME

                        DEFINITION EMSX_STRATEGY_FIELDS {

                            Min Value = 1

                            Max Value = 20

                            TYPE FieldData(SEQUENCE) {

                                DEFINITION EMSX_FIELD_DATA {

                                    Min Value = 1

                                    Max Value = 1

                                    TYPE String

                                } // End Definition: EMSX_FIELD_DATA

                            } // End Type: FieldData

                 
Warning: com.bloomberglp.blpapi.Session@3f0e6676 is not serializable 
Warning: Service //blp/emapisvc_beta

Operations = {

    OPERATION CreateOrder = {

        Request = {

            TYPE CreateOrderRequest(SEQUENCE) {

                DEFINITION EMSX_SIDE {

                    Min Value = 1

                    Max Value = 1

                    TYPE SideEnum(ENUMERATION) {

                        SideEnum(STRING) {

                            BUY = BUY

                            BUYM = BUYM

                            COVR = COVR

                            SELL = SELL

                            SHRT = SHRT

                            SHRX = SHRX

                            SLPL = SLPL

                            B/O = B/O

                            B/C = B/C

                            S/C = S/C

                            S/O = S/O

                        } // End ConstantsList

                    } // End Type: SideEnum

                } // End Definition: EMSX_SIDE

                DEFINITION EMSX_AMOUNT {

                    Min Value = 1

                    Max Value = 1

                    TYPE Int32

                } // End Definition: EMSX_AMOUNT

                DEFINITION EMSX_TICKER {

                    Min Value = 1

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_TICKER

                DEFINITION EMSX_ORDER_TYPE {

                    Min Value = 1

                    Max Value = 1

                    TYPE OrderTypeEnum(ENUMERATION) {

                        OrderTypeEnum(STRING) {

                            CD = CD

                            FUN = FUN

                            LMT = LMT

                            LOC = LOC

                            MKT = MKT

                            MOC = MOC

                            OC = OC

                            SL = SL

                            ST = ST

                            PEG = PEG

                        } // End ConstantsList

                    } // End Type: OrderTypeEnum

                } // End Definition: EMSX_ORDER_TYPE

                DEFINITION EMSX_TIF {

                    Min Value = 1

                    Max Value = 1

                    TYPE TifEnum(ENUMERATION) {

                        TifEnum(STRING) {

                            DAY = DAY

                            FOK = FOK

                            GTC = GTC

                            GTD = GTD

                            GTX = GTX

                            IOC = IOC

                            OPG = OPG

                            CLO = CLO

                        } // End ConstantsList

                    } // End Type: TifEnum

                } // End Definition: EMSX_TIF

                DEFINITION EMSX_HAND_INSTRUCTION {

                    Min Value = 1

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_HAND_INSTRUCTION

                DEFINITION EMSX_LIMIT_PRICE {

                    Min Value = 0

                    Max Value = 1

                    TYPE Float64

                } // End Definition: EMSX_LIMIT_PRICE

                DEFINITION EMSX_BROKER {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_BROKER

                DEFINITION EMSX_ACCOUNT {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_ACCOUNT

                DEFINITION EMSX_NOTES {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_NOTES

                DEFINITION EMSX_GTD_DATE {

                    Min Value = 0

                    Max Value = 1

                    TYPE Int32

                } // End Definition: EMSX_GTD_DATE

                DEFINITION EMSX_EXEC_INSTRUCTION {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_EXEC_INSTRUCTION

                DEFINITION EMSX_SETTLE_DATE {

                    Min Value = 0

                    Max Value = 1

                    TYPE Int32

                } // End Definition: EMSX_SETTLE_DATE

                DEFINITION EMSX_STOP_PRICE {

                    Min Value = 0

                    Max Value = 1

                    TYPE Float64

                } // End Definition: EMSX_STOP_PRICE

                DEFINITION EMSX_P_A {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_P_A

                DEFINITION EMSX_EXCHANGE_DESTINATION {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_EXCHANGE_DESTINATION

                DEFINITION EMSX_ODD_LOT {

                    Min Value = 0

                    Max Value = 1

                    TYPE Int32

                } // End Definition: EMSX_ODD_LOT

                DEFINITION EMSX_CFD_FLAG {

                    Min Value = 0

                    Max Value = 1

                    TYPE Int32

                } // End Definition: EMSX_CFD_FLAG

                DEFINITION EMSX_RELEASE_TIME {

                    Min Value = 0

                    Max Value = 1

                    TYPE Int32

                } // End Definition: EMSX_RELEASE_TIME

                DEFINITION EMSX_GET_WARNINGS {

                    Min Value = 0

                    Max Value = 1

                    TYPE Int32

                } // End Definition: EMSX_GET_WARNINGS

                DEFINITION EMSX_ORDER_ORIGIN {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_ORDER_ORIGIN

                DEFINITION EMSX_CLEARING_ACCOUNT {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_CLEARING_ACCOUNT

                DEFINITION EMSX_CLEARING_FIRM {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_CLEARING_FIRM

                DEFINITION REQUEST_EXT {

                    Min Value = 0

                    Max Value = unbounded

                    TYPE String

                } // End Definition: REQUEST_EXT

                DEFINITION EMSX_LOCATE_REQ {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_LOCATE_REQ

                DEFINITION EMSX_LOCATE_BROKER {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_LOCATE_BROKER

                DEFINITION EMSX_LOCATE_ID {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_LOCATE_ID

                DEFINITION EMSX_STRATEGY_PARAMS {

                    Min Value = 0

                    Max Value = 1

                    TYPE Strategy(SEQUENCE) {

                        DEFINITION EMSX_STRATEGY_NAME {

                            Min Value = 1

                            Max Value = 1

                            TYPE String

                        } // End Definition: EMSX_STRATEGY_NAME

                        DEFINITION EMSX_STRATEGY_FIELDS {

                            Min Value = 1

                            Max Value = 20

                            TYPE FieldData(SEQUENCE) {

                                DEFINITION EMSX_FIELD_DATA {

                                    Min Value = 1

                                    Max Value = 1

                                    TYPE String

                                } // End Definition: EMSX_FIELD_DATA

                            } // End Type: FieldData

                 
Warning: com.bloomberglp.blpapi.Session@3f0e6676 is not serializable 
Warning: Service //blp/emapisvc_beta

Operations = {

    OPERATION CreateOrder = {

        Request = {

            TYPE CreateOrderRequest(SEQUENCE) {

                DEFINITION EMSX_SIDE {

                    Min Value = 1

                    Max Value = 1

                    TYPE SideEnum(ENUMERATION) {

                        SideEnum(STRING) {

                            BUY = BUY

                            BUYM = BUYM

                            COVR = COVR

                            SELL = SELL

                            SHRT = SHRT

                            SHRX = SHRX

                            SLPL = SLPL

                            B/O = B/O

                            B/C = B/C

                            S/C = S/C

                            S/O = S/O

                        } // End ConstantsList

                    } // End Type: SideEnum

                } // End Definition: EMSX_SIDE

                DEFINITION EMSX_AMOUNT {

                    Min Value = 1

                    Max Value = 1

                    TYPE Int32

                } // End Definition: EMSX_AMOUNT

                DEFINITION EMSX_TICKER {

                    Min Value = 1

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_TICKER

                DEFINITION EMSX_ORDER_TYPE {

                    Min Value = 1

                    Max Value = 1

                    TYPE OrderTypeEnum(ENUMERATION) {

                        OrderTypeEnum(STRING) {

                            CD = CD

                            FUN = FUN

                            LMT = LMT

                            LOC = LOC

                            MKT = MKT

                            MOC = MOC

                            OC = OC

                            SL = SL

                            ST = ST

                            PEG = PEG

                        } // End ConstantsList

                    } // End Type: OrderTypeEnum

                } // End Definition: EMSX_ORDER_TYPE

                DEFINITION EMSX_TIF {

                    Min Value = 1

                    Max Value = 1

                    TYPE TifEnum(ENUMERATION) {

                        TifEnum(STRING) {

                            DAY = DAY

                            FOK = FOK

                            GTC = GTC

                            GTD = GTD

                            GTX = GTX

                            IOC = IOC

                            OPG = OPG

                            CLO = CLO

                        } // End ConstantsList

                    } // End Type: TifEnum

                } // End Definition: EMSX_TIF

                DEFINITION EMSX_HAND_INSTRUCTION {

                    Min Value = 1

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_HAND_INSTRUCTION

                DEFINITION EMSX_LIMIT_PRICE {

                    Min Value = 0

                    Max Value = 1

                    TYPE Float64

                } // End Definition: EMSX_LIMIT_PRICE

                DEFINITION EMSX_BROKER {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_BROKER

                DEFINITION EMSX_ACCOUNT {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_ACCOUNT

                DEFINITION EMSX_NOTES {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_NOTES

                DEFINITION EMSX_GTD_DATE {

                    Min Value = 0

                    Max Value = 1

                    TYPE Int32

                } // End Definition: EMSX_GTD_DATE

                DEFINITION EMSX_EXEC_INSTRUCTION {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_EXEC_INSTRUCTION

                DEFINITION EMSX_SETTLE_DATE {

                    Min Value = 0

                    Max Value = 1

                    TYPE Int32

                } // End Definition: EMSX_SETTLE_DATE

                DEFINITION EMSX_STOP_PRICE {

                    Min Value = 0

                    Max Value = 1

                    TYPE Float64

                } // End Definition: EMSX_STOP_PRICE

                DEFINITION EMSX_P_A {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_P_A

                DEFINITION EMSX_EXCHANGE_DESTINATION {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_EXCHANGE_DESTINATION

                DEFINITION EMSX_ODD_LOT {

                    Min Value = 0

                    Max Value = 1

                    TYPE Int32

                } // End Definition: EMSX_ODD_LOT

                DEFINITION EMSX_CFD_FLAG {

                    Min Value = 0

                    Max Value = 1

                    TYPE Int32

                } // End Definition: EMSX_CFD_FLAG

                DEFINITION EMSX_RELEASE_TIME {

                    Min Value = 0

                    Max Value = 1

                    TYPE Int32

                } // End Definition: EMSX_RELEASE_TIME

                DEFINITION EMSX_GET_WARNINGS {

                    Min Value = 0

                    Max Value = 1

                    TYPE Int32

                } // End Definition: EMSX_GET_WARNINGS

                DEFINITION EMSX_ORDER_ORIGIN {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_ORDER_ORIGIN

                DEFINITION EMSX_CLEARING_ACCOUNT {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_CLEARING_ACCOUNT

                DEFINITION EMSX_CLEARING_FIRM {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_CLEARING_FIRM

                DEFINITION REQUEST_EXT {

                    Min Value = 0

                    Max Value = unbounded

                    TYPE String

                } // End Definition: REQUEST_EXT

                DEFINITION EMSX_LOCATE_REQ {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_LOCATE_REQ

                DEFINITION EMSX_LOCATE_BROKER {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_LOCATE_BROKER

                DEFINITION EMSX_LOCATE_ID {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_LOCATE_ID

                DEFINITION EMSX_STRATEGY_PARAMS {

                    Min Value = 0

                    Max Value = 1

                    TYPE Strategy(SEQUENCE) {

                        DEFINITION EMSX_STRATEGY_NAME {

                            Min Value = 1

                            Max Value = 1

                            TYPE String

                        } // End Definition: EMSX_STRATEGY_NAME

                        DEFINITION EMSX_STRATEGY_FIELDS {

                            Min Value = 1

                            Max Value = 20

                            TYPE FieldData(SEQUENCE) {

                                DEFINITION EMSX_FIELD_DATA {

                                    Min Value = 1

                                    Max Value = 1

                                    TYPE String

                                } // End Definition: EMSX_FIELD_DATA

                            } // End Type: FieldData

                 
Warning: com.bloomberglp.blpapi.Session@3f0e6676 is not serializable 
Warning: Service //blp/emapisvc_beta

Operations = {

    OPERATION CreateOrder = {

        Request = {

            TYPE CreateOrderRequest(SEQUENCE) {

                DEFINITION EMSX_SIDE {

                    Min Value = 1

                    Max Value = 1

                    TYPE SideEnum(ENUMERATION) {

                        SideEnum(STRING) {

                            BUY = BUY

                            BUYM = BUYM

                            COVR = COVR

                            SELL = SELL

                            SHRT = SHRT

                            SHRX = SHRX

                            SLPL = SLPL

                            B/O = B/O

                            B/C = B/C

                            S/C = S/C

                            S/O = S/O

                        } // End ConstantsList

                    } // End Type: SideEnum

                } // End Definition: EMSX_SIDE

                DEFINITION EMSX_AMOUNT {

                    Min Value = 1

                    Max Value = 1

                    TYPE Int32

                } // End Definition: EMSX_AMOUNT

                DEFINITION EMSX_TICKER {

                    Min Value = 1

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_TICKER

                DEFINITION EMSX_ORDER_TYPE {

                    Min Value = 1

                    Max Value = 1

                    TYPE OrderTypeEnum(ENUMERATION) {

                        OrderTypeEnum(STRING) {

                            CD = CD

                            FUN = FUN

                            LMT = LMT

                            LOC = LOC

                            MKT = MKT

                            MOC = MOC

                            OC = OC

                            SL = SL

                            ST = ST

                            PEG = PEG

                        } // End ConstantsList

                    } // End Type: OrderTypeEnum

                } // End Definition: EMSX_ORDER_TYPE

                DEFINITION EMSX_TIF {

                    Min Value = 1

                    Max Value = 1

                    TYPE TifEnum(ENUMERATION) {

                        TifEnum(STRING) {

                            DAY = DAY

                            FOK = FOK

                            GTC = GTC

                            GTD = GTD

                            GTX = GTX

                            IOC = IOC

                            OPG = OPG

                            CLO = CLO

                        } // End ConstantsList

                    } // End Type: TifEnum

                } // End Definition: EMSX_TIF

                DEFINITION EMSX_HAND_INSTRUCTION {

                    Min Value = 1

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_HAND_INSTRUCTION

                DEFINITION EMSX_LIMIT_PRICE {

                    Min Value = 0

                    Max Value = 1

                    TYPE Float64

                } // End Definition: EMSX_LIMIT_PRICE

                DEFINITION EMSX_BROKER {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_BROKER

                DEFINITION EMSX_ACCOUNT {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_ACCOUNT

                DEFINITION EMSX_NOTES {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_NOTES

                DEFINITION EMSX_GTD_DATE {

                    Min Value = 0

                    Max Value = 1

                    TYPE Int32

                } // End Definition: EMSX_GTD_DATE

                DEFINITION EMSX_EXEC_INSTRUCTION {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_EXEC_INSTRUCTION

                DEFINITION EMSX_SETTLE_DATE {

                    Min Value = 0

                    Max Value = 1

                    TYPE Int32

                } // End Definition: EMSX_SETTLE_DATE

                DEFINITION EMSX_STOP_PRICE {

                    Min Value = 0

                    Max Value = 1

                    TYPE Float64

                } // End Definition: EMSX_STOP_PRICE

                DEFINITION EMSX_P_A {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_P_A

                DEFINITION EMSX_EXCHANGE_DESTINATION {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_EXCHANGE_DESTINATION

                DEFINITION EMSX_ODD_LOT {

                    Min Value = 0

                    Max Value = 1

                    TYPE Int32

                } // End Definition: EMSX_ODD_LOT

                DEFINITION EMSX_CFD_FLAG {

                    Min Value = 0

                    Max Value = 1

                    TYPE Int32

                } // End Definition: EMSX_CFD_FLAG

                DEFINITION EMSX_RELEASE_TIME {

                    Min Value = 0

                    Max Value = 1

                    TYPE Int32

                } // End Definition: EMSX_RELEASE_TIME

                DEFINITION EMSX_GET_WARNINGS {

                    Min Value = 0

                    Max Value = 1

                    TYPE Int32

                } // End Definition: EMSX_GET_WARNINGS

                DEFINITION EMSX_ORDER_ORIGIN {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_ORDER_ORIGIN

                DEFINITION EMSX_CLEARING_ACCOUNT {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_CLEARING_ACCOUNT

                DEFINITION EMSX_CLEARING_FIRM {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_CLEARING_FIRM

                DEFINITION REQUEST_EXT {

                    Min Value = 0

                    Max Value = unbounded

                    TYPE String

                } // End Definition: REQUEST_EXT

                DEFINITION EMSX_LOCATE_REQ {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_LOCATE_REQ

                DEFINITION EMSX_LOCATE_BROKER {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_LOCATE_BROKER

                DEFINITION EMSX_LOCATE_ID {

                    Min Value = 0

                    Max Value = 1

                    TYPE String

                } // End Definition: EMSX_LOCATE_ID

                DEFINITION EMSX_STRATEGY_PARAMS {

                    Min Value = 0

                    Max Value = 1

                    TYPE Strategy(SEQUENCE) {

                        DEFINITION EMSX_STRATEGY_NAME {

                            Min Value = 1

                            Max Value = 1

                            TYPE String

                        } // End Definition: EMSX_STRATEGY_NAME

                        DEFINITION EMSX_STRATEGY_FIELDS {

                            Min Value = 1

                            Max Value = 20

                            TYPE FieldData(SEQUENCE) {

                                DEFINITION EMSX_FIELD_DATA {

                                    Min Value = 1

                                    Max Value = 1

                                    TYPE String

                                } // End Definition: EMSX_FIELD_DATA

                            } // End Type: FieldData

                 

Contact us