Quantcast

Documentation Center

  • Trial Software
  • Product Updates

getOrderInfo

Obtain Bloomberg EMSX order information

Syntax

  • R = getOrderInfo(c,reqStruct) example
  • R = getOrderInfo(c,reqStruct,Name,Value) example

Description

example

R = getOrderInfo(c,reqStruct) obtains Bloomberg® EMSX order information and returns a status message using the default event handler.

example

R = getOrderInfo(c,reqStruct,Name,Value) uses additional options specified by one or more Name, Value pair arguments. Obtain Bloomberg EMSX order information using optional name-value arguments to specify a custom event handler or timeout value for the event handler.

    Note:   Name-value pair arguments can be input as a single input structure containing some or all of the property fields, for example:

    p.timeOut = 1000;
    getOrderInfo(c,reqStruct,p)

Examples

expand all

Obtain Order Information for Bloomberg EMSX Using Default Event Handler

Define the reqstruct and note that EMSX_SEQUENCE must denote an existing order.

reqStruct.EMSX_SEQUENCE = int32(335877);
r = getOrderInfo(c,reqStruct)
r = 

               EMSX_TICKER: 'IBM'
             EMSX_EXCHANGE: 'US'
                 EMSX_SIDE: 'BUY'
             EMSX_POSITION: 'BUY'
             EMSX_PORT_MGR: 'CF'
               EMSX_TRADER: 'CF'
                EMSX_NOTES: ''
               EMSX_AMOUNT: 400
          EMSX_IDLE_AMOUNT: 150
              EMSX_WORKING: 0
               EMSX_FILLED: 250
            EMSX_TS_ORDNUM: 250
          EMSX_LIMIT_PRICE: 0
            EMSX_AVG_PRICE: 189.7900
                 EMSX_FLAG: 2
             EMSX_SUB_FLAG: 0
           EMSX_YELLOW_KEY: 'Equity'
          EMSX_BASKET_NAME: ''
    EMSX_ORDER_CREATE_DATE: '12/06/12'
    EMSX_ORDER_CREATE_TIME: '14:28:37'
           EMSX_ORDER_TYPE: 'MKT'
                  EMSX_TIF: 'DAY'
               EMSX_BROKER: 'BB'
          EMSX_TRADER_UUID: '1244972'
      EMSX_STEP_OUT_BROKER: ''

Obtain Order Information for Bloomberg EMSX Using Custom Event Handler

Define the reqstruct and note that EMSX_SEQUENCE and must denote an existing order.

reqStruct.EMSX_SEQUENCE = int32(335877);
r = getOrderInfo(c,reqStruct,'useDefaultEventHandler',false)

processEvent(c)
OrderRouteFields = {

    MSG_TYPE = E

    EVENT_STATUS = 1

    API_SEQ_NUM = 8

    EMSX_SEQUENCE = 0

    EMSX_AMOUNT = 0

    EMSX_FILLED = 0

    EMSX_AVG_PRICE = 0.0

    EMSX_WORKING = 0

    EMSX_TIME_STAMP = 0

    ...

}


OrderInfo = {

    EMSX_TICKER = IBM

    EMSX_EXCHANGE = US

    EMSX_SIDE = BUY

    EMSX_POSITION = BUY

    EMSX_PORT_MGR = CG

    EMSX_TRADER = CG

    EMSX_NOTES = 

    EMSX_AMOUNT = 400

    EMSX_IDLE_AMOUNT = 150

    EMSX_WORKING = 0

    EMSX_FILLED = 250

    EMSX_TS_ORDNUM = -381490

    EMSX_LIMIT_PRICE = 0.0

    EMSX_AVG_PRICE = 189.7899963378906

    EMSX_FLAG = 2

    EMSX_SUB_FLAG = 0

    EMSX_YELLOW_KEY = Equity

    EMSX_BASKET_NAME = 

    EMSX_ORDER_CREATE_DATE = 12/06/12

    EMSX_ORDER_CREATE_TIME = 14:28:37

    EMSX_ORDER_TYPE = MKT

    EMSX_TIF = DAY

    EMSX_BROKER = BB

    EMSX_TRADER_UUID = 1244972

    EMSX_STEP_OUT_BROKER = 

}

Obtain Order Information for Bloomberg EMSX Using timeOut Value

Define the reqstruct and note that EMSX_SEQUENCE must denote an existing order.

reqStruct.EMSX_SEQUENCE = int32(335877);
r = getOrderInfo(c,reqStruct,'timeOut',200)
r = 

               EMSX_TICKER: 'IBM'
             EMSX_EXCHANGE: 'US'
                 EMSX_SIDE: 'BUY'
             EMSX_POSITION: 'BUY'
             EMSX_PORT_MGR: 'CF'
               EMSX_TRADER: 'CF'
                EMSX_NOTES: ''
               EMSX_AMOUNT: 400
          EMSX_IDLE_AMOUNT: 150
              EMSX_WORKING: 0
               EMSX_FILLED: 250
            EMSX_TS_ORDNUM: 250
          EMSX_LIMIT_PRICE: 0
            EMSX_AVG_PRICE: 189.7900
                 EMSX_FLAG: 2
             EMSX_SUB_FLAG: 0
           EMSX_YELLOW_KEY: 'Equity'
          EMSX_BASKET_NAME: ''
    EMSX_ORDER_CREATE_DATE: '12/06/12'
    EMSX_ORDER_CREATE_TIME: '14:28:37'
           EMSX_ORDER_TYPE: 'MKT'
                  EMSX_TIF: 'DAY'
               EMSX_BROKER: 'BB'
          EMSX_TRADER_UUID: '1244972'
      EMSX_STEP_OUT_BROKER: ''

Input Arguments

expand all

c — Connection object for Bloomberg EMSX serviceobject structure

Connection object for Bloomberg EMSX service, specified using emsx.

reqStruct — Order request structurestructure | integer for EMSX_SEQUENCE number

Order request structure, specified using EMSX field properties. Use getAllFieldMetaData to view all available field property options for reqStruct.

    Note:   EMSX_SEQUENCE must denote an existing order sequence number.

Example: reqStruct.EMSX_SEQUENCE = int32(335877);

Data Types: int32 | struct

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: r = getOrderInfo(c,reqStruct,'useDefaultEventHandler',false)

'useDefaultEventHandler' — Flag for event handler preferencetrue (default) | logical with value true or false

Flag for event handler preference, indicating whether to use the default or custom event handler to process order events, as specified by the string true or false. When this flag is set to the default, true, the default event handler is used. If a custom event handler is used, this flag must be set to false.

Example: 'useDefaultEventHandler',false

Data Types: logical

'timeOut' — Connection timeout value for event handler for Bloomberg EMSX service500 milliseconds (default) | nonnegative integer

Connection timeout value, specified as a nonnegative integer in units of milliseconds.

Example: 'timeOut',200

Data Types: char

Output Arguments

expand all

R — Return status for requested eventstructure

Return status for the order event, returned as a structure.

See Also

| | | | | | |

Was this topic helpful?