From 9 November at 04:00 UTC, we will support contingent orders via our API. It’s an addition that will allow orders to be executed based on the execution of another order. The two types of contingent orders which will be supported are:
- OCO: One Cancels the Other – a pair of orders where one is cancelled when the other is (partially) filled.
- OTO: One Triggers the Other(s) – when a single trigger order is fully executed, one or more orders will be created.
One Cancels the Other:
OCO orders can be created by submitting two orders with the same clOrdLinkID
value and a contingencyType
as OneCancelsTheOther
. The two orders are contingent such that if any one order is filled or partially filled, then the other side of the OCO contingent order will be cancelled.
- If an order is submitted with a
clOrdLinkID
which matches to orders that are already linked, it will be rejected. - If a stop order is triggered, then the other side of the OCO contingent order will be cancelled, regardless of whether that order is immediately filled or rests on the book.
- If one leg of the contingent order is cancelled, then the other side will be left open and will act as a regular order.
One Triggers the Other:
OTO orders can be created by submitting multiple orders. Among them, one is a primary OTO contingent order and the rest are secondary OTO contingent orders – which get triggered/activated once the primary contingent order is fully filled. The primary OTO contingent order is placed by setting the clOrdLinkID
value and a contingencyType
of OneTriggersTheOther
.
The secondary OTO contingent orders are placed by having a clOrdLinkID
value matching the clOrdLinkID
of the primary order. The contingencyType
for secondary OTO contingent orders will be null
in this case, or it can also be OneCancelsTheOther
in case any of the two secondary OTO contingent orders are also supporting the specifications of OCO contingent order types.
- If a secondary OTO contingent order is submitted with a
clOrdLinkID
, which does not match anyclOrdLinkID
corresponding to a primary OTO contingent order, it will be rejected. - If a primary OTO contingent order is submitted with a
clOrdLinkID
, which matches to anyclOrdLinkID
, it will be rejected. - If the primary order is fully filled, then the contingent order will be activated if it is a limit or market order. If it is a stop order, then it will only get activated if/when it reaches the stop price condition.
- If the primary order is partially filled, then no action is taken on the contingent order.
- If the primary order is cancelled, then the contingent order will also be cancelled.
If you have any questions, please contact Support.