minimum tick time difference

wing
547
wing  

Dear all

 

What is the minimum tick time difference between a new quote and an old one should be?

 

Is it accurate to use this code to measure?

 

int old_tt;
double old_bid;

int start()
{
   int start=GetTickCount();
   double a = MarketInfo("EURUSD",MODE_BID);

   if( old_bid != 0 && a != old_bid )
   {
      Print("bid[0] = "+a+", bid[1] = "+old_bid);
      Print("time diff = "+(GetTickCount()-old_tt)+", tick[0] = "+GetTickCount()+", tick[1] = "+old_tt);
   }


   old_tt = GetTickCount();
   old_bid = a;

 

Thanks for your help.

 

wing 

Ex Ovo Omnia
3107
Ex Ovo Omnia  

There is no minimum time difference between ticks.

The accuracy of your code depends only on GetTickCount(), which has precision of about 0.015 s.

Simon Gniadkowski
17401
Simon Gniadkowski  
wing:

Dear all

 What is the minimum tick time difference between a new quote and an old one should be?

 Is it accurate to use this code to measure?

If you are going to try and compare double values you need to read this thread:  Can price != price ?
wing
547
wing  
Ovo:

There is no minimum time difference between ticks.

The accuracy of your code depends only on GetTickCount(), which has precision of about 0.015 s.


well, what I want to achieve is to confirm that the latest quote appears immediately after the second latest quote.

 

If I am talking about "bar", it should be like this:

 

if( <<condition>> && time != 0 && iTime("EURUSD",5,0) > time && iTime("EURUSD",5,0) <= (time+5*60) )
{

   calculation

}

 

Now, what I want to code is the "tick version".

 

 

wing 

wing
547
wing  

quote come out tick by tick.

 

however, minimum Period() in MT4 is M1.

 

Even I use GetTickCount(), I found that there can still be a result of 0 time difference when a new quote arrived.

 

I just wonder is there a way to located two continuous quotes that one arrives immediately after another one. 

Simon Gniadkowski
17401
Simon Gniadkowski  
wing:


well, what I want to achieve is to confirm that the latest quote appears immediately after the second latest quote.

 If I am talking about "bar", it should be like this:

Now, what I want to code is the "tick version".

Often your code will miss ticks,  sometimes they come so close together that your start() function will still be running when the next tick(s) arrives.  The simple solution is to check Volume[0],  it gives the current tick number,  so if last time it was 6 and now it is 8 you have missed a tick. 
wing
547
wing  
RaptorUK:
Often your code will miss ticks,  sometimes they come so close together that your start() function will still be running when the next tick(s) arrives.  The simple solution is to check Volume[0],  it gives the current tick number,  so if last time it was 6 and now it is 8 you have missed a tick. 


why?

 

every new quote means a new tick.

 

When new tick comes, MT4 will run start() function one time.  Why will it "miss" a tick?

 

If what you say is correct, what's the usage of Marketinfo(symbol,Mode_Bid)? 

Simon Gniadkowski
17401
Simon Gniadkowski  
wing:


1.  why?

2.  every new quote means a new tick.

3.  When new tick comes, MT4 will run start() function one time.  Why will it "miss" a tick?

4.  If what you say is correct, what's the usage of Marketinfo(symbol,Mode_Bid)? 

1.  why what ?

2.  yes,  but a new tick does not always mean a change in Bid price,  a change in Ask will also produce a new tick.

3.  not if it is currently running start()  when the next tick arrives.  even the simplest start() function takes some time to run . . .

4.  what I said is correct,  write some code and test it for yourself.  MarketInfo(symbol, MODE_BID)  returns the current bid price for symbol symbol 

wing
547
wing  
RaptorUK:

1.  why what ?

2.  yes,  but a new tick does not always mean a change in Bid price,  a change in Ask will also produce a new tick.

3.  not if it is currently running start()  when the next tick arrives.  even the simplest start() function takes some time to run . . .

4.  what I said is correct,  write some code and test it for yourself.  MarketInfo(symbol, MODE_BID)  returns the current bid price for symbol symbol 


1. "sometimes they come so close together that your start() function will still be running when the next tick(s) arrives" - why?

 

2.  "but a new tick does not always mean a change in Bid price" - it is not material.  if new quote comes that only change mode_ask, it will still be a new tick, there will still be a time difference that can be counted.

 

3. so, when first tick comes, start() runs first time, before start() completes, if second tick comes, how will the terminal handle this case?

 

4. what I means is, if what you said is correct, does it mean MarketInfo(symbol,Mode_bid) cannot return "EVERY" new quote from broker? 

wing
547
wing  
point 1 is for explanation only, you don't need to reply.
William Roeder
25339
William Roeder  
wing: 3. so, when first tick comes, start() runs first time, before start() completes, if second tick comes, how will the terminal handle this case?
Answered TWICE. You miss the tick.