Trading Blocks

Trading Blocks

Single Order Container block

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.

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.

How a Single Order Container manages orders

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 create new orders.

Single Order Container connected to a Demultiplexer block

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.

Block properties

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
  • Ignore to continue using the block inputs and ignore the external modifications
  • Stop Managing to ignore the block inputs and use the external modifications instead
  • Detach to ignore the block inputs and stop sending block outputs