How to Send Orders Asynchronously With MQL4?

 

There is no way to get to the point.
I need to send orders asynchronously, I mean, I can't wait for a reply to be sent, to send another one, because I have more than one order to send at the same time (for two different pairs).

How to send orders asynchronously with MQL4?

Thanks..

 
alexandrecaus:

There is no way to get to the point.
I need to send orders asynchronously, I mean, I can't wait for a reply to be sent, to send another one, because I have more than one order to send at the same time (for two different pairs).

How to send orders asynchronously with MQL4?

Thanks..

you can't

 
Mohamad Zulhairi Baba:

you can't

You can simulated it by using several EAs or scripts simultaneously.
 
alexandrecaus: , I can't wait for a reply to be sent, to send another one, because I have more than one order to send at the same time (for two different pairs).
  1. Why not? Why are you trading the second pair? It hasn't changed from the last tick. Only the current symbol has.
  2. In any case, there are no async functions in MT4.
 
Alain Verleyen:
You can simulated it by using several EAs or scripts simultaneously.

in theory, yes..
on live market uncertainties on incoming tick, even 1ms is not asynchronous, or at least not all the time.

 
Mohamad Zulhairi Babaeven 1ms is not asynchronous, or at least not all the time.

One MS?

The microseconds the EA takes is irrelevant, compared to the 20-200 milliseconds the network takes, which is irrelevant compared to the minutes to do a trade because of the servers during news.

OrderSend sends the request, network delivers, placed in the server queue. Once it reaches the top of the queue, you get filled or not, and the result delivered back to the terminal. Normally it is the 20-200 milliseconds the network takes to deliver is the limiting factor, but it can take minutes to do a trade because of the servers during news.

 
Mohamad Zulhairi Baba:

in theory, yes..
on live market uncertainties on incoming tick, even 1ms is not asynchronous, or at least not all the time.

Doesn't make sense.We are talking about sending simultaneous request, not incoming ticks which are irrelevant.

I am not talking about theory but about practice and coding.

 
Mohamad Zulhairi Baba:

in theory, yes..
on live market uncertainties on incoming tick, even 1ms is not asynchronous, or at least not all the time.

asynchronous != batch request. Async is the ability to send other requests without waiting for the result from the trade server, and it can be done by spawning worker EAs that receive order details via custom chart events and process orders. Execution is on par with MT5 async orders as long as you have enough workers in your pool to match the number of trade requests and you don't hit the trade context limit. So it is possible, but it is a hack with a lot of moving parts. 

Reason: