Timing of OrderSend function

 

Hi guys,

On regular OnTick event, I would like to know exactly WHEN the OrderSent function is done(sent) when there are other commands after it, like print or calculations. Is the Order sent right at the line processed in the code, or does MT4 ait until the Ontick code is finished?


Thanks for your help..

 
It's a synchronous function; send to the server, wait for the answer, return the ticket number.
 
whroeder1:
It's a synchronous function; send to the server, wait for the answer, return the ticket number.
Can you be more precise? Do you mean that MT4 wait for the answer before continuing to interpret the code?
 
whroeder1: It's a synchronous function; send to the server, wait for the answer, return the ticket number.
Volcanbleu: Can you be more precise? Do you mean that MT4 wait for the answer before continuing to interpret the code?
What part of "wait for the answer" was unclear?
 
whroeder1:
What part of "wait for the answer" was unclear?
What I would like to know, is WHEN EXACTLY the order is sent to the server when there are other calculations or orders after the order in the code within the start/ontick function.
 
Volcanbleu:
What I would like to know, is WHEN EXACTLY the order is sent to the server when there are other calculations or orders after the order in the code within the start/ontick function.
As whroeder1 said, once the logic in code is at the line of OrdetSend, the order is sent, the script waits for the response from the server, then it receives the ticket number in case of success or a negative number in case of error, from here the code will continue to next line(s). It doesn't take care of OnTick, it only depends on where OrderSend is, whether in OnTimer, OnTick.
 

use GetTickCount()

 

Thanks very much Mohammad. This is the answer I wanted to have..
 
Volcanbleu:
Thanks very much Mohammad. This is the answer I wanted to have..
You're welcome.