IsOrderClosed

Checks if an order is closed.

Syntax

IsOrderClosed(orderId: number): boolean

Parameters

  • orderId - A number representing the ticket number of the order to check.

Return Value

Returns a boolean value:

  • true if the order is closed (or does not exist)

  • false if the order is still open

Description

The IsOrderClosed method checks if an order with the specified ticket number is closed or does not exist in the list of open positions. This is useful for verifying the status of orders without having to select them first.

Unlike most other order-related methods, this method does not require an order to be selected beforehand.

Example

Notes

  • This method is particularly useful for monitoring the status of previously placed orders.

  • The method returns true both when the order is closed and when the order does not exist, so it cannot be used to determine if an order ever existed.

  • To check if an order exists in history, use SelectOrder with TSearchMode.DATA_MODE_HISTORY.

Last updated