FIX API - Order State Change Matrices


The OANDA FIX Server reports the order status using the following OrdStatus statuses only:

  • 0 = NEW
  • 2 = FILLED
  • 4 = CANCELED
  • 5 = REPLACED
  • 8 = REJECTED
  • C = EXPIRED

Most orders start in state NEW except for FOK/IOC orders and market orders where the server behavior follows recommended best practices on message bundling and immediately reports FILLED or CANCELED as the first response (e.g, NEW is skipped).

Note: on the OANDA server, orders that are REJECTED do not retain order state; any Order Status Request <H> on a REJECTED order will return unknown order.

In the tables below, order status is reported in the FIX.4.4 style (using OrdStatus and ExecType).

Market Orders, no TimeInForce

Market Orders are submitted with OrdType=1. Market orders submitted without any TimeInForce result either in FILLED or REJECTED order status. If a customer wishes to retain order history for market orders we recommend submitting all market orders with TimeInForce=3.

Time Message Received (ClOrdID, OrigClOrdID) Message Sent (ClOrdID, OrigClOrdID) ExecType OrdStatus OrderQty CumQty LeavesQty LastQty Comment
1 New Order (X) 10000
2 Execution Report (X) REJECTED REJECTED 10000 0 0 0 no history recorded
Execution Report (X) TRADE FILLED 10000 10000 0 0

Note message bundling behavior as per the recommended best practices section 3.3.1.1.

FOK/IOC Orders (incl. Market Orders)

Limit, stop, and market orders submitted with TimeInForce = 3 or 4 result in FILLED status on a full fill, CANCELED status on partial or no fill, and REJECTED if there were problems.

Time Message Received (ClOrdID, OrigClOrdID) Message Sent (ClOrdID, OrigClOrdID) ExecType OrdStatus OrderQty CumQty LeavesQty LastQty Comment
1 New Order (X) 10000
2 Execution Report (X) REJECTED REJECTED 10000 0 0 0 no history recorded
Execution Report (X) TRADE FILLED 10000 10000 0 10000
Execution Report (X) TRADE CANCELED 10000 5000 0 5000 partial fill

NOTE OrdStatus is CANCELED as per FIX specifications
Execution Report (X) CANCELED CANCELED 10000 0 0 0 no fill
any attempt to change or cancel the order results in a rejection
3 Order Cancel Request (Y,X)

Order Cancel / Replace Request (Y,X)
Order Cancel Reject (Y,X) unchanged CxlRejReason=0

ClOrdID remains as (X)

Note message bundling behavior as per the recommended best practices section 3.3.1.2.

Limit, Stop, Market-if-Touched Orders with Order Duration

In general, the first response to a new order request where the order is alive for some duration will be NEW or REJECTED.

Once the order is submitted, cancel or cancel/replace requests may be submitted but because requests are processed in order the cancel or cancel/replace would behave as if it was submitted after the new order confirmation was received.

Since the OANDA system is NOT an order-matching system, fills will usually be full fills if the requested OrderQty is available. (Partial fills are only possible for IOC orders, as described above.)

Order is filled

Time Message Received (ClOrdID, OrigClOrdID) Message Sent (ClOrdID, OrigClOrdID) ExecType OrdStatus OrderQty CumQty LeavesQty LastQty Comment
1 New Order (X) 10000
2 Execution Report (X) REJECTED REJECTED 10000 0 0 0 no history recorded
Execution Report (X) NEW NEW 10000 0 10000 0
3 price stipulation met; order is triggered
4 Execution Report (X) TRADE FILLED 10000 10000 0 10000

Order expires

Time Message Received (ClOrdID, OrigClOrdID) Message Sent (ClOrdID, OrigClOrdID) ExecType OrdStatus OrderQty CumQty LeavesQty LastQty Comment
1 New Order (X) 10000
2 Execution Report (X) REJECTED REJECTED 10000 0 0 0 no history recorded
Execution Report (X) NEW NEW 10000 0 10000 0
3 order lifetime expires
4 Execution Report (X) EXPIRED EXPIRED 10000 0 0 0

Order canceled by user request

Time Message Received (ClOrdID, OrigClOrdID) Message Sent (ClOrdID, OrigClOrdID) ExecType OrdStatus OrderQty CumQty LeavesQty LastQty Comment
1 New Order (X) 10000
2 Execution Report (X) REJECTED REJECTED 10000 0 0 0 no history recorded
Execution Report (X) NEW NEW 10000 0 10000 0
3 Order Cancel Request (Y,X) 10000
4 Execution Report (Y) CANCELED CANCELED 10000 0 0 0

Order is canceled due to failure to execute on triggering

Normally, canceled duration orders arise from a user request.

There are situations where an order can be canceled by the system, including:

  • account insufficient funds when order triggers
  • account would exceed the 1000 OANDA-trade-tickets limit when order triggers
Time Message Received (ClOrdID, OrigClOrdID) Message Sent (ClOrdID, OrigClOrdID) ExecType OrdStatus OrderQty CumQty LeavesQty LastQty Comment
1 New Order (X) 10000
2 Execution Report (X) REJECTED REJECTED 10000 0 0 0 no history recorded
Execution Report (X) NEW NEW 10000 0 10000 0
3 order triggers but unable to fill
4 Execution Report (X) CANCELED CANCELED 10000 0 0 0 consult Text <58> for reason for failure to fill

Cancel request issued for unfilled order

Time Message Received (ClOrdID, OrigClOrdID) Message Sent (ClOrdID, OrigClOrdID) ExecType OrdStatus OrderQty CumQty LeavesQty LastQty Comment
1 New Order (X) 10000
2 Execution Report (X) REJECTED REJECTED 10000 0 0 0 no history recorded
Execution Report (X) NEW NEW 10000 0 10000 0
3 Order Cancel Request (Y,X) 10000
4 Order Cancel Reject (Y,X) NEW order remains as (X)
Execution Report (Y,X) CANCELED CANCELED 10000 0 0 0 confirmation that order has been cancelled

Cancel or cancel/replace request issued for filled, canceled, or expired order

An order that is already canceled, filled, or expired cannot be further changed; any request will be rejected as “too late to cancel”.

Time Message Received (ClOrdID, OrigClOrdID) Message Sent (ClOrdID, OrigClOrdID) ExecType OrdStatus OrderQty CumQty LeavesQty LastQty Comment
1 New Order (X) 10000
2 Execution Report (X) REJECTED REJECTED 10000 0 0 0 no history recorded
Execution Report (X) NEW NEW 10000 0 10000 0
3 Order Cancel Request (Y,X) 10000
4 order is filled, canceled, or expired; assume ClOrdID is now Z
5 Order Cancel Request (W,Z)

Order Cancel / Replace Request (W,Z)
6 Order Cancel Reject (W,Z) unchanged CxlRejReason=0

ClOrdID remains as (W)

Order modified to change quantity, price, or expiry time

An order cancel/replace to change the quantity, price, or expiry time can be honored if the order has not been filled (still in state NEW).

Order modifications to zero quantity are not supported; please issue an outright cancel.

Time Message Received (ClOrdID, OrigClOrdID) Message Sent (ClOrdID, OrigClOrdID) ExecType OrdStatus OrderQty CumQty LeavesQty LastQty Comment
1 New Order (X) 10000
2 Execution Report (X) REJECTED REJECTED 10000 0 0 0 no history recorded
Execution Report (X) NEW NEW 10000 0 10000 0
3 Order Cancel Request (Y,X) 10000
4 Execution Report (Y,X) REPLACE NEW 20000 0 0 0 confirmation that order has been modified
5 Order Status Request (Y)
6 Execution Report (Y) NEW NEW 20000 0 0 0 order now known as (Y)
fill, cancel, or expire as described previously

Order modified to change symbol, side, order type

Changes to the Symbol <55>, Side <54>, or OrdType <40> are not supported. Please cancel the original order and submit a new order to meet the requirements.

Time Message Received (ClOrdID, OrigClOrdID) Message Sent (ClOrdID, OrigClOrdID) ExecType OrdStatus OrderQty CumQty LeavesQty LastQty Comment
1 New Order (X) 10000
2 Execution Report (X) REJECTED REJECTED 10000 0 0 0 no history recorded
Execution Report (X) NEW NEW 10000 0 10000 0
3 Order Cancel / Replace Request (Y,X) one or more of Symbol, Side, OrdType changed
4 Order Cancel Reject (Y,X) unchanged consult Text <58>
order remains as (X)