Create a new contingency group

You can join two or more existing entry order into a new contingency (OCO, OTO) contingency group.

To join orders into a group:

1) Create a valuemap and fill only one field:

Valuemap field

Datatype

Description

Command

string

The command. Must be JoinToNewContingencyGroup.

The field is obligatory.

ContingencyType

number

Type for a new contingency group. Must be:

1

OCO group.

2

OTO group.

3

ELS group.

The field is obligatory.

2) Create a valuemap for each entry order you want to add into the contingency group. Fill these value maps as:

Valuemap field

Datatype

Description

AcctID

string

The identifier of the account to which the order belongs to.

The field is obligatory.

OrderID

string

The identifier of the order to be included into the group.

The order must exist, must be an entry (LE or SE) and must be in the waiting status.

The field is obligatory.

3) Append each entry order valuemap to the main valuemap using valuemap.append() method.

For OTO and ELS groups append the order to be a root order of the contingency group first.

4) Pass main valuemap table to terminal:execute() method.

Limitations:

1) All entry orders must be created for the same account.

Returns:

The terminal:execute() method will return the list of request id for each entry order created. So, if 3 entry order is created - 3 request id separated by commas (,) will be returned.

back