Tick story - page 19

 
Karputov Vladimir:

The flags field of the MqlTicks structure often contains values of "24" (display mode "all ticks"):

- what does this value mean?

All parameters of each tick are always filled in, regardless of whether the data has changed since the previous tick. This allows you to always have the current price status at any moment of time without looking up the previous values in the tick history. For example, with a tick only the bid price might have changed, but the structure will contain other parameters in addition to the new price: previous ask price, volume, etc. To find out which data has changed with the current tick, analyse its flags:

  • TICK_FLAG_BID - the tick has changed the bid price
  • TICK_FLAG_ASK - the tick has changed the ask price
  • TICK_FLAG_LAST - tick has changed the price of last deal
  • TICK_FLAG_VOLUME - Tick has changed volume
  • TICK_FLAG_BUY - Tick occurred as a result of a buy deal
  • TICK_FLAG_SELL - a tick occurred as a result of a sell deal
Список изменений в билдах MetaTrader 5 Client Terminal
Список изменений в билдах MetaTrader 5 Client Terminal
  • www.mql5.com
Автоматическое обновление доступно через систему LiveUpdate:. - Страница 18 - Категория: общее обсуждение
 
Andrey Khatimlianskii:

I have attached an EA that prints out these codes in OnInit():

   Print(TICK_FLAG_BID," - тик изменил цену бид");
   Print(TICK_FLAG_ASK,"  - тик изменил цену аск");
   Print(TICK_FLAG_LAST," - тик изменил цену последней сделки");
   Print(TICK_FLAG_VOLUME," - тик изменил объем");
   Print(TICK_FLAG_BUY," - тик возник в результате сделки на покупку");
   Print(TICK_FLAG_SELL," - тик возник в результате сделки на продажу")

and the result:

2015.10.23 15:12:33.274 CopyTicks_1_5_0 (USDCAD,M5)     2 - тик изменил цену бид
2015.10.23 15:12:33.274 CopyTicks_1_5_0 (USDCAD,M5)     4  - тик изменил цену аск
2015.10.23 15:12:33.274 CopyTicks_1_5_0 (USDCAD,M5)     8 - тик изменил цену последней сделки
2015.10.23 15:12:33.274 CopyTicks_1_5_0 (USDCAD,M5)     16 - тик изменил объем
2015.10.23 15:12:33.274 CopyTicks_1_5_0 (USDCAD,M5)     32 - тик возник в результате сделки на покупку
2015.10.23 15:12:33.274 CopyTicks_1_5_0 (USDCAD,M5)     64 - тик возник в результате сделки на продажу

There is no "24" value among the results.

 
Karputov Vladimir:

There is no value of "24" among the results.

8 || 16 = 24

 
Karputov Vladimir:

I have attached an EA that prints out these codes in OnInit():

and the result:

There is no value "24" among the results.

Bitwise OR operation

Документация по MQL5: Основы языка / Операции и выражения / Побитовые операции
Документация по MQL5: Основы языка / Операции и выражения / Побитовые операции
  • www.mql5.com
Основы языка / Операции и выражения / Побитовые операции - справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
 
Clear - parameters can add up, depending on which MqlTick structure parameters have been changed with the arrival of the tick.
 

Can anyone else test the indicator from the post on methodology:

Forum on trading, automated trading systems and trading strategy testing

Tick history

Karputov Vladimir, 2015.10.22 15:07

It is understandable. But how long does it take to swap? In the example above the request is for 50 ticks and if the ticks are not loaded immediately it takes 30 seconds.

It gets worse. I give a request for 500 ticks - ticks are loaded almost instantly (I think it's only because I requested this amount earlier), and then I give a request for 5000 - four minutes have already passed, and I have just under 2000 ticks out of 5000 loaded and this number is not growing.


 
Renat Fatkhullin:

...

In the tester, the ticks are not downloaded until we complete the full integration of ticks in the Strategy Tester in the next release.

The build 1200 is out. In the tester the ticks are not downloaded, but in the tester in the Market Watch the ticks look like real ticks:

Tester. Market review.

 

Figured out how to get ticks from a certain date. It's simple: you have to specify the time in milliseconds.

//+------------------------------------------------------------------+
//|                                                CopyTicks_1_03.mq5|
//|                        Copyright 2015, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2015, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.03"
#property description "Получение тиков с определённой даты"
//--- покажем окно входных параметров при запуске скрипта
#property script_show_inputs
input int  ticks=200;  // количество запрашиваемых тиков
input datetime start=D'2015.10.16 23:59'; // с какой даты запрашивать тики
//---
MqlTick ExTicks[];
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
//--- запросим тики, время должно быть в миллисекундах!
   int copied=CopyTicks(_Symbol,ExTicks,COPY_TICKS_ALL,(ulong)start*1000,ticks);
//--- если тики получены, то выведем на график значения Bid и Ask  
   Print("Получено тиков: ",copied," код ошибки: ",GetLastError());
   if(copied>1)
     {
      Print("Из заказанных ",ticks," самый старый тик: ",ExTicks[0].time," bid: ",
            ExTicks[0].bid," ask: ",ExTicks[0].ask," last: ",ExTicks[0].last," [0]");
      Print("Из заказанных ",ticks," самый молодой тик: ",ExTicks[copied-1].time," bid: ",
            ExTicks[copied-1].bid," ask: ",ExTicks[copied-1].ask," last: ",ExTicks[copied-1].last," [",copied-1,"]");
     }
   Print("Size ",((long)copied*sizeof(MqlTick))>>20," Mb");
  }
//+------------------------------------------------------------------+
Files:
 

Bild 1200. There is an indicator attached to the chart which calls CopyTicks. Everything works. But after breaking the connection:

2015.10.26 09:58:06.721 Network '1783501': connection to MetaQuotes-Demo lost

and then when the connection is restored, CopyTicks stubbornly refuses to give back ticks. And it's either 50 ticks or 500.

 
Karputov Vladimir:

Bild 1200. There is an indicator attached to the chart which calls CopyTicks. Everything works. But after the connection is severed:

and then when the connection is restored, CopyTicks stubbornly refuses to give back ticks. And it's either 50 ticks or 500.

And if you then connect to another server? Or rescan the network and connect to the same one? Does the error remain?