Open/Close Market Order

Brief

The article describes an Open/Close Market order.

Details

Definition and Use

An Open/Close Market Order (generally known as a Market Order) is an order to buy or sell an instrument immediately at the best price currently available in the market. The main purpose of this order is to secure execution at any price, which means that, as long as there are willing buyers and sellers, the trader is guaranteed execution but has no certainty of the actual price the order will be dealt at.

Note: If you want to have certain control over the price of a market order, you should use the following orders: Open/Close and Open/Close Range.

With an open/close market order, the trader has the following time-in-force options that provide additional instructions on how long the order should remain active:

Time-in-Force Option

Description

Fill Or Kill (FOK)

An instruction to fill an order immediately and completely or not at all.

Immediate Or Cancel (IOC)

An instruction to fill an order (or any of its portions) immediately after it has been brought to the market; any portions not executed immediately must be rejected. An IOC order may be executed in portions. Such execution results in a number of positions opened/closed at different prices.

Good Till Cancelled (GTC)

An order which remains active until the trader decides to cancel it or until the order is executed. In the event of limited liquidity, a GTC order may be executed in portions. Such execution results in a number of positions opened/closed at different prices.

Day (DAY)

An order that automatically expires if not executed on the day the order is placed. During the trading day the order behaves exactly like a GTC order.

Generally, an open market order is used for entering the market (opening a position) while a close market order is used for exiting the market (closing a position). See execution scenario 1. This is a common rule for regular accounts which are not subject to FIFO and allow hedging. If, however, hedging is disabled, placing an open market order in the direction opposite to an existing position will result in closing such position. FIFO-based accounts do not allow placing close market orders, so whether the trader is willing to exit the market immediately at the best available price, he/she must use an open market order or a Net Amount Order.

A close market order can be specified as a Net Amount Order. This is an instruction to close all positions in the given instrument. This type of order was initially designed for FIFO-based accounts, but has eventually become available for all accounts regardless of their settings. See execution scenario 5.

Execution Price

When the trader places an open/close market order, the order is automatically assigned the best price available at that moment (original price). However, this price is not guaranteed since the system will search for the best price again (new price) before sending the order to the bank. If the new price is better than the original price, the order will be executed at the new price. The new price may also be worse than the original price of the order. In this case, the order will be executed at a worse price.

Partial Fill

An open/close market order with GTC and IOC time-in-force options can be executed partially. It means that one order may result in a number of positions opened/closed at different prices. A GTC order is filled in portions until completely executed. An IOC order is filled in portions to the maximum extent possible (until the liquidity pool is dried up), the remainder of the order is rejected. In case of partial closing, the system closes a position in the filled amount and opens a new position in the remaining amount. The system does so until the order is filled in its entirety (GTC orders) or until the liquidity dries up (IOC orders). See Execution Scenarios.

Order Cancellation

The trader may cancel only a GTC open/close market order and only in cases where there is no liquidity to fill the order (or the liquidity pool is not large enough) and the order is set to wait until new quotes are received from the banks.

Open/Close Market Order State Machine

The state machine below is based on FXCM's order statuses. Note that the system creates an order only after the order is successfully validated. Otherwise, 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.

Open/Close Market Order: State Machine

Open/Close Market Order: FXCM Order Statuses Description

Order Status

Order Status Description

Transition

In Process (P)

The order was successfully validated and 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)" (all orders regardless of time-in-force option):
    The order was sent to external execution.

  • Transition from "Pending Calculated (U)" (the status is applicable only to GTC orders):
    The order was filled partially.

  • Transition from "Waiting (W)" (the status is applicable only to GTC orders):
    The new offer was received and the order was sent to external execution.

Pending Calculated (U)

The transition is applicable only to GTC and IOC orders:
The order is filled partially. A position is either opened or closed in the filled amount. Note that the filled portion may result in a number of open/closed positions.

Executing (E)

The order is completely filled.

Waiting (W)

The transition is applicable only to GTC orders and has one of the following meanings:

  • The order cannot be filled because there is no liquidity and is set to wait for a new offer.

  • The order is filled partially on limited liquidity; the remainder of the order is waiting for a new offer.

Cancelled (C)

The transition is applicable only to FOK and IOC orders:

  • FOK Orders:
    There is no liquidity or the liquidity pool is not large enough to fill the entire order.

  • IOC Orders:
    There is no liquidity to fill the order or any of its portions.

Executing (E)

The order was completely filled.

Executed (F)

A position is either opened or 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.

Waiting (W)

The status is applicable only to GTC orders:
The order was filled partially or was not filled at all because of limited or no liquidity; the remainder of the order is waiting for a new offer.

Pending Calculated (U)

The transition is applicable only to GTC orders:
The new offer is received and the order is sent to external execution.

Pending Cancelled (S)

The transition is applicable only to GTC orders:
The trader removes the order.

Cancelled (C)

The transition is applicable only to GTC orders:

  • Open Orders:
    The new offer is received, but there is insufficient margin in the account/the account is under the margin call.

  • Close Orders (including Net Amount Orders):
    The position the order is placed on is already closed by another 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.

Pending Cancelled (S)

The status is applicable only to GTC orders:
The order was removed by the trader.

Cancelled (C)

The transition is applicable only to GTC orders:
The trader removes the order and the system deletes order.

Cancelled (C)

The status has one of the following meanings:

  • Transition from "Pending Calculated (U)" (the status is applicable only to FOK and IOC orders):
    FOK Orders:
    The order was rejected because there is no liquidity or the liquidity pool is not large enough to fill the entire order.
    IOC Orders:
    The order was rejected because there is no liquidity to fill the order or any of its portions.

  • Transition from "Pending Cancelled (S)" (the status is applicable only to GTC orders):
    The order was removed by the trader and deleted by the system.

  • Transition from "Waiting (W)" (the status is applicable only to GTC orders):
    Open Orders:
    The account is under the margin call/there is insufficient margin in the account.
    Close Orders:
    The position the order was placed on is already closed by another order.

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 order after the order expiration.

back