Documentation Center

  • Trial Software
  • Product Updates

modifyRouteWithStrat

Modify route with strategies for Bloomberg EMSX

Syntax

  • R = modifyRouteWithStrat(c,reqStruct,stratStruct) example
  • R = modifyRouteWithStrat(c,reqStruct,stratStruct,Name,Value) example

Description

example

R = modifyRouteWithStrat(c,reqStruct,stratStruct) modifies a Bloomberg® EMSX route with strategies and returns the order sequence number, route ID, and status message using the default event handler.

example

R = modifyRouteWithStrat(c,reqStruct,stratStruct,Name,Value) uses additional options specified by one or more Name, Value pair arguments. Modify a Bloomberg EMSX route with strategies 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;
    modifyRouteWithStrat(c,reqStruct,stratStruct,p)

Examples

expand all

Modify Bloomberg EMSX Route with Strategies Using Default Event Handler

Define the order request structure and strategies structure and then modify the route.

reqStruct.EMSX_TICKER = 'XYZ';
reqStruct.EMSX_AMOUNT = int32(100);
reqStruct.EMSX_ORDER_TYPE = 'MKT';
reqStruct.EMSX_BROKER = 'BB';
reqStruct.EMSX_TIF = 'DAY';
reqStruct.EMSX_HAND_INSTRUCTION = 'ANY';
reqStruct.EMSX_SIDE = 'BUY';
stratStruct.EMSX_STRATEGY_NAME = 'SSP';
stratStruct.EMSX_STRATEGY_FIELD_INDICATORS = int32([0 0 0]);
stratStruct.EMSX_STRATEGY_FIELDS = {'09:30:00','14:30:00',50};
r = modifyRouteWithStrat(c,reqStruct,stratStruct)
 r = 
    
        EMSX_SEQUENCE: 335877
        EMSX_ROUTE_ID: 1
              MESSAGE: 'Order Modified'

Modify Bloomberg EMSX Route with Strategies Using Custom Event Handler

Define the order request structure and strategies structure and then modify the route.

reqStruct.EMSX_TICKER = 'XYZ';
reqStruct.EMSX_AMOUNT = int32(100);
reqStruct.EMSX_ORDER_TYPE = 'MKT';
reqStruct.EMSX_BROKER = 'BB';
reqStruct.EMSX_TIF = 'DAY';
reqStruct.EMSX_HAND_INSTRUCTION = 'ANY';
reqStruct.EMSX_SIDE = 'BUY';
stratStruct.EMSX_STRATEGY_NAME = 'SSP';
stratStruct.EMSX_STRATEGY_FIELD_INDICATORS = int32([0 0 0]);
stratStruct.EMSX_STRATEGY_FIELDS = {'09:30:00','14:30:00',50};
r = modifyRouteWithStrat(c,reqStruct,stratStruct,'useDefaultEventHandler',false)
processEvent(c)
ModifyRouteWithStrat = {
 
     EMSX_SEQUENCE = 335877
 
     EMSX_ROUTE_ID = 1
 
     MESSAGE = Route modified
 
     }

Modify Bloomberg EMSX Route with Strategies Using timeOut Value

Define the order request structure and modify route and assign a timeOut value of 200 milliseconds.

reqStruct.EMSX_TICKER = 'XYZ';
reqStruct.EMSX_AMOUNT = int32(100);
reqStruct.EMSX_ORDER_TYPE = 'MKT';
reqStruct.EMSX_BROKER = 'BB';
reqStruct.EMSX_TIF = 'DAY';
reqStruct.EMSX_HAND_INSTRUCTION = 'ANY';
reqStruct.EMSX_SIDE = 'BUY';
stratStruct.EMSX_STRATEGY_NAME = 'SSP';
stratStruct.EMSX_STRATEGY_FIELD_INDICATORS = int32([0 0 0]);
stratStruct.EMSX_STRATEGY_FIELDS = {'09:30:00','14:30:00',50};
modifyRouteWithStrat(c,reqStruct,stratStruct,'timeOut',200)
 r = 
    
        EMSX_SEQUENCE: 335877
        EMSX_ROUTE_ID: 1
              MESSAGE: 'Order Modified' 

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

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

Example: reqStruct.EMSX_TICKER = 'XYZ';
reqStruct.EMSX_AMOUNT = int32(100);
reqStruct.EMSX_ORDER_TYPE = 'MKT';
reqStruct.EMSX_TIF = 'DAY';
reqStruct.EMSX_HAND_INSTRUCTION = 'ANY';
reqStruct.EMSX_SIDE = 'BUY';

Data Types: struct

stratStruct — Order strategies structurestructure

Order strategies structure specified by the elements of the fields EMSX_STRATEGY_FIELD_INDICATORS and EMSX_STRATEGY_FIELDS in the stratStruct. In addition, the field elements of stratStruct must align with the fields for the strategy specified by STRATSTRUCT.EMSX_STRATEGY_NAME. For more information on strategy fields and ordering, see getBrokerInfo.

When using stratStruct, set STRATSTRUCT.EMSX_STRATEGY_FIELD_INDICATORS equal to 0 for each field so that the field data setting in STRATSTRUCT.EMSX_FIELD_DATA is used. Also set STRATSTRUCT.EMSX_STRATEGY_FIELD_INDICATORS equal to 1 to ignore the data in STRATSTRUCT.EMSX_FIELD_DATA.

Example: stratStruct.EMSX_STRATEGY_NAME = 'SSP';
stratStruct.EMSX_STRATEGY_FIELD_INDICATORS = int32([0 0 0]);
stratStruct.EMSX_STRATEGY_FIELDS = {'09:30:00','14:30:00',50};

Data Types: 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 = modifyRouteWithStrat(c,reqStruct,stratStruct,'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 order eventstructure

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

See Also

| | | | | |

Was this topic helpful?