I use the NJ4X API runtime platform, driven by custom Java
code. NJ4X Terminal Manager creates “pools” of separate
processes running MT4 and MT5 terminal.exe copies. This
allows for parallel processing, due to multiple MT instances logged
into the same trading account, as well as accessing multiple
trading account sessions…
MetaTrader is a “synchronous platform” so an order operation has to
complete before it can execute the next order operation…
So, using NJ4X and multi-threading, we allocate serial requests
to the “next available” synchronous MT process while other
MT terminal processes are busy executing their operations.
This means that with 4 terminals in the pool, then we can close
4 positions in the same time it would take to close just 1 position,
since the 4 terminals all work concurrently, in parallel, but each
is synchronous, so you must wait, for the operation to complete.
I just measure the time from starting an order operation, until
I get the synchronous confirmation that it’s completed… elapsed time.
So, in answer to your question, if it’s a Market Order, then there
isn’t confirmation until the order execution is fully completed, which
includes message transit time, queue time, aggregation time,
execution time, and confirmation, etc…
[EDIT] I just realized that if you use MetaTrader, and maybe you
write EA’s ( “Expert Advisors” ) then you are accustomed to the
idea that the EA’s order operations are synchronous. The NJ4X
platform “maps” ALL of MQL operations into Java and C# operations
which the high level control code uses. So the MetaTrader terminals
do have EA’s inside of them, but they are not written by me; rather,
these EA’s are part of NJ4X runtime platform, which perform the
API mapping from the high level operations into the MQL
operations inside the terminal platform (running as a server process).
So my “EA” trading logic is written entirely in Java, using NJ4X API mappings.
hyperscalper