Will the EA crash ? - page 2

 
Lorentzos Roussos #:

is there an extra 8 byte member in it not documented? 

No.

4 doules + 2 long + 1 datetime + 1 int = 7*8 + 4 = 60

struct MqlTick
  {
   datetime     time;          // Time of the last prices update
   double       bid;           // Current Bid price
   double       ask;           // Current Ask price
   double       last;          // Price of the last deal (Last)
   ulong        volume;        // Volume for the current Last price
   long         time_msc;      // Time of a price last update in milliseconds
   uint         flags;         // Tick flags
   double       volume_real;   // Volume for the current Last price with greater accuracy
  };

Try it if you are not good in mental arithmetic :
   int tickStructureSize=sizeof(MqlTick);
 
Lorentzos Roussos #:

It makes a "poke" pass at first going back month by month requesting just one tick.

Then it finds the earliest tick and requests everything . 

Ah yes, I see.

    int all_ticks=CopyTicks(_Symbol,receiver,COPY_TICKS_ALL,oldest,-1);
Why -1 ?
 
Alain Verleyen #:

Ah yes, I see.

Why -1 ?

For all 

 
Lorentzos Roussos #:

For all 

The documentation said 0, and it works. You should better stick with it.
 
Alain Verleyen #:
The documentation said 0, and it works. You should better stick with it.

Okay , will do . 

 
Alain Verleyen #:

That's the ticks data files, yes.

So when you use CopyTicks() and there is no data they will be download. If the data files are present they will be loaded in memory. That's what I am calling the cached data. They will remain in memory for 30 minutes (unless you used them of course).

I just tried to download a lot of ticks at once with CopyTIcksRange() and I got an error 4004 (as documented).

ERR_NOT_ENOUGH_MEMORY

4004

Not enough memory to perform the system function

Ok, so I just checked, if you have some memory limit reached, you need to do it by chunks. The cache will then be invalidated (and not accumulated), so you can process all ticks history, step by step.
 
Alain Verleyen #:
Ok, so I just checked, if you have some memory limit reached, you need to do it by chunks. The cache will then be invalidated (and not accumulated), so you can process all ticks history, step by step.

so i'm getting the error and "i can't see it" because i do it all in one go. (and because i'm not checking)