When is the new version of MT5 and where do you find out what's expected in it? - page 26

 

Is there a software way to determine the depth of the ticking history?

Tried this:

void OnStart()
  {
MqlTick ExTicks[];  
datetime tm=StringToTime("1971.01.01 00:00:00");
//--- вывод результата
ulong m=tm*1000; 
int copied=CopyTicks(_Symbol,ExTicks,COPY_TICKS_ALL,m);
Print("Получено тиков: ",copied," код ошибки: ",GetLastError());
 
  }

all the time gets 2,000 ticks. The help says if no time is specified, no more than 2000 ticks are transmitted. Time is specified in milliseconds and seconds are multiplied by 1000.

Also, help specifies that these are ticks for the current session. So, it turns out that historical data cannot be accessed?

 
forexman77:

Is there a software way to determine the depth of the ticking history?

Tried this:

all the time gets 2,000 ticks. The help says that if no time is specified, no more than 2000 ticks are transmitted. Time is specified in milliseconds and seconds are multiplied by 1000.

Also, help specifies that these are ticks for the current session. So, it turns out that you cannot access historical data?

Do you want to get all ticks? :)

First, check if your computer can handle so many ticks (if your computer burns out, it's not my fault):

//+------------------------------------------------------------------+
//|                                                CopyTicks_1_02.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.031"
//--- покажем окно входных параметров при запуске скрипта
#property script_show_inputs
input int  ticks=200000000000;  // количество запрашиваемых тиков
input datetime start=D'1971.01.01 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("Тик: ",ExTicks[0].time," bid: ",ExTicks[0].bid," ask: ",ExTicks[0].ask," last: ",ExTicks[0].last," [0]");
      Print("Тик: ",ExTicks[copied-1].time," bid: ",ExTicks[copied-1].bid," ask: ",ExTicks[copied-1].ask," last: ",ExTicks[copied-1].last," [",copied-1,"]");

      //datetime Start =D'2015.10.16 23:59';   // время наступления 2015 года
      //datetime End   =D'2015.10.19 00:02';   // время наступления 2015 года
      //for(int i=0;i<copied-1;i++)
      //   if(ExTicks[i].time>Start && ExTicks[i].time<End)
      //      Print("Тик: ",ExTicks[i].time," bid: ",ExTicks[i].bid," ask: ",ExTicks[i].ask," last: ",ExTicks[i].last," [i]");
     }
   Print("Size ",((long)copied*sizeof(MqlTick))>>20," Mb");
  }
//+------------------------------------------------------------------+
Files:
 
Karputov Vladimir:

Do you want to get all the tics? :)

First, check if your computer can handle that many ticks (if your computer burns out, it's not my fault):

Yes I need to know from which date there is data(i.e. from which date you can run a test on real ticks).

And how much is not a problem for the computer to query? To burn out is an exaggeration, more likely to freeze up?

 
forexman77:

Yes I need to know from which date there is data (i.e. from which date the test can be run on real ticks).

And how much is not a problem for the computer to query? You must be exaggerating, it's more likely to freeze?

Instead of "20000000000000" put "20000" and a date, any date in 1971. That said, it's very likely that you'll need to run the script more than once. The thing is that the first request will initialize all of the downloaded history (because you ordered the history since 1971), and if the script does not respond for a long time, it will give the data that are available, but the download will go further. Therefore, the second request can show a deeper history.
 
forexman77:

Is there a software way to determine the depth of the ticking history?

Tried this:

all the time gets 2,000 ticks. The help says if no time is specified, no more than 2000 ticks are transmitted. Time is specified in milliseconds and seconds are multiplied by 1000.

Also, help specifies that these are ticks for the current session. So, it turns out that you cannot access historical data?

You can not get all ticks for the symbol, if they are more than INT_MAX, because the return value

of CopyTicks function is integer. Therefore, you need to get them in parts.

 
prostotrader:

You cannot get all the ticks per character if they are greater than INT_MAX, because the return value

of the CopyTicks function is integer. Therefore you have to get them in parts.

Nevertheless, the initial date of ticks can be found out by requesting only 20000 (twenty thousand) ticks - the main thing is to specify the initial date, which guarantees, that on this date there were no ticks yet and 1971 is the best fit for it.
 
Karputov Vladimir:
Nevertheless, it is possible to find out the starting date of ticks by requesting only 20000 (twenty thousand) ticks - the main thing is to specify the starting date, which guarantees that on this date there were no ticks yet, and 1971 is the best way to do it.

Requested a lot of data, really strong braking has started:

2016.08.21 22:24:03.918 CopyTicks (EURUSD,H1)   Size 2826 Mb
2016.08.21 22:24:03.918 CopyTicks (EURUSD,H1)   Тик: 2016.05.25 16:54:25 bid: 1.11497 ask: 1.11505 last: 0.0 [56999999]
2016.08.21 22:24:03.918 CopyTicks (EURUSD,H1)   Тик: 2016.01.13 09:45:44 bid: 1.08206 ask: 1.08236 last: 0.0 [0]
2016.08.21 22:24:03.903 CopyTicks (EURUSD,H1)   Получено тиков: 57000000 код ошибки: 0

For my task, 100 ticks is enough. Thanks anyway!

2016.08.21 22:36:42.234 CopyTicks (EURUSD,H1)   Size 0 Mb
2016.08.21 22:36:42.234 CopyTicks (EURUSD,H1)   Тик: 2016.01.13 09:46:01 bid: 1.08206 ask: 1.08236 last: 1.08215 [99]
2016.08.21 22:36:42.234 CopyTicks (EURUSD,H1)   Тик: 2016.01.13 09:45:44 bid: 1.08206 ask: 1.08236 last: 0.0 [0]
2016.08.21 22:36:42.234 CopyTicks (EURUSD,H1)   Получено тиков: 100 код ошибки: 0
 
Renat Fatkhullin:
Yes, custom charts and own datafeeds will be available soon.

Hi Renat, any update about these features ? (sorry if it's somewhere else I didn't find it).

Hi Renat, any update about these features ? (sorry if it's elsewhere I haven't found it).

Reason: