Vladimir Pastushak: So in fact the second option is better?
Yes. In the second variant, you first check if the function worked correctly, and if everything is OK, you start working with the variable where the result of the function has been placed.
Good afternoon, MQL5 specialists. Please advise how to open and close a standard order in the 5. //I just moved from the 4 series.
Can I do it without external libraries?
I can't find anything in the documentation about closing.
I understand there are two ways to open an order, but how would that affect testing?
//--- В шапке файла подключаем класс CTrade - класс //--- для упрощенного доступа к торговым функциям#include <Trade\Trade.mqh>
//--- объявляем переменную
CTrade m_trade;
//--- открываем, закрываем...//--- используя методы класса CTrade...
CTrade. And of course at each step we have to check what was returned by the method.
aha. if i open an order asynchronously, will that be tested? and it looks like CTrade is only for synchronous operation? // if you're going to write on the 5-point, then you should use something which is not in the 4-point)
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.
So in fact the second option is better?
About voting principles and signal weights: MQL5 Wizard: New version.
Good afternoon, MQL5 specialists. Could you please advise how to open and close a standard order in the 5th one? //I just moved from the 4 series.
Can I do it without external libraries?
I can't find anything in the documentation about closing.
I understand there are two ways to open an order, but how would that affect testing?
Good afternoon, MQL5 specialists. Please advise how to open and close a standard order in the 5. //I just moved from the 4 series.
Can I do it without external libraries?
I can't find anything in the documentation about closing.
I understand there are two ways to open an order, but how would that affect testing?
CTrade. And of course at each step we have to check what the method has returned.
Wow what a chip) Thank you!
So opening an order asynchronously is another story and not part of CTrade?
Wow what a chip) Thank you!
Welcome to the Five!
aha. if i open an order asynchronously, will that be tested? and it looks like CTrade is only for synchronous operation? // if you're going to write on the 5-point, then you should use something which is not in the 4-point)
// unsuccessfully scratched out the multicurrency indicator..., wasted half a day
aha. if i open an order asynchronously, will this be tested? and it looks like CTrade is only for synchronous operation?
// with a bit of difficulty scratched out a multi-currency indicator...
Good afternoon, MQL5 specialists. Could you please advise how to open and close a standard order in the 5th one? //I just moved from the 4 series.
Can I do it without external libraries?
I can't find anything in documentation about closing.
As far as I understand, the order can be opened in two ways, but how would that affect testing?
If we do not have any external libraries, there is PositionClose.
Also, we can open a position with the same volume in the opposite direction and it will result in a close.
If not external - there is PositionClose
You can also open a position with the same volume in the opposite direction, which will result in a close.