TradeMUX SDK Documentation
1.0
TradeMUX SDK Documentation
|
bool OrderSelect | ( | int | index, |
int | select, | ||
int | pool | ||
) |
The function selects an order for further processing
index | Order index or order ticket depending on the second parameter |
select | Selecting flags. It can be any of the following values: SELECT_BY_POS - index in the order pool SELECT_BY_TICKET - index is order ticket |
pool | Optional order pool index. Used when the selected parameter is SELECT_BY_POS. It can be any of the following values: MODE_TRADES (default)- order selected from trading pool(opened and pending orders) MODE_HISTORY - order selected from history pool (closed and canceled order) |
The pool parameter is ignored if the order is selected by the ticket number. The ticket number is a unique order identifier.
To find out from what list the order has been selected, its close time must be analyzed. If the order close time equals to 0, the order is open
or pending and taken from the terminal open orders list.
One can distinguish an opened order from a pending order by the order type. If the order close time does not equal to 0, the order is a closed
order or a deleted pending order and was selected from the terminal history. They also differ from each other by their order types.
The OrderSelect() function copies order data into program environment and all further calls of OrderClosePrice(), OrderCloseTime(),
OrderComment(), OrderCommission(), OrderExpiration(), OrderLots(), OrderMagicNumber(), OrderOpenPrice(), OrderOpenTime(), OrderPrint(),
OrderProfit(), OrderStopLoss(), OrderSwap(), OrderSymbol(), OrderTakeProfit(), OrderTicket(), OrderType() functions return the data,
copied earlier. It means that in some cases the order details (open price, SL/TP levels or expiration date) may change and the data
become non-actual. It is strongly recommended to call the OrderSelect() function before request the order data.