Type/to search
Built-in Functions
Structures
Trade
Ticker
Record
Order
Condition
OrderBook
Depth
Account
Asset
Position
Market
Funding
OtherStruct
HttpQuery-options
HttpQuery-return
LogStatus-table
LogStatus-btnTypeOne
LogStatus-btnTypeTwo
Chart-options
KLineChart-options
SetData-data
EventLoop-return
DBExec-return
Thread.join-return
Built-in Variables

Order structure.

Attributes

NameTypeDescription

Info

object

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

Symbol

string

The Symbol field is the trading symbol code defined by the FMZ platform, with the same format as the Symbol field in the Ticker structure.

  • For spot exchange objects, the format of the Symbol field value (example) is: BTC_USDT, representing the BTC_USDT spot trading pair.

  • For futures exchange objects, the format of the Symbol field value (example) is: BTC_USDT.swap, representing the BTC USDT-margined perpetual contract.

Id

string

Order ID, this attribute 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.

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

Conditional order configuration information. When the order is a conditional order, this field contains the trigger conditions and execution price configuration for the conditional order. For regular orders, this field is null.

The structure of this field refers to the Condition structure.

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 or an empty array. If there are no pending orders currently, it returns [], i.e., an empty array. 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.