Function |
Action |
Calculates the margin required for the specified order type, in the deposit currency |
|
Calculates the profit based on the parameters passed, in the deposit currency |
|
Checks if there are enough funds to execute the required trade operation. |
|
Sends trade requests to a server |
|
Asynchronously sends trade requests without waiting for the trade response of the trade server |
|
Returns the number of open positions |
|
Returns the symbol corresponding to the open position |
|
Chooses an open position for further working with it |
|
Selects a position to work with by the ticket number specified in it |
|
Returns the requested property of an open position (double) |
|
Returns the requested property of an open position (datetime or int) |
|
Returns the requested property of an open position (string) |
|
Returns the ticket of the position with the specified index in the list of open positions |
|
Returns the number of orders |
|
Return the ticket of a corresponding order |
|
Selects a order for further working with it |
|
Returns the requested property of the order (double) |
|
Returns the requested property of the order (datetime or int) |
|
Returns the requested property of the order (string) |
|
Retrieves the history of transactions and orders for the specified period of the server time |
|
Requests the history of deals with a specified position identifier. |
|
Selects an order in the history for further working with it |
|
Returns the number of orders in the history |
|
Return order ticket of a corresponding order in the history |
|
Returns the requested property of an order in the history (double) |
|
Returns the requested property of an order in the history (datetime or int) |
|
Returns the requested property of an order in the history (string) |
|
Selects a deal in the history for further calling it through appropriate functions |
|
Returns the number of deals in the history |
|
Returns a ticket of a corresponding deal in the history |
|
Returns the requested property of a deal in the history (double) |
|
Returns the requested property of a deal in the history (datetime or int) |
|
Returns the requested property of a deal in the history (string) |
For the function PositionGetInteger()
ENUM_POSITION_PROPERTY_INTEGER
Identifier |
Description |
Type |
POSITION_TICKET |
Position
ticket. Unique number assigned to each newly opened position. It
usually matches the ticket of an order used to open the position except
when the ticket is changed as a result of service operations on the
server, for example, when charging swaps with position re-opening. To
find an order used to open a position, apply the POSITION_IDENTIFIER
property. POSITION_TICKET value corresponds to MqlTradeRequest::position. |
long |
POSITION_TIME |
Position open time |
datetime |
POSITION_TIME_MSC |
Position opening time in milliseconds since 01.01.1970 |
long |
POSITION_TIME_UPDATE |
Position changing time in seconds since 01.01.1970 |
long |
POSITION_TIME_UPDATE_MSC |
Position changing time in milliseconds since 01.01.1970 |
long |
POSITION_TYPE |
Position type |
|
POSITION_MAGIC |
Position magic number (see ORDER_MAGIC) |
long |
POSITION_IDENTIFIER |
Position identifier is a unique number assigned to each re-opened position. It does not change throughout its life cycle and corresponds to the ticket of an order used to open a position.
Position identifier is specified in each order (ORDER_POSITION_ID) and deal (DEAL_POSITION_ID) used to open, modify, or close it. Use this property to search for orders and deals related to the position.
When reversing a position in netting mode (using a single in/out trade), POSITION_IDENTIFIER does not change. However, POSITION_TICKET is replaced with the ticket of the order that led to the reversal. Position reversal is not provided in hedging mode. |
long |
POSITION_REASON |
The reason for opening a position |
Usually you can analyze the position open time to see whether a position was opened or not.
Hey, thanks for your reply...
How do I use the OnTradeTransaction() to keep checking my order until it gets filled, so I can order the second one?
Sorry if I'm asking simple question, I'm kinda new to all this...(I read this article (https://www.mql5.com/en/articles/1111) but t didn't clarify a lot to me.
Thanks again
- 2014.10.09
- Dennis Kirichenko
- www.mql5.com
Function |
Action |
Calculates the margin required for the specified order type, in the deposit currency |
|
Calculates the profit based on the parameters passed, in the deposit currency |
|
Checks if there are enough funds to execute the required trade operation. |
|
Sends trade requests to a server |
|
Asynchronously sends trade requests without waiting for the trade response of the trade server |
|
Returns the number of open positions |
|
Returns the symbol corresponding to the open position |
|
Chooses an open position for further working with it |
|
Selects a position to work with by the ticket number specified in it |
|
Returns the requested property of an open position (double) |
|
Returns the requested property of an open position (datetime or int) |
|
Returns the requested property of an open position (string) |
|
Returns the ticket of the position with the specified index in the list of open positions |
|
Returns the number of orders |
|
Return the ticket of a corresponding order |
|
Selects a order for further working with it |
|
Returns the requested property of the order (double) |
|
Returns the requested property of the order (datetime or int) |
|
Returns the requested property of the order (string) |
|
Retrieves the history of transactions and orders for the specified period of the server time |
|
Requests the history of deals with a specified position identifier. |
|
Selects an order in the history for further working with it |
|
Returns the number of orders in the history |
|
Return order ticket of a corresponding order in the history |
|
Returns the requested property of an order in the history (double) |
|
Returns the requested property of an order in the history (datetime or int) |
|
Returns the requested property of an order in the history (string) |
|
Selects a deal in the history for further calling it through appropriate functions |
|
Returns the number of deals in the history |
|
Returns a ticket of a corresponding deal in the history |
|
Returns the requested property of a deal in the history (double) |
|
Returns the requested property of a deal in the history (datetime or int) |
|
Returns the requested property of a deal in the history (string) |
For the function PositionGetInteger()
ENUM_POSITION_PROPERTY_INTEGER
Identifier |
Description |
Type |
POSITION_TICKET |
Position
ticket. Unique number assigned to each newly opened position. It
usually matches the ticket of an order used to open the position except
when the ticket is changed as a result of service operations on the
server, for example, when charging swaps with position re-opening. To
find an order used to open a position, apply the POSITION_IDENTIFIER
property. POSITION_TICKET value corresponds to MqlTradeRequest::position. |
long |
POSITION_TIME |
Position open time |
datetime |
POSITION_TIME_MSC |
Position opening time in milliseconds since 01.01.1970 |
long |
POSITION_TIME_UPDATE |
Position changing time in seconds since 01.01.1970 |
long |
POSITION_TIME_UPDATE_MSC |
Position changing time in milliseconds since 01.01.1970 |
long |
POSITION_TYPE |
Position type |
|
POSITION_MAGIC |
Position magic number (see ORDER_MAGIC) |
long |
POSITION_IDENTIFIER |
Position identifier is a unique number assigned to each re-opened position. It does not change throughout its life cycle and corresponds to the ticket of an order used to open a position.
Position identifier is specified in each order (ORDER_POSITION_ID) and deal (DEAL_POSITION_ID) used to open, modify, or close it. Use this property to search for orders and deals related to the position.
When reversing a position in netting mode (using a single in/out trade), POSITION_IDENTIFIER does not change. However, POSITION_TICKET is replaced with the ticket of the order that led to the reversal. Position reversal is not provided in hedging mode. |
long |
POSITION_REASON |
The reason for opening a position |
Usually you can analyze the position open time to see whether a position was opened or not.
Hey, thanks for your reply. I didn't understand how I can know if my position was filled by using the positon open time...
Thanks again
Hey, thanks for your reply. I didn't understand how I can know if my position was filled by using the positon open time...
Thanks again
What do you mean by "my position was filled" ? A position is open or close, but filled ??
What do you mean by "my position was filled" ? A position is open or close, but filled ??
I mean when my order becomes a trade or a deal (it actually executes and it gets filled)
I actually found a way of doing it by using the historySelect and HistoryDealsTotal functions...
Thanks for the replies
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hey, I'm kinda of new in MQL5. I have a EA that buys one stock first (let's say PETR4) and then buys another one (let's say ABEV3).
The only problem is that I can only order the second one when the first one is executed (not only placed).
I used the MqlTradeResult.retcode to get the return number but that only shows if the order has been placed and I need to know if the order has been filled in order to continue with the second operation...
Can anyone help me?
Thanks