OrderSend not executing at the correct time

 

I want to execute an OrderSend at exactly 12:30 and 00 seconds, but when I look in the journal, it says the trade was bought at 12:30:05. Why is there a delay? How can I execute a trade much quicker than a 5 second delay?


extern string time = "2013.10.03 12:30:00";

//in ea
int start() {
  if (TimeCurrent() >= StrToTime(time))
    OrderSend(Symbol(),OP_BUYSTOP,0.01,1.70,0,0,0);
  return(0); 
 
Forexbandit:

I want to execute an OrderSend at exactly 12:30 and 00 seconds, but when I look in the journal, it says the trade was bought at 12:30:05. Why is there a delay? How can I execute a trade much quicker than a 5 second delay?


Maybe there wasn't a tick at exactly 12:30:00
 
Forexbandit:

I want to execute an OrderSend at exactly 12:30 and 00 seconds, but when I look in the journal, it says the trade was bought at 12:30:05. Why is there a delay? How can I execute a trade much quicker than a 5 second delay?



no you don't want it

your code says

if (TimeCurrent() >= StrToTime(time))

means if time equal as or greater then

but it won't help if you made it like

if (TimeCurrent() == StrToTime(time))

the way you want