I'm really puzzled with this interval. I can't think it out.

 
Hi, I have this unsolvable situation (by me). I want to count the change in the Bid for a 5 seconds interval on a chart. The problem is that the script doesn't correctly count the time and the change. Sometimes it counts the whole 5 seconds, sometimes it doesn't (2 or 3 seconds are counted).

double one, two;
one = MarketInfo(Symbol(), MODE_BID);
Print("First Bid is ",MarketInfo(Symbol(), MODE_BID),",",TimeToStr(CurTime(),TIME_MINUTES|TIME_SECONDS));
Sleep(5000);
two = MarketInfo(Symbol(), MODE_BID);
Print("Second Bid is ",MarketInfo(Symbol(), MODE_BID),",",TimeToStr(CurTime(),TIME_MINUTES|TIME_SECONDS));

Can anyone suggest to me a script so I can accuretely count the change of the price for a 5 seconds period? I would be very grateful for any help. Thank you in advance.
 
Hi, I have this unsolvable situation (by me). I want to count the change in the Bid for a 5 seconds interval on a chart. The problem is that the script doesn't correctly count the time and the change. Sometimes it counts the whole 5 seconds, sometimes it doesn't (2 or 3 seconds are counted).

double one, two;
one = MarketInfo(Symbol(), MODE_BID);
Print("First Bid is ",MarketInfo(Symbol(), MODE_BID),",",TimeToStr(CurTime(),TIME_MINUTES|TIME_SECONDS));
Sleep(5000);
two = MarketInfo(Symbol(), MODE_BID);
Print("Second Bid is ",MarketInfo(Symbol(), MODE_BID),",",TimeToStr(CurTime(),TIME_MINUTES|TIME_SECONDS));

Can anyone suggest to me a script so I can accuretely count the change of the price for a 5 seconds period? I would be very grateful for any help. Thank you in advance.

CurTime() is a server last tick time. Try to use LocalTime() instead.