OrderSelect
Selects an order to work with. Returns true if the function has been successfully completed. Returns false if the function completion has failed. For more information about an error call GetLastError().
bool OrderSelect( |
Parameters
ticket
[in] Order ticket.
Return Value
Value of the bool type.
Note
Do not confuse current pending orders with positions, which are also displayed on the "Trade" tab of the "Toolbox" of the client terminal. For each symbol, at any given moment of time, only one position can be open, while there can be several pending orders for the same symbol.
The OrderSelect() function works with a timeout. If the requested data are already available, they are given immediately without waiting. Otherwise, the preparation of the requested data may take a fixed timeout of 3 seconds. Once the data are received, the function immediately stops and returns the result.
In most cases the result of the function execution will be given immediately and without any delay, but during re-connections, the specified timeout of 3 seconds provides the necessary time to wait for an update.
Function OrderSelect() copies data about an order into the program environment, and further calls of OrderGetDouble(), OrderGetInteger(), OrderGetString() return the earlier copied data. This means that the order itself may no longer exist (or its open price, Stop Loss/Take Profit levels or expiration has changed), but data of this order still can be obtained. To ensure receipt of fresh data about an order, it is recommended to call OrderSelect() right before referring to them.
See also
OrderGetInteger(), OrderGetDouble(), OrderGetString(), OrderCalcProfit(), OrderGetTicket(), Order Properties
© 2000-2010, MetaQuotes Software Corp.