OCO (One-Cancels-the-Other) Contingent Order

Brief

The article describes the OCO (One-Cancels-the-Other) contingent order.

Details

Definition and Use

An OCO (One-Cancels-the-Other) Contingent Order is a contingent order consisting of two (or more) orders. When one of the orders is executed completely or partially, the other orders are automatically cancelled. The OCO contingent order may be used by a trader with limited funds, i.e. allow entering the market at one among many instruments picking the most profitable one. Another way when OCO may be used is a breakout strategy if the trader is unsure of which direction the breakout may occur. The order to buy is placed above resistance level if the market price breaks to the top and the order to sell is placed below the support level if the market price breaks to the down.

The Entry Stop or/and Entry Limit orders can be embedded into the OCO contingent order. When the OCO contingent order is placed, all embedded orders become active in the market. The orders can be placed from the same account but for different instruments. The trade operation and amount of embedded order do not depend on trade operation and amount of other embedded orders. Each order may be a primary order of the ELS (Entry-with-Limit-and-Stop) Contingent Order.

Order Embedded Into OCO Execution

The time-in-force options and execution details for a order are the same as those an Entry Limit and Entry Stop.

OCO Contingent Order Execution

As it was said above, when one of the orders is executed completely or partially, the other orders are automatically cancelled. Once the market satisfies criteria set in one of the orders, the other order becomes inactive and is about to be rejected. It finally gets rejected when the order is completely or partial filled. If the first secondary order cannot be filled/is filled partially due to the lack of liquidity (for more information see execution details of stop and limit orders), the order becomes active again. See execution Scenario 1, Scenario 2.

Order Embedded Into OCO: State Machine

The state machine of the order which is embedded into OCO contingent order is based on the FXCM order statuses. The description of order statuses, their transitions and state machine are provided below. Note that the order is created by the system only after successful order validation. If the order does not pass validation, the system creates a rejection message and does not store the order in the database. However, the information about the order (such as, for example, the order ID and the reason for its rejection) is stored in the database. So, the initial transition on the diagram indicates that the order is successfully validated.

OCO Embedded Order: State Machine

Order Embedded Into OCO: FXCM Order Statuses Description

Order Status

Order Status Description

Transition

Waiting (W)

The status has one of the following meanings:

  • Initial Transition:
    The order was successfully validated and is waiting until the market price satisfies the order criteria.

  • Transition from "Waiting (W)":
    The order was modified by the trader.

  • Transition from "Pending Calculated (U)":
    The order was filled partially or was not filled at all because of limited or no liquidity, and is waiting until the market price satisfies the order criteria.

  • Transition from "Pending Cancelled (S)":
    1) The other order of OCO was not filled; the order is waiting until the market price satisfies the order criteria.
    2) The other order of OCO was rejected or cancelled.

Waiting (W)

The trader modifies the order.

In Process (P)

The market price satisfies the criteria set in the order.

Expired (T)

The transition is applicable only to DAY orders:
The order expires because it cannot be executed on the day it was placed.

Cancelled (C)

The market price satisfies the order criteria, but there is insufficient margin in the account/the account is under the margin call.
Note:If an OCO contingent order embedded two orders, and one of them is rejected the other order becomes a regular entry order. If an OCO contingent order embedded more than two orders, and one of them is rejected this doesn't affect the OCO.

Pending Cancelled (S)

The transition has one of the following meanings:

  • The market price satisfies the criteria set in the other order of OCO.

  • The trader removes the order.

In Process (P)

The market price satisfied the criteria set in the order; the order is ready for further execution.

Pending Calculated (U)

The order is sent to external execution.

Pending Calculated (U)

The status has one of the following meanings:

  • Transition from "In Process (P)":
    The market price satisfied the order criteria and the order was sent to external execution.

  • Transition from "Pending Calculated (U)":
    The order was filled partially.

Executing (E)

The order is completely filled.

Pending Calculated (U)

The order is filled partially. Position is opened/closed in the filled amount. The remainder of the order becomes a regular entry order. Note that the filled portion may result in a number of open/closed positions.

Waiting (W)

The order cannot be filled because there is no liquidity to fill the order.

Executing (E)

The order was completely filled.

Executed (F)

A position is opened/closed. Note that the order may result in a number of open/closed positions.

Executed (F)

A position was opened/closed. Note that the order may result in a number of open/closed positions.

Expired (T)

The status is applicable only to DAY orders:
The order expired because it was not executed on the day it was placed.

Expired (T)

The transition is applicable only to DAY orders:
The system deletes the secondary order after the order expiration.

Cancelled (C)

The status has one of the following meanings:

  • The account is under the margin call/there is insufficient margin in the account.

  • Transition from "Pending Cancelled (S)":
    The order was removed by the trader and deleted by the system.

Pending Cancelled (S)

The status has one of the following meanings:

  • The market price satisfied the criteria set in the other order of OCO. The order is "put on hold" until the other order gets filled.

  • The order was removed by the trader.

Waiting (W)

The transition has one of the following meanings:

  • The other order of OCO is not filled; the order is waiting until the market price satisfies the order criteria.

  • The other order of OCO is rejected or cancelled.

Cancelled (C)

The transition has one of the following meanings:

  • The other order of OCO is completely or partially filled and the position is opened/closed in the filled amount.

  • The trader removes the order and the system deletes order.

back