Tick story - page 5

 

Also. Trying to get the history from the beginning of today, I get a strange result. Here's the script:

         MqlTick array[];
         MqlDateTime sTime;
         TimeToStruct( TimeCurrent(), sTime );
         sTime.hour = 0;
         sTime.min = 0;
         sTime.sec = 0;
         datetime start = StructToTime( sTime );
         Print( "Начало текущего дня: ",start );
         int num = CopyTicks( _Symbol, array, COPY_TICKS_ALL, start, 1000000 );
         
         int size = ArraySize( array );
         Print( __FUNCTION__,": num = ",num,", arraySize = ",size );
         for( int i = 0; i < size; i++ )
                {
                 if( i == 0 )
                        {
                         Print( __FUNCTION__,": Время прихода первого доступного тика: ",array[ i ].time );
                        }
                 else if( i == size-1 )
                        {
                         Print( __FUNCTION__,": Время прихода последнего доступного тика: ",array[ i ].time );
                        }
                }

Here's the result:

HQ 0 18:38:20.974 test_CopyTicks_1178 (EURUSD,M1) Current day start: 2015.10.15 00:00:00

JM 0 18:38:22.202 test_CopyTicks_1178 (EURUSD,M1) OnStart: num = 1000000, arraySize = 1000000

CF 0 18:38:22.202 test_CopyTicks_1178 (EURUSD,M1) OnStart: First available tick arrival time: 2011.12.19 00:00:08

RD 0 18:38:22.204 test_CopyTicks_1178 (EURUSD,M1) OnStart: Last available tick arrival time: 2012.01.06 18:41:26

Apparently, it can't be written like this:CopyTicks( _Symbol, array, COPY_TICKS_ALL, start, 1000000 );

 
Tapochun:

Probably wrote it myself. Um, how do you free up previously occupied memory here?

The MqlTick array itself with 20,000,000 elements takes about 800 mb of memory. Plus storing the same original array in the terminal, where the information is accumulated and output.

So if you want to work with massive data, there is only one way out - 64-bit versions and 8 GB of memory. Fortunately, it costs ridiculous money nowadays.

 
Karputov Vladimir:
No need for tick collectors now - tick history is available in the terminal.

Will its availability depend on the goodwill of the DC or is saving ticks hardwired into the server side?

 
Renat Fatkhullin:

The MqlTick array itself with 20 000 000 elements takes about 800 mb of memory. Plus the storage of the same initial array in the terminal, where the information is accumulated and output.

So if you want to work with massive data, there is only one way out - 64-bit versions and 8 GB of memory. Fortunately, it costs ridiculous money nowadays.

What if you request it in small batches? Say 1 million ticks each? Shouldn't be a problem, right? I mean, query - processing - next query.

Or data will accumulate and the RAM will run out?

 
Alexey Volchanskiy:

Will its availability depend on the goodwill of brokerage companies or is tick history storage hardwired into the server side?

MT5 servers have always accumulated and stored tick history from the beginning.

It cannot be disabled in client terminals.

 

Forum on trading, automated trading systems and testing trading strategies

Tick history

Tapochun, 2015.10.15 15:08

Yes, it would be good to add CopyTicks() overloading just like other Copy... functions. To be able to get from date to date. Now, for example, you can't get the ticks from the beginning of the current day to the current moment.
Can it be implemented?
 
Tapochun:
Can this be implemented?
Can we do it
 
Renat Fatkhullin:
Can you
Thank you, very helpful. It's a bit hard to "navigate" getting ticks at the moment.
 

Ticks are stacked into files month by month, right? Here's a screenshot:

Tick files

And how do you read these files? Or only through a strategy tester?

 
Karputov Vladimir:

Ticks are stacked into files month by month, right? Here's a screenshot:

And how do you read these files? Or only through a strategy tester?

I can't read them directly in Notepad.