As per https://www.mql5.com/en/docs/trading/positionselect
PositionSelect
Chooses an open position
for further working with it. Returns true if the function is
successfully completed. Returns false in case of failure. To obtain
information about the error, call GetLastError().
bool PositionSelect( stringsymbol// Symbol name );
If individual positions are allowed (ACCOUNT_MARGIN_MODE_RETAIL_HEDGING), multiple positions can be open for one symbol. In this case, PositionSelect will select a position with the lowest ticket.
Function PositionSelect() copies data about a position into the program environment, and further calls of PositionGetDouble(), PositionGetInteger() and PositionGetString()
return the earlier copied data. This means that the position itself may
no longer exist (or its volume, direction, etc. has changed), but data
of this position still can be obtained. To ensure receipt of fresh data
about a position, it is recommended to call PositionSelect() right
before referring to them.
I think PositionSelect() could be very useful in hedge mode returning position current profit, volume, swap, and average TP, SL and price open
Chooses an open position for further working with it. Returns true if the function is successfully completed. Returns false in case of failure. To obtain information about the error, call GetLastError(). If individual positions are allowed (ACCOUNT_MARGIN_MODE_RETAIL_HEDGING), multiple positions can be open for one symbol. In this case...
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
As per https://www.mql5.com/en/docs/trading/positionselect
PositionSelect
Chooses an open position for further working with it. Returns true if the function is successfully completed. Returns false in case of failure. To obtain information about the error, call GetLastError().
bool PositionSelect(
string symbol // Symbol name
);
Parameters
symbol
[in] Name of the financial security.
Return Value
Value of the bool type.
Note
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. In this case, PositionSelect will select a position with the lowest ticket.
Function PositionSelect() copies data about a position into the program environment, and further calls of PositionGetDouble(), PositionGetInteger() and PositionGetString() return the earlier copied data. This means that the position itself may no longer exist (or its volume, direction, etc. has changed), but data of this position still can be obtained. To ensure receipt of fresh data about a position, it is recommended to call PositionSelect() right before referring to them.
I think PositionSelect() could be very useful in hedge mode returning position current profit, volume, swap, and average TP, SL and price open