The Single Order Container is a trading block that manages a single order generated by another trading block. Whenever a trading block (such as an Order block) submits an order, it retains a unique order key for that particular order. The trading block then outputs a discrete event message that contains the order key. A Single Order Container can receive the discrete event message, extract the order key from it, and then take control of the identified order.
Example The Single Order Container receives a discrete event message with information about an existing order and takes control of that order. It is configured to delete the order if the LTP becomes greater than one tick above the price of the original order. When that condition occurs, the del input port becomes TRUE, which tells the Single Order Container to delete the order it is managing. The block outputs the working and cumulative quantities of the order and sends related discrete event messages, such a Del OK or Fill, through its msgs output port.
You can connect only the following ports to a Single Order Container:
A Single Order Container retains a memory of the fills it achieved since the last order message triggered the block. The wrk qty port outputs the quantity remaining to be filled, and the cum qty port outputs the filled quantity.
If the user manually deletes or modifies an order controlled by the Single Order Container, it will relinquish control over to the user, but discrete event messages will still be generated from the appropriate output ports at the expected times. If the user pauses and resumes the algorithm, the order container will attempt to re-locate and re-take control of the managed order.
A Single Order Container will modify the managed order according to its price input and quantity input. Additionally:
If the managed order was initially submitted with a stop trigger, the Single Order Container will modify the managed order in accordance with the stop trigger input. However, note that a stop trigger cannot be attached to an order which was originally created without a stop trigger.
A Single Order Container will modify the managed order in accordance with the disclosed quantity input, if present. If the managed order was initially submitted without a disclosed quantity, the Single Order Container can modify the managed order into an exchange-recognized iceberg order.
When the del input turns TRUE, the Single Order Container will delete the managed order but will not resubmit a new order when reverts to FALSE. If an Order block generated the initial order message, the Order block will re-evaluate its inputs to determine whether a new order should be submitted. A Single Order Container does not create new orders.
Using the Demultiplexer block in conjunction with the Single Order Container allows for a lower-level control by generating discrete event messages upon receiving an add, fill, change, or a delete order confirmation from the exchange. The Demultiplexer block takes the output discrete message, determines which type of message it is, and then sends the message through the appropriate output port.
To customize the block, update the Block Properties.
Property | Description |
---|---|
Name | Name to display beneath the block on the ADL canvas |
When Ext Mod Occurs |
Action to take if the order is modified outside of the algorithm
|
BodyColor | Background color of the block |
Description | Optional text to explain how the block is used |