The structure of the order.
Teh original data of the exchange interface response, no such attribute is available for backtesting.
Info
object
The Symbol
field is the trading product code defined by the FMZ platform, and its format is consistent with the Symbol
field of the {@struct/Ticker Ticker} structure.
Symbol
field value is (for example): BTC_USDT
, indicating the BTC_USDT spot trading pair.Symbol
field value is (for example): BTC_USDT.swap
, which represents the USDT-standard perpetual contract of BTC.Symbol
string
Order Id, this attribute consists of the exchange product code and the exchange original order ID, separated by English commas. For example, the attribute Id
format of the spot trading pair ETH_USDT
order of OKX exchange is: ETH-USDT,1547130415509278720
.
Id
string
The price of the order, note that this attribute may be 0 or -1 for market orders.
Price
number
The number of orders placed, note that this attribute of a market order may be an amount and not a currency.
Amount
number
The number of transactions, possibly padded with 0 if the exchange interface does not provide this data.
DealAmount
number
Average transaction price, note that some exchanges do not provide this data. This attribute is set to 0 if it is not available and cannot be calculated.
AvgPrice
number
Order status, refer to {@var/ORDER_STATE/ORDER_STATE_PENDING ORDER_STATE_PENDING}, {@var/ORDER_STATE/ORDER_STATE_CLOSED ORDER_STATE_CLOSED}, {@var/ORDER_STATE/ORDER_STATE_CANCELED ORDER_STATE_CANCELED}, {@var/ORDER_STATE/ORDER_STATE_UNKNOWN ORDER_STATE_UNKNOWN}.
Status
number
Order type, refer to {@var/ORDER_TYPE/ORDER_TYPE_BUY ORDER_TYPE_BUY}, {@var/ORDER_TYPE/ORDER_TYPE_SELL ORDER_TYPE_SELL}.
Type
number
For the opening and closing direction of contract orders, refer to {@var/ORDER_OFFSET/ORDER_OFFSET_OPEN ORDER_OFFSET_OPEN}, {@var/ORDER_OFFSET/ORDER_OFFSET_CLOSE ORDER_OFFSET_CLOSE}.
Offset
number
This attribute in spot orders is ""
, i.e. the empty string. In a contract order, this attribute is the specific contract code.
ContractType
string
The Order
order structure can be returned by the exchange.GetOrder()
and exchange.GetOrders()
functions. The exchange.GetOrders()
function returns an array of the Order
structure or an empty array. If there is no uncompleted order, it returns []
, which is an empty array. The Status
property of the Order
order structure can be directly compared with constants such as ORDER_STATE_PENDING
to determine whether they are equal and thus determine the order status.
For one-way position mode, when it is impossible to determine whether the order is a closing (reducing) order, the Offset
field is set to the opening direction by default, that is, ORDER_OFFSET_OPEN
.
{@fun/Trade/exchange.GetOrder exchange.GetOrder}, {@fun/Trade/exchange.GetOrders exchange.GetOrders}, {@fun/Trade/exchange.GetHistoryOrders exchange.GetHistoryOrders}
Record OrderBook