Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1100

 
Vladimir Karputov:

No. Sleep and While are strictly forbidden.

Oh, yeah. How?

 
Сергей Таболин:

Well, it's essentially hanging the advisor... Waiting for confirmation to come or not to come... I'm at a loss here. How do I do this waiting? Using while() ?

There is no need to suspend anything.

In MQL4, some steps of position opening are simply hidden from the user, unlike in MQL5.

In MQL4 you

  1. send the order and
  2. A response from the server in the form of either a refusal of execution or a ticket of an open position.

In MQL5 you

  1. send an order and get a response about the result of that order being queued for execution.
  2. Then you received a reply about the triggering of this order (about the fact of the deal) and
  3. . Eventually you received a position with a ticket and its identifier written in a deal.

That is in brief. So - in MQL4 some steps are hidden from you and the terminal waits for a reply after sending a trade request to the server - the wait you are talking about. So - this command always makes you wait for the result of a trade request and slows down all your actions - you will not be able to do anything else after sending the request until you wait for a reply from the server.

In MQL5 you can continue to perform other actions and monitor the result of your trade request at the same time without having to wait for anything else to happen. This is much more profitable than in MQL4. The main thing is to use it wisely.

 
Artyom Trishkin:

It is much more profitable than in MQL4. The main thing is to use it wisely.

In MT4, do you often feel the lack of this benefit?

 
Citizens, don't litter the thread. Read the title: MQL5.
 
Vladimir Karputov:
Citizens, don't litter the thread. Read the title: MQL5.

Is it possible to compare features?

 
fxsaber:

In MT4, do you often feel this lack of benefit?

Yes, I have.

 
Artyom Trishkin:

Yes, it used to be.

Interesting scenarios.

 
fxsaber:

Interested in scenarios.

It's been a long time since I've traded. It's been a long time since I've traded.

But I used to have roboforex where after sending a request to the server the Expert Advisor was dead on waiting for requotes and did not do anything. I wanted to work with another symbol.

 
Artyom Trishkin:

I've seen on roboforex that after sending a request to the server, the Expert Advisor was waiting for a requote and didn't do anything. And I wanted to work with another symbol.

This is called several independent logics in one EA. These logics are spread in different charts.

 
fxsaber:

This is called multiple independent logics in one EA. People scatter these around in different charts.

It was all in one. A case where the chif went crazy when it was decoupled from the dollar. I had to work on other symbols with my hands. But I managed to get only $60 out of possible profit. If the Expert Advisor had not been waiting for a requote it would probably have made three times as much.

Reason: