Testing 'CopyTicks' - page 47

 
Котировки Срочного рынка в МТ5
Котировки Срочного рынка в МТ5
  • 2021.11.10
  • www.mql5.com
Уважаемые модераторы! Перенесите, пожалуйста сообщения из темы "Клиринг по существу????* не относящиеся к клирингу, сюда...
 

No one is going to look at it and take it apart. Until there is a comparative analysis of exchange ticks and MT5, the conversation is empty. Because it can always be said that it is the exchange that is broadcasting crooked data to the broker.

 
fxsaber #:

No one is going to look at it and take it apart. Until there is a comparative analysis of exchange ticks and MT5, the conversation is empty. Because it can always be said that it is the stock exchange that is broadcasting crooked data to the broker.

There are some things that don't require external confirmation if you just look closely...


 
prostotrader #:

There are some things that don't require external validation if you just look closely...

Forum on trading, automated trading systems and trading strategy testing

Testing 'CopyTicks'

fxsaber, 2021.11.12 08:05

You can always say that it's the exchange that is broadcasting crooked data to the broker.

 
Котировки Срочного рынка в МТ5
Котировки Срочного рынка в МТ5
  • 2021.11.12
  • www.mql5.com
Уважаемые модераторы! Перенесите, пожалуйста сообщения из темы "Клиринг по существу????* не относящиеся к клирингу, сюда...
 
Котировки Срочного рынка в МТ5
Котировки Срочного рынка в МТ5
  • 2021.11.12
  • www.mql5.com
Уважаемые модераторы! Перенесите, пожалуйста сообщения из темы "Клиринг по существу????* не относящиеся к клирингу, сюда...
 
Котировки Срочного рынка в МТ5
Котировки Срочного рынка в МТ5
  • 2021.11.17
  • www.mql5.com
Уважаемые модераторы! Перенесите, пожалуйста сообщения из темы "Клиринг по существу????* не относящиеся к клирингу, сюда...
 

Do I understand correctly that finding out the actual tick at a certain point in time is a difficult task?


For example, you need to find out which tick was actual 2022.04.29 23:00:00.000. In the screenshot it is highlighted.


The only solution that came to mind.

bool GetActualTick( const string Symb, const ulong time, MqlTick &Tick, int Amount = 20 )
{
  MqlTick Ticks[];
  
  int Offset = 500;
  int Res = 0;
  
  while (!::IsStopped() && (Res <= 0) && (bool)Amount--)
    Res = ::CopyTicksRange(Symb, Ticks, COPY_TICKS_INFO, time - (Offset <<= 1), time);
    
  if (Res > 0)
    Tick = Ticks[Res - 1];
  
  return(Res > 0);
}

void OnStart()
{
  MqlTick Tick[1];
  
  if (GetActualTick(_Symbol, D'2022.04.29 23:00' * 1000, Tick[0]))
    ArrayPrint(Tick);
}
 
fxsaber #:

Do I understand correctly that finding out the actual tick at a certain point in time is a difficult task?


For example, you need to find out which tick was actual 2022.04.29 23:00:00.000. In the screenshot it is highlighted.


The only solution that came to mind.

Beautifully done, it never occurred to me before that it could be done that way.

I would have corrected it in such a way, the meaning is the same, only in 1 time.

 bool GetActualTick( const string Symb, const ulong time, MqlTick &Tick, int Sec = 30 )
{
  MqlTick Ticks[];
   
  int Res = ::CopyTicksRange(Symb, Ticks, COPY_TICKS_INFO, time - Sec*1000, time);
    
  if (Res > 0)
    Tick = Ticks[Res - 1];
  
  return(Res > 0);
}

void OnStart()
{
  MqlTick Tick[1];
  
  if (GetActualTick(_Symbol, D'2022.04.29 18:00' * 1000, Tick[0]))
    ArrayPrint(Tick);
}  

I faced such a task only when synchronizing >=2 tick arrays and here. But in both cases, synchronization is performed using the ready arrays unloaded at once. Both there and there, I synchronized by shifting the indexes one by one. I see what time (in future) is nearest and shift the index by this tool ++.

 
Andrey Miguzov #:

I would correct it like this - the meaning is the same, only in 1 time.

Unfortunately, it is impossible to guess the interval between adjacent ticks. Sometimes well over half a minute.