Type/to search
Built-in Functions
Structures
Ticker
Depth
OrderBook
Trade
Record
Market
Order
Condition
Account
Asset
Position
Funding
Other Structures
Built-in Variables and Constants
Conventions
Exchanges

Returned by exchange.GetOrder(), exchange.GetOrders() and similar: order ID, price, amount, filled amount, average price, status, type, offset, contract code and conditional order settings.

Attributes

NameTypeDescription

Info

object

Raw data returned by the exchange interface, this attribute is not available during backtesting.

Symbol

string

The FMZ symbol, written as described in Symbols, for example BTC_USDT on spot and BTC_USDT.swap (USDT-margined perpetual) on futures; the same format as Symbol of Ticker.

Id

string

Order ID. On most exchanges the order ID consists of the exchange symbol code and the exchange's original order ID, separated by an English comma. For example, the Id attribute format for an ETH_USDT spot trading pair order on OKX exchange is: ETH-USDT,1547130415509278720. On a few exchanges the order ID is just the exchange's original order ID without the symbol code. Treat Id as an opaque string and pass it on unchanged (for example to exchange.CancelOrder()); do not split or build it yourself.

Price

number

Order price, note that this attribute for market orders may be 0 or -1.

Amount

number

Order quantity, note that this attribute for market orders may be the amount value rather than the coin quantity.

DealAmount

number

Filled quantity, if the exchange interface does not provide this data, it may be filled with 0.

AvgPrice

number

Average filled price, note that some exchanges do not provide this data. When not provided and cannot be calculated, this attribute is set to 0.

Status

number

Order status, refer to ORDER_STATE_PENDING, ORDER_STATE_CLOSED, ORDER_STATE_CANCELED, ORDER_STATE_UNKNOWN.

Type

number

Order type, refer to ORDER_TYPE_BUY, ORDER_TYPE_SELL.

Offset

number

Open/close direction for contract orders, refer to ORDER_OFFSET_OPEN, ORDER_OFFSET_CLOSE.

ContractType

string

For spot orders, this attribute is "", i.e., an empty string. For contract orders, this attribute is the specific contract code.

Condition

object

Trigger conditions and order prices of a conditional order, see Condition. Ordinary orders have no such field; see the remarks for how to read it in each language.

Time

number

Order creation time, millisecond timestamp.

See Also

Remarks

The Order structure can be returned by exchange.GetOrder() and exchange.GetOrders() functions. The exchange.GetOrders() function returns an array of Order structures. If there are no pending orders currently, it returns [], i.e., an empty array; if the call fails (network error, exchange error, etc.), it returns a null value (null in JavaScript, None in Python). The Status attribute of the Order structure can be directly compared with constants like ORDER_STATE_PENDING to determine if they are equal and thus confirm the order status.

For one-way position mode, when it cannot be determined whether an order is for closing (reducing) a position, the Offset field is set to the opening direction by default, i.e., ORDER_OFFSET_OPEN.

The Time field represents the order creation time as a millisecond timestamp. Some exchanges may also include time information in the Info field, but the Time field provides a standardized timestamp format.

Ordinary orders have no Condition field: in JavaScript reading it gives undefined; in Python the key is absent, so accessing order.Condition as an attribute raises AttributeError; use order.get("Condition") or "Condition" in order; in Rust the Order structure always has Condition, and for an ordinary order Condition.ConditionType is -1.