Skip to main content

Order Slicing Algorithms

Execution Algorithms that slice a large order into small portions, known as clips, for optimal execution are very common. Deltix has developed a set of helper classes to simplify the development of such algorithms.

The general idea is to allow developers to focus on specific business logic of the execution algorithm, while the standard boilerplate code is taken care of by the helper classes. For example, when developing an ICEBERG order, a specific implementation should determine how to cut the order into smaller pieces using the "display quantity". The helper classes handle the following tasks:

  • Propagate executions of child orders (slices) as executions of the parent algo order.
  • Automatically handle modification (Cancel-Replace workflow) of the arent algo order.
  • Automatically handle the cancellation workflow of the parent algo order.

To use the Slicing Algorithm, extend your implementation from the abstract class SlicingAlgorithm. This helper class implements a state machine driven by trading messages, such as OrderReplaceRequest or OrderRejectEvent.

Slicing Algo Order States

The diagram below illustrates the different order states of the slicing algorithm:

Slicing Algorithm States

StateDescription
NormalAlgo order is working. It may or may not have active child orders on the market. This is the initial state of the slicing algo order.
PreparingReplaceThis is the first phase of cancel-replace. Some or all active child orders are cancelled at this step. New CancelReplace requests are still allowed at this stage and will be accumulated until the Commit phase. The order leaves this state as soon as there are no child orders pending cancellation (in some cases, immediately).
CommittingReplaceThis is the second phase of cancel-replace. Some or all active child orders are submitted or replaced. New CancelReplace requests for the parent order are not allowed at this stage. The order leaves this state as soon as all child orders are confirmed or accepted by the exchange (in some cases, immediately).
AbortingReplaceThis is a transient state that the algorithm passes when a replacement fails (e.g., a child order cannot be replaced).
PreparingCancelThis is a pre-terminal phase. In this stage, the algorithm works to cancel child orders. Note that the order enters this state immediately upon a cancellation request. There may be pending replacement requests for parent or child orders in this state.
FinalThis is a terminal stage. The order is cancelled, completely filled, or rejected (not shown on diagram).