- OrderCalcMargin
- OrderCalcProfit
- OrderCheck
- OrderSend
- OrderSendAsync
- PositionsTotal
- PositionGetSymbol
- PositionSelect
- PositionSelectByTicket
- PositionGetDouble
- PositionGetInteger
- PositionGetString
- PositionGetTicket
- OrdersTotal
- OrderGetTicket
- OrderSelect
- OrderGetDouble
- OrderGetInteger
- OrderGetString
- HistorySelect
- HistorySelectByPosition
- HistoryOrderSelect
- HistoryOrdersTotal
- HistoryOrderGetTicket
- HistoryOrderGetDouble
- HistoryOrderGetInteger
- HistoryOrderGetString
- HistoryDealSelect
- HistoryDealsTotal
- HistoryDealGetTicket
- HistoryDealGetDouble
- HistoryDealGetInteger
- HistoryDealGetString
OrderGetTicket
Returns ticket of a corresponding order and automatically selects the order for further working with it using functions.
ulong OrderGetTicket(
|
Parameters
index
[in] Number of an order in the list of current orders.
Return Value
Value of the ulong type. If the function fails, 0 is returned.
Note
Do not confuse current pending orders with positions, which are also displayed on the "Trade" tab of the "Toolbox" of the client terminal. An order is a request to conduct a transaction, while a position is a result of one or more deals.
For the "netting" interpretation of positions (ACCOUNT_MARGIN_MODE_RETAIL_NETTING and ACCOUNT_MARGIN_MODE_EXCHANGE), only one position can exist for a symbol at any moment of time. This position is a result of one or more deals. Do not confuse positions with valid pending orders, which are also displayed on the Trading tab of the Toolbox window.
If individual positions are allowed (ACCOUNT_MARGIN_MODE_RETAIL_HEDGING), multiple positions can be open for one symbol.
Function OrderGetTicket() 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 OrderGetTicket() right before referring to them.
Example:
void OnStart()
|
See also