Parameter | Description |
orderId | A unique identifier in the scope of the Multi-Leg Order Manager block. The block uses this identifier to perform operations on the order. |
serviceId | The name of the market service provider monitor to use, or an empty string to use any market service provider monitor. |
tradeId | The name of the trader. |
traderSubId | Additional identification information for the trader. |
marketId | The name of the market to send the order to. To determine whether you need to specify this parameter, and obtain more information about the meaning of this parameter, see the documentation for the adapter you are using. If the documentation does not mention this parameter, you do not need to specify it. |
marketSubId | Additional identification information about the market to send the order to. To determine whether you need to specify this parameter, and obtain more information about the meaning of this parameter, see the documentation for the adapter you are using. If the documentation does not mention this parameter, you do not need to specify it. |
legId | A unique identifier in the scope of the Multi-Leg Order Manager block. The block uses this identifier to perform operations on the leg. |
symbol | The instrument to trade for the leg identified by the current legId. |
price | The price to trade at, or 0 for a market order, for the leg identified by the current legId. |
quantity | The amount to trade for the leg identified by the current legId. For example, the number of shares to buy or sell. |
side | BUY or SELL. Applies to the leg identified by the current legId. Some services also support other values such as BUY MINUS or SELLSHORT. |
type | MARKET or LIMIT. Some services also support other values such as STOPMARKET or STOPLIMIT. If left blank, the order is placed as a LIMIT if a price is specified or a MARKET order if no price is specified (or is 0). This parameter applies to each leg in the order. |
extra parameters | Any extra parameters for the service. Applies to each leg in the order. |
leave orders open on scenario exit | If true, the block does not cancel orders when the scenario enters the end state. This leaves the orders uncontrollable in the market. |
auto-generate order identifier | If true, the Multi-Leg Order Manager block generates the order identifier and the leg identifiers for you when you submit a multi-leg order. The generated identifiers have the following format: Order_n Leg_n Obtain the generated order identifier from the order identifier field of the order status output feed. Obtain the generated leg identifiers from the leg identifier field of the leg status output feed. The Multi-Leg Order Manager block sends data to these feeds immediately after you place an order. The default is that this parameter is set to false, which means that you must explicitly specify a unique order identifier and unique leg identifiers when you submit a multi-leg order. |
Operation | Description |
start multi-leg order | Start submission of a new order. See Submitting multi-leg orders. |
submit leg | Add a leg to the current order’s set of legs. |
submit multi-leg order | Send the order to the market. The order automatically enters state 1, waiting for acknowledgment. |
start modify multi-leg order | Open order for modifications. See Modifying multi-leg orders. |
remove leg | Remove the leg identified by the current legId from the order identified by the current orderId. |
amend leg | For the leg identified by the current legId, modify the price, quantity, side, type, or extraParams parameter. |
amend multi-leg order | Send modified order to the market. The order automatically enters state 5, pending change, unless the order is not modifiable at this time. See Modifying multi-leg orders. |
cancel order | Cancel the order in the market. The order automatically enters state 6, pending cancel, unless the order is not modifiable at this time. The market can reject a cancellation. Consequently, after an order is in the pending cancel state, it can become cancelled, completed, or, if the cancellation is rejected, working. |
cancel leg | Cancel the leg in the market. The leg automatically enters state 6, pending cancel, unless the leg is not modifiable at this time. The market can reject a cancellation. Consequently, after a leg is in the pending cancel state, it can become cancelled, completed, or, if the cancellation is rejected, working. |
retrieve order | Retrieve information about the order specified by the orderId parameter. You can obtain the state of a previously placed order even if other orders have been processed since the specified order. Obtain the information from the order status output feed. |
retrieve leg | Retrieve information about the leg specified by the legId parameter. Obtain the information from the leg status output feed. |
clear | Clears the order status, order iteration complete, and leg iteration complete output feeds. This operation has no effect on the market state. If you have output feeds connected directly to your user interface, you might call this operation to refresh the user interface. |
cancel all orders and legs | Cancel all orders and their legs. When the tradeable field of the order book status output feed has a value of 0, all orders are out of the market. Note that the market might reject some cancellations. |
iterate orders | Begin iterating over all orders in the Multi-Leg Order Manger block’s order book. The iteration is complete when the order iteration complete output feed becomes true. |
iterate legs | Begin iterating over legs that belong to the current order. The iteration is complete when the leg iteration complete output feed becomes true. |
next order | Continue to the next order in the iteration. The order in which the next operation visits orders in the order book is undefined. |
next leg | Continue to the next leg in the iteration of the current order’s legs. The order in which the next leg operation visits legs in the leg book is undefined. |
Feed | Fields | Description |
order status | order identifier | The Multi-Leg Order Manager block’s unique identifier for the order for which the order status output feed is providing information. This identifier was specified or generated when this order was placed. This identifier distinguishes this order from every other order placed by this block. An order identifier must be unique within the scope of the block that placed the order. |
market order identifier | An identifier supplied by the market, typically unique across all orders in that market. | |
symbol | If all legs in the order are trading the same instrument, this field contains the identifier for the instrument being traded. If all legs are not trading the same instrument, this field is empty. | |
price | The volume weighted average price of all legs in the order. Takes into account any changes to any legs. | |
quantity | The total number of units, such as shares, to trade for all legs in the order. Includes any changes to any legs. | |
state | The order’s state indicated by an integer from 0-9. See Order states and statuses for a description of what each integer signifies. | |
money executed | The sum of price * quantity for all fills of all legs in this order, or 0.0 if no fills have occurred. | |
average price executed | The volume-weighted average price over all fills for all legs, or 0.0 if no fills have occurred. | |
last price executed | The price obtained per item for the last fill, or 0.0 if no fills of any legs in this order have occurred. | |
quantity executed | The number of items traded so far, or 0.0 if no fills of any legs in this order have occurred. | |
quantity remaining | The number of items left to trade in the market for all legs in this order, or 0.0 if all items have been traded. | |
in market | Number of legs in the order that are known to the market. | |
visible | Number of legs in the order that are visible in the market. Some markets consider orders to be invisible until a certain condition has been met, for example, stop orders are invisible until the trigger price is hit. | |
modifiable | Number of legs in the order that can be modified immediately. The Multi-Leg Order Manager block queues any attempts to modify an order when it is not modifiable. The queued modification cannot occur if the order enters a final state before becoming modifiable. | |
cancelled | Number of legs in the order that have been rejected or cancelled, possibly before being entered into the market. A cancelled leg might have had some quantity traded. | |
change rejected | Number of legs in the order for which the most recent modification or cancellation was rejected by the market. An explanation might be available in the status message field. | |
externally modified | Number of legs in the order that have been modified by anything other than the scenario, for example, the market or a third party. | |
final | Number of legs in the order that have entered the final state. This means the leg was completed, cancelled, or rejected. Note that a leg in the final state can still be updated. A leg that is settled can no longer be updated. | |
status message | A message from either the market service provider monitor or the market explaining what has happened. The format and meaning of the message varies from service to service and market to market. | |
extra parameters | String that specifies additional parameters in a name=value format. | |
numLegs | Number of legs in the order. | |
numSettled | Number of settled legs in the order. A settled leg cannot be updated. | |
last quantity executed | The number of items traded in the last fill, or 0.0 if no fills of any legs in this order have occurred. | |
type | The type of the order — MARKET, LIMIT, or some other type supported by the market. | |
side | The side of the order — BUY, SELL, or some other side supported by the market. | |
order book status Provides information about all legs in all orders. | number of orders | The number of orders that are in the block’s order book. This is the number of orders that have been placed from this instance of the Multi-Leg Order Manager block, including those that are final or settled. |
total placed | The number of shares that have been ordered from all legs that belong to all orders that were submitted by this instance of the Multi-Leg Order Manager block, and that have reached the market. This includes legs that have been cancelled, rejected, and completed, as well as legs that are in the market. While modifications can cause this number to decrease, cancellations do not. | |
total executed | The sum of the quantities executed for all legs. | |
total working | The sum of the quantities remaining to be traded for legs that are in the market. For example, if you submit a leg to buy 100 shares and so far 75 shares have been bought, this adds 25 to the value of total working. | |
waiting for acknowledgement | The number of legs that are in state 1 — waiting for acknowledgment from the market service provider monitor. | |
working | The number of legs that are in the market and modifiable. These are the legs that are in state 2 (in the market) and they are not in state 5 (pending change) or state 6 (pending cancel). | |
complete | The number of legs that are in state 3 (completely filled). | |
rejected | The number of legs that are in state 4 (rejected). That is, the market rejected the leg. | |
pending change | The number of legs that are in state 5 (pending change). That is, the leg has been modified but the modified order is not yet in the market. | |
pending cancel | The number of legs that are in state 6 (pending cancel). That is, the leg has been cancelled but the cancellation has not reached the market. | |
cancelled | The number of legs that are in state 7 (cancelled). | |
suspended | The number of legs that are in state 8 (suspended in the market). | |
in market | The number of legs that are in the market but not necessarily modifiable. These are the legs that are in state 2 (in the market) or state 5 (pending change) or state 6 (pending cancel). | |
visible | The number of legs that are visible in the market. For example, legs that specify stop orders are invisible until they have been triggered by a particular price. | |
modifiable | The number of legs that are modifiable. | |
tradeable | The number of legs that might trade. This count includes every leg that is not completed, cancelled, or rejected. If a scenario waits until it has no outstanding legs in the market, it should wait for the tradeable field to become 0. | |
final | The number of legs that are in state 3 (completed), state 4 (rejected) or state 7 (cancelled). A final leg can still be updated. For example, if something about a final leg needs to be corrected, the leg might be updated. | |
settled | The number of legs that are final and cannot be updated. | |
leg status | leg identifier | The Multi-Leg Order Manager block’s unique identifier for leg for which it is generating information. This identifier distinguishes this leg from every other leg placed by this block. |
market order identifier | An identifier supplied by the market, typically unique across all orders in that market. | |
symbol | Identifier for the instrument this leg is trading. | |
price | The price requested either when the leg was submitted or the latest modification to the leg. A price of 0.0 signifies a market order. | |
quantity | The total number of units, such as shares, to trade, or the number the leg has been amended to. | |
side | The side of the leg — BUY, SELL, or some other side supported by the market. | |
type | The type of the leg — MARKET, LIMIT, or some other type supported by the market. | |
state | The order’s state indicated by 0-9. See Order states and statuses. | |
money executed | The sum of price * quantity for all fills of this leg, or 0.0 if no fills have occurred. | |
average price executed | The volume-weighted average price over all fills of this leg, or 0.0 if no fills have occurred. For example, suppose you submit a leg to buy 100 shares of IBM at up to $10.00 per share. You bought 20 shares at $9.95 and 20 shares at $9.97. The average price executed is $9.96. | |
last price executed | The price obtained per item for the last fill for this leg, or 0.0 if no fills have occurred. | |
last quantity executed | The number of items traded in the last fill for this leg, or 0.0 if no fills of this leg have occurred. | |
quantity executed | The number of items traded so far, or 0.0 if no fills of this leg have occurred. | |
quantity remaining | The number of items left to trade in the market as part of this leg. | |
in market | true if the leg is known to the market. | |
visible | true if the leg is visible in the market. Some markets consider legs to be invisible until a certain condition has been met, for example, stop orders are invisible until the trigger price is hit. | |
modifiable | true if the leg can be modified immediately. The Multi-Leg Order Manager block queues any attempts to modify an order when it is not modifiable. The queued modification cannot occur if the order enters a final state before becoming modifiable. | |
cancelled | true if the leg has been rejected or cancelled, possibly before being entered into the market. A cancelled leg might have had some quantity traded. | |
change rejected | true if the most recent modification or cancellation of the leg was rejected by the market. An explanation might be available in the status message field. | |
externally modified | true if the leg has been modified by anything other than the scenario, such as the market or a third party. | |
final | true if the quantity specified for the leg has been traded, or if the leg was cancelled or rejected. A final leg can still be updated. | |
status message | A message from either the market service provider monitor or the market explaining what has happened. The format and meaning of the message varies from service to service and market to market. | |
extra parameters | String that specifies additional parameters, which contain more information about the instrument being traded. The string is in a name=value format. | |
settled | true if this leg is final and can no longer be updated. | |
consistency | orderStatusBookConsistent | true if order status and order book status are the same. When this field is false, it might indicate a problem. |
legOrderConsistent | true if leg status and order status are the same. If every leg has the same status, then the order also has that status, and the legOrderConsistent field would be true. If every leg does not have the same status, then the order would be in the unknown state, and the legOrderConsistent field would be false. | |
order iteration complete | complete | true if the iteration over the orders placed by this block has completed. |
leg iteration complete | complete | true if the iteration over the legs that belong to the current order has completed. |