Type/to search
Built-in Functions
Global
Log
Market
Trade
Account
Futures
Exchange
IO
Network
Storage
Threads
TA
Talib
OS
Structures
Built-in Variables and Constants
Conventions
Exchanges

Obtains order information.

exchange.GetOrder(orderId)

Examples

Place a sell order, then query it with the returned order ID.

javascript
function main(){ var id = exchange.Sell(1000, 1) if (!id) return var order = exchange.GetOrder(id) if (!order) return Log("Id:", order.Id, "Price:", order.Price, "Amount:", order.Amount, "DealAmount:", order.DealAmount, "Status:", order.Status, "Type:", order.Type) }
python
def main(): id = exchange.Sell(1000, 1) if not id: return order = exchange.GetOrder(id) if not order: return Log("Id:", order["Id"], "Price:", order["Price"], "Amount:", order["Amount"], "DealAmount:", order["DealAmount"], "Status:", order["Status"], "Type:", order["Type"])
rust
fn main() { let Ok(id) = exchange.Sell(1000, 1) else { return }; let Ok(order) = exchange.GetOrder(&id) else { return }; Log!("Id:", order.Id, "Price:", order.Price, "Amount:", order.Amount, "DealAmount:", order.DealAmount, "Status:", order.Status, "Type:", order.Type); }

Returns

TypeDescription

Order / null value

Queries order details based on the order Id. Returns the Order structure when the query is successful, and returns a null value when the query fails.

Arguments

NameTypeRequiredDescription

orderId

string

Yes

Order to be queried. The Id attribute of the FMZ platform order Order structure consists of the exchange symbol code and the exchange's original order Id, separated by an English comma. For example, the Id attribute of an order for the spot trading pair ETH_USDT on the OKX exchange has the format: ETH-USDT,1547130415509278720.

When calling the exchange.GetOrder() function to query an order, the orderId parameter passed in is consistent with the Id attribute of the order Order structure.

See Also

Remarks

Some exchanges do not support the exchange.GetOrder() function. The AvgPrice attribute in the return value Order structure is the average filled price; some exchanges do not support this field, and if it is not supported it will be set to 0.

If you are using an older version of the docker, the orderId parameter of the exchange.GetOrder() function may differ from the orderId described in the current documentation.

Exchanges that do not support this function: Web3. The call fails with an error and returns null; for all exchanges see Capability Matrix.

Exchanges that serve this function through a fallback: the exchange's API does not fully provide this function, and the docker fills the gap.

The exchange has no such endpoint; the docker implements the function:

  • Coincheck: The exchange has no single-order query interface, so the order is looked up among the current open orders; the exchange provides no historical order query, so filled or canceled orders cannot be found (null is returned).
  • Zaif: The exchange has no single-order query interface, so the order is looked up among the current open orders and the historical orders.