Orders (table)

Brief

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

Details

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:

true

The order is a Net Amount order.

false

The 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:

B

The order is placed to buy an instrument.

S

The 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:

O

The order is placed to open a position.

C

The order is placed to close a position.

Type

String

The order type. The possible values are:

S

Stop.

ST

Trailing Stop.

L

Limit.

SE

Entry Stop.

LE

Entry Limit.

STE

Trailing Entry Stop.

LTE

Trailing Entry Limit.

C

Close.

CM

Close Market.

CR

Close Range.

O

Open.

OM

Open Market.

OR

Open Range.

M

Margin Call.

Status

String

The state of the order. The possible values are:

W

Waiting.

P

In process.

I

Dealer intervention.

Q

Requoted.

U

Pending calculated.

E

Executing.

S

Pending Canceled.

C

Canceled.

R

Rejected.

T

Expired.

F

Executed.

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:

GTC

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

IOC

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

FOK

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

DAY

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

AccountKind

String

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

32

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

36

Funds manager account (only PAMM).

38

Managed account (only PAMM).

RequestTXT

String

The custom identifier of the order. For example, LimitEntryOrder.

ContingentOrderID

String

The unique identification number of the contingent order to which the order is linked. 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 and OTO orders. The possible values are:

1

OCO order.

2

OTO order.

3

ELS order.

For all other orders, the value of this field is 0.

PrimaryID

String

The unique identification number of the primary order of ELS or OTO 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 and OTO 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:

Y

The order is active.

N

The order is inactive.

It is applicable only for secondary orders of ELS and OTO 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:

0

The open price of the position to be closed.

1

The current market price, at which the position can be closed.

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 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: It is a calculated field and is available only through the Table Manager. 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: It is a calculated field and is available only through the Table Manager. 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.

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: It is a calculated field and is available only through the Table Manager.

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: It is a calculated field and is available only through the Table Manager.

back