Skip to content

Orders (table)

Overview

This section describes the Orders table that contains information about orders. The data is kept in this table until all the orders are executed.

Name Type Description
OrderID String The unique identification number of the order. The number is unique within the same database that stores
the account the order is placed on. For example, MINIDEMO or U100D1. The uniqueness of the order itself
is assured by the combination of the database ID and the value of this field.
RequestID String The identifier of the request to create an order. One request can create several orders. For example, if an entry order
is created with stop and limit orders attached, the table contains several orders with the same RequestID.

If after its creation the order is changed, then this field represents the unique identifier of the request to make the last change.
Rate Double The price the order is placed at. In the case of FX instruments, it is expressed in the instrument counter currency per one unit of base currency. In the case of CFD instruments,
it is expressed in the instrument native currency per one contract.

In the case of open/close market orders and pegged stop/limit orders, the value of this field is 0.0.
ExecutionRate Double The price the order is executed at. In the case of FX instruments, it is expressed in the instrument counter currency per one unit of base currency. In the case of CFD instruments,
it is expressed in the instrument native currency per one contract. Applicable only when the order is filled completely or partially.
In other words, this field has a meaningful value if the order status is either Pending Calculated, Executing or Executed.
For details, please refer to Orders State Machines section. If the order is in any other state, the value of this field is 0.0.
If the order is filled in several steps, the value of this field may differ for every partiall fill.
RateMin Double The minimum price at which the order can be filled. In the case of FX instruments, it is expressed in the instrument counter currency per one unit of base currency. In the case of CFD instruments,
it is expressed in the instrument native currency per one contract.
It is applicable only for open/close range orders. For all other order types, the value of this field is 0.0.
RateMax Double The maximum price at which the order can be filled. In the case of FX instruments, it is expressed in the instrument counter currency per one unit of base currency. In the case of CFD instruments,
it is expressed in the instrument native currency per one contract.
It is applicable only for open/close range orders. For all other order types, the value of this field is 0.0.
TradeID String The unique identification number of the position to be opened/closed by the order. The number is unique within the same database
that stores the account the position can be opened or closed on. For example, MINIDEMO or U100D1. The
uniqueness of the position itself is assured by the combination of the database ID and the value of this field.

In the case the opening order fills partially, the system opens a position for every partial fill. Every position has unique TradeID.
Therefore, after a partial fill, this field has the unique value. Likewise, the value of this field changes if the order closes the particular position and fills partially.


In some cases, this number does not reference any particular position. Such cases are:

- The order is placed as the Net Amount order.
- The order is placed to close positions under the following conditions:
- the order is placed on the account where hedging is not allowed (see MaintenanceType field in the Accounts table);
- the order is placed in the opposite direction (buy or sell) to the positions trade operation.
AccountID String The unique identification number of the account the order is placed on. The number is unique within the
database where the account is stored. For example, MINIDEMO or U100D1. The uniqueness of the account
itself is assured by the combination of the database ID and the value of this field.
AccountName String The unique name of the account the order is placed on. The name is unique within the database where the
account is stored. For example, MINIDEMO or U100D1. The uniqueness of the account itself is assured by the
combination of the database ID and the value of this field.
OfferID String The unique identification number of the instrument the order is placed for.
NetQuantity Boolean The Net Amount order flag. It defines whether the order is a Net Amount order or not. The possible values are:

trueThe order is a Net Amount order.

falseThe order is not a Net Amount order.

The Net Amount order closes all positions of the specified
instrument and account that are in the direction (buy or sell) opposite to the direction of the Net Amount order.

The following types of order can be Net Amount orders:
- SE - entry stop.
- LE - entry limit.
- STE - trailing entry stop.
- LTE - trailing entry limit.
- CM - close market.
BuySell String The direction of the trade. The possible values are:

BThe order is placed to buy an instrument.

SThe order is placed to sell an instrument.

Stage String The order action. It defines whether the order is placed to open or close a position. The possible values are:

OThe order is placed to open a position.

CThe order is placed to close a position.

Type String The order type. The possible values are:

SStop.

STTrailing Stop.

LLimit.

SEEntry Stop.

LEEntry Limit.

STETrailing Entry Stop.

LTETrailing Entry Limit.

CLClose Limit.

CMClose Market.

CRClose Range.

OLOpen Limit.

OMOpen Market.

OROpen Range.

MMargin Call.

LTTrailing Limit.

REEntry Range.

RTETrailing Entry Range.

Status String The state of the order. The possible values are:

WWaiting.

PIn process.

IDealer intervention.

QRequoted.

UPending calculated.

EExecuting.

SPending Canceled.

CCanceled.

RRejected.

TExpired.

FExecuted.

Amount Integer The amount of the order. In the case of FX instruments, the amount is expressed in the base currency of an instrument.
In the case of CFD instruments, the amount is expressed in contracts.

If the order is filled completely at the first attempt or rejected in the whole amount, it is the initial amount
of the order.

If the order is filled completely in several attempts, it is the amount of the last portion to be filled.

If the order is filled partially, it is the remaining amount to be filled.

If the order is partially rejected, it is the rejected (unfilled) amount.

If the entire order is waiting for execution, it is the initial amount of the order.


Regardles of the order direction (buy or sell), the value of this field is positive.

In the case of the If-Then order, the value of this field is 0.
StatusTime Date The date and time of the last update of the order state.

The time zone is defined by the system properties SERVER_TIME_UTC and BASE_TIME_ZONE.
Lifetime Integer The time, during which the trader must accept or reject the order requoted by the dealer. The time is expressed
in seconds. This field is not currently in use.
AtMarket Double The distance from the Rate within which the trader allows the order to be executed. It is expressed in
pips. If the market price moves beyond the allowed distance, then the order cannot be executed.
This field is applicable only for open/close range orders. For all other types of orders, the value of this field is 0.0.
TrailStep Integer The number of pips the market should move before the order moves the same number of pips after it.

It is applicable only for trailing orders (trailing stop, entry trailing stop/limit). Otherwise, the value of this field is 0.

Note: If the trailing order is dynamic (automatically updates every 0.1 of a pip), then the value of this
field is 1.
TrailRate Double The market price at the time the order automatically moves following the market fluctuations.
In the case of FX instruments, it is expressed in the instrument counter currency per one unit of base currency. In the case of CFD instruments,
it is expressed in the instrument native currency per one contract.

If the order has not followed the market yet, the value of this field provides the initial market price
at the time when the order is placed. It is applicable only for trailing orders (trailing stop, entry
trailing stop/limit). Otherwise, the value of this field is 0.0.
TimeInForce String The time-in-force option of the order. The possible values are:

GTCGood Till Cancelled (Open/Close Market, Entry, Stop, and Limit orders).

IOCImmediate Or Cancel (Open/Close Market, Open/Close, and Open/Close Range orders).

FOKFill Or Kill (Open/Close Market, Open/Close, and Open/Close Range orders).

DAYDay Order (Open/Close Market, Entry, Stop, and Limit orders).

GTDGood Till Date (Open/Close Market, Entry, Stop, and Limit orders).

AccountKind String The type of the account the order is placed on. The possible values are:

32Self-traded, funds manager (only LAMM), managed (only LAMM) accounts.

36Funds manager account (only PAMM).

38Managed account (only PAMM).

RequestTXT String The custom identifier of the order. For example, LimitEntryOrder.
ContingentOrderID String The unique identifier of an existing contingency group which the order is linked to.
The number is unique within the same database that stores the account the contingent order is placed on.
For example, MINIDEMO or U100D1. The uniqueness of the order itself is assured by the combination of the
database ID and the value of this field.

It is applicable only for orders included in an OCO order or secondary orders of ELS and OTO orders.
Otherwise, the value of this field is blank.
ContingencyType Integer The type of the contingent order to which the order is linked. It is applicable only for orders included
in an OCO order or secondary orders of ELS, OTO and OTOCO orders.
The possible values are:

1OCO order.

2OTO order.

3ELS order.

4OTOCO order.

For all other orders, the value of this field is 0.
PrimaryID String The unique identification number of the primary order of ELS, OTO or OTOCO contingent orders to which the order
is linked. The number is unique within the same database that stores the account the primary order is placed on.
For example, MINIDEMO or U100D1. The uniqueness of the order itself is assured by the combination of the
database ID and the value of this field.

It is applicable only for secondary orders of ELS, OTO and OTOCO contingent orders. Otherwise, the value of this field is blank.
OriginAmount Integer The original amount of the order when it is placed. In the case of FX instruments, the amount is expressed
in the base currency of an instrument. In the case of CFD instruments, the amount is expressed in contracts. This field has the same value for the lifetime of the order.
FilledAmount Integer The amount of the last order portion filled. In the case of FX instruments, the amount is expressed in the
base currency of an instrument. In the case of CFD instruments, the amount is expressed in contracts. If the order is rejected or canceled,
the value of this field is 0.
WorkingIndicator Boolean The working indicator flag. It defines whether the order is active on the market or not. The possible values are:

YThe order is active.

NThe order is inactive.

It is applicable only for secondary orders of ELS, OTO and OTOCO orders. For all other orders, the value of this field is Y.
PegType String The price used to calculate the pegged order price. Pegged means that the price is specified as an
offset to one of the following prices:

OThe stop/limit order is set as a distance in pips to the open price (the pegged stop/limit order).

MThe stop/limit order is set as a distance in pips to the close price (the pegged stop/limit order).

This field is applicable only for stop/limit orders and secondary orders of ELS orders. For all other order types, the value of this field is blank.
PegOffset Double The offset to the price specified in the PegType field. It is expressed in pips.
This field is applicable only for stop/limit orders and secondary orders of ELS orders.
For these orders the value of this field can be positive or negative.
For all other orders, the value of this field is 0.0.
ExpireDate Date The expiration date and time of the order. It is applicable only for the orders with the DAY or GTD
time-in-force option.

The time zone is defined by the system properties SERVER_TIME_UTC and BASE_TIME_ZONE.
ValueDate String The simulated delivery date. The date when the position could be automatically closed.
The position is closed only if the order is executed and opens a position. This field is provided in the yyyyMMdd format.
It is applicable for orders placed from accounts with the day netting trading mode
(see MaintenanceType field in the Accounts table). Otherwise, the value of this field is blank.
Parties String The unique identifier of the environment that is used to place the order. The identifier is generated
by ForexConnect.
Limit Double The price of the associated limit order (the profit limit level). In the case of FX instruments, it is expressed in the instrument counter currency
per one unit of base currency. In the case of CFD instruments, it is expressed in the instrument native currency per one contract.

It is applicable only for opening orders (Entry or Market).

If there is no associated limit order, the value of this field is 0.0.

If the associated limit order is a pegged order, the value of this field is 0.0.


Note: This is a calculable field, which is calculated on the client side.
It is not applicable for the U.S. accounts. In the case of the accounts subject to the FIFO rule, the
value of this field is 0.0.
Stop Double The price of the associated stop order (the loss limit level). In the case of FX instruments, it is expressed in the instrument counter currency
per one unit of base currency. In the case of CFD instruments, it is expressed in the instrument native currency per one contract.

It is applicable only for opening orders (Entry or Market).

If there is no associated stop order, the value of this field is 0.0.

If the associated stop order is a pegged order, the value of this field is 0.0.


Note: This is a calculable field, which is calculated on the client side.
applicable for the U.S. accounts. In the case of the accounts subject to the FIFO rule, the value of this field is
0.0.
StopTrailStep Integer The trailing step of the associated trailing stop order or secondary entry stop order of an ELS order. It is expressed in pips.
For details, see TrailStep. It is applicable only for opening orders (Entry or Market).
If there is no associated trailing stop order, the value of this field is 0.


Note: This is a calculable field, which is calculated on the client side.
StopTrailRate Double The trailing rate of the associated trailing stop order or secondary entry stop order of an ELS order.
In the case of FX instruments, it is expressed in the instrument counter currency per one unit of base currency.
In the case of CFD instruments, it is expressed in the instrument native currency per one contract.
For details, see TrailRate. It is applicable only for opening orders (Entry or Market).
If there is no associated trailing stop order, the value of this field is 0.0.


Note: This is a calculable field, which is calculated on the client side.
Table of Contents