Tick story - page 18

 
Alexander:

Is it playing now ?

We don't have it, we tried according to your description.

After the "treatment":

Forum on trading, automated trading systems and trading strategy testing

Tick history

Karputov Vladimir, 2015.10.21 09:24

...

I am now testing the "cure" - I will completely delete the histories from the "history" and "ticks" folders of the MetaQuotes-Demo server.


The 500 ticks depth history is given out almost instantly, with the overall bar history being swapped. The size of ticks files is 200-400 Kb for 10 months.

 

And I wanted to get ticks in the tester, it gives out whatever it is :)

void OnTick()
  {
//---
 MqlTick ExTicks[];
 CopyTicks(_Symbol,ExTicks,COPY_TICKS_ALL,D'2015.10.16 23:59',1);

 

See how ticks work in the 1194 build, where milliseconds and flags have been added.

In the tester, ticks are not given until we complete the full integration of ticks into the trading strategies tester in the next release.

 
MetaTrader 5 build 1194 started (MetaQuotes Software Corp.)
Windows 10 Home (X86 based PC), IE 11.00, UAC, Intel Atom  Z3740 @ 1.33GHz, RAM: 218 / 1931 Mb, HDD: 20039 / 50235 Mb, GMT+02:00
authorized on MetaQuotes-Demo through Access Point EU (ping: 139.57 ms)

Testing the tick paging when the internet connection is disconnected. The test indicator below:

//+------------------------------------------------------------------+
//|                                                         test.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.1"
#property indicator_chart_window
#property indicator_plots 0
//--- input parameter
input int   InpShowTicks=50;    // клубина истории тиков
//--- parameters
MqlTick     arr_mql_tick[];      // массив структур хранящий тики
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int OnInit()
  {
   Print(__FUNCTION__);
   Comment("");
   ResetLastError();
//--- новый размер массива структур тиков
   if(ArrayResize(arr_mql_tick,InpShowTicks)==-1)
     {
      Print("Error OnInit #1",GetLastError());
      return(INIT_FAILED);
     }
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
   static int count;
   string text  =IntegerToString(count)+"; ";
   int copied=CopyTicks(_Symbol,arr_mql_tick,COPY_TICKS_INFO,0,InpShowTicks);
   text+="Запрошено "+IntegerToString(InpShowTicks)+" тиков, скачано "+IntegerToString(copied);
   Comment(text);
   count++;
   return(rates_total);
  }
//+------------------------------------------------------------------+

The algorithm is as follows:

Start the indicator. Wait until the number of downloaded ticks is equal to the requested amount.

Disconnect from the Internet (terminal should be beep). At the same time:

  1. test #1, "count" =40,
  2. test #2, "count" =47,
  3. test #3, "count" =12.

Switch on internet.

The indicator tries to download ticks, with a request for 50, but 21-23 are downloaded. This lasts until "count" is greater than 100.

Repeatability is good, checked more than three times.

Files:
test.mq5  3 kb
 
Karputov Vladimir:

Testing tick paging when the internet connection is broken. The tested indicator is below:


Keep in mind that ticks request in the indicator works slightly differently than ticks request in the Expert Advisor.

The indicator does not have the right to brake, so the indicator is given the available number of ticks for the request at once.

The Expert Advisor works in its own flow, so it can wait a little. For the Expert Advisor several attempts are made to swap ticks per request.

 
Slawa:

Keep in mind that tick requests in an indicator work slightly differently than tick requests in an Expert Advisor.

The indicator does not have the right to brake, so the indicator is given the available number of ticks for the request at once.

Expert Advisor is working in its own thread, so it can wait a bit. Several attempts are made for the Expert Advisor to swap ticks per query.

This is understandable. But how long does it take to pile up? In the example above, the request is for 50 ticks. If there are no ticks to be loaded immediately, it will take 30 seconds.

It gets worse. I give a request for 500 ticks - the ticks are replenished almost instantly (I think it is only because I requested this amount earlier) and then I give a request for 5000 ticks - four minutes have already passed, but only 2000 ticks out of 5000 have been loaded and the amount does not increase.

 
Renat Fatkhullin:

See how ticks work in the 1194 build, where milliseconds and flags have been added.

In the tester, ticks are not given until we complete the full integration of ticks into the trading strategies tester in the next release.

Will there be similar changes for MT4?
 

Checked it on another computer in the evening:

MetaTrader 5 x64 build 1194 started (MetaQuotes Software Corp.)
Windows 10 Pro (x64 based PC), IE 11.00, UAC, Intel Core i3-3120 M  @ 2.50 GHz, RAM: 1129 / 3981 Mb, HDD: 75614 / 234136 Mb, GMT+02:00
authorized on MetaQuotes-Demo through Access Point EU2 (ping: 59.54 ms)

Preloaded 200000000 ticks with a script - ticks loaded in about 6 seconds. I could not see any difference:

Forum on trading, automated trading systems and testing trading strategies

Tick history

Karputov Vladimir, 2015.10.22 15:07

... I give a request for 500 ticks - ticks are loaded almost instantly (I think it's only due to the fact that I previously asked for such a number), and then I give a request for 5000 - four minutes have passed, and just under 2000 of 5000 are loaded and this number does not grow.

 
Not in MT4, unfortunately.
 
MetaTrader 5 build 1196 started (MetaQuotes Software Corp.)
authorized on MetaQuotes-Demo through Access Point EU1 (ping: 296.87 ms)

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

1

- what does this value mean?

Files: