How to Send Orders Asynchronously With MQL4?

To add comments, please log in or register
alexandrecaus
20
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..

Mohamad Zulhairi Baba
21233
Mohamad Zulhairi Baba  
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

Alain Verleyen
40789
Alain Verleyen  
Mohamad Zulhairi Baba:

you can't

You can simulated it by using several EAs or scripts simultaneously.
William Roeder
22428
William Roeder  
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.
Mohamad Zulhairi Baba
21233
Mohamad Zulhairi Baba  
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.

William Roeder
22428
William Roeder  
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.

Alain Verleyen
40789
Alain Verleyen  
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.

nicholish en
2675
nicholish en  
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. 

To add comments, please log in or register