My understanding of the main benefit of MQL5 is the ability to be able to place trades without having to wait for the trade to be completed.
This is accomplished using
OrderSendAsync
which you can then check using the
OnTradeTransaction handler
so this much I understand.
My problem is understanding how to close a Position
if I use PositionClose then what do i do?
Successful completion of the PositionClose(...) method does not always mean successful execution of the trade operation. It is necessary to check the result of trade request (trade server return code) using ResultRetcode().
I completely don't understand how to use this in the context of closing multiple positions
How does ResultRetCode know which postion close I am checking?
How do I request to close a few positions, then check each that it is closed?
is there any alternate way in the API to close positions rather than PositionClose()?
p.s. what is the secret of getting email notifications to responses to my threads? I have it configured in the settings - my email is there plus the notification checkboxes are checked, but I never get notification emails.
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.
My understanding of the main benefit of MQL5 is the ability to be able to place trades without having to wait for the trade to be completed.
This is accomplished using
OrderSendAsync
which you can then check using the
OnTradeTransaction handler
so this much I understand.
My problem is understanding how to close a Position
if I use PositionClose then what do i do?
Successful completion of the PositionClose(...) method does not always mean successful execution of the trade operation. It is necessary to check the result of trade request (trade server return code) using ResultRetcode().
so this part I am completely confused by
ResultRetcode
Gets the code of request execution result.
uint ResultRetcode() const
Return Value
The code of request result.
I completely don't understand how to use this in the context of closing multiple positions
How does ResultRetCode know which postion close I am checking?
How do I request to close a few positions, then check each that it is closed?
is there any alternate way in the API to close positions rather than PositionClose()?
p.s. what is the secret of getting email notifications to responses to my threads? I have it configured in the settings - my email is there plus the notification checkboxes are checked, but I never get notification emails.