CopyTicksRange () does not work correctly in MQL5. a - page 6

 
Alexey Viktorov #:

In two years you could have understood that if a function doesn't work the way you want it to, and the developers know about it and don't fix it, it's not called a bug...

Thumbs up, cool educated programmers.........

So, if you don't fix bugs in indicators you sell for three years, even though you know about it, it's not called a bug!

Good approach, should be very motivating for the public to buy your handicrafts

 
RusPro #:

INT_MAX = 2147483647


in fact, you have immediately snatched away an INT_MAX* sizeof(double) piece of memory and then work as with static

you might have written

double d[INT_MAX]; - it will be the same for you as

the only difference will be in operation of the ArraySize() function while you will get the whole reel of memory at once

You should not take everything literally, this is just an example!

"Suck up" as much as you may need!

 
prostotrader #:

You don't have to take it literally, it's an example!

"Snatch up" as much as you might need!

I didn't mean to offend in any way, sorry. It's just that in this example, the maximum possible has been grabbed:))

 
RusPro #:

results in microseconds.

No cell in my table showed a result greater than two.

 
fxsaber #:

I haven't had a single cell in the table show a result greater than two.


Did you change the code?


Move all code from OnCalculate() to OnInit(), so it only runs once. I just had no ticks in the output and OnCalculate was only called once at startup

 
RusPro #:

Move all code from OnCalculate() to OnInit() so that it only runs once

That's how it plays out. Interestingly, everything becomes fine in OnCalculate. The compiler seems to work well with repetitions.

For CopyTicks I do not see the purpose of using static.

 
MetaQuotes #:
Corrected, will be in beta today.

What's the date for today?)

 
RusPro #:

What is the date today? :)

Update onlyterminal64.exe to b3042. do not updateMetaEditor64.exe yet.

 
RusPro #:

What's the date today?)

Beta versions are posted daily on MetaQuotes-Demo, but are not always available when checking through the help menu, as we prioritise testing on our demo server.

 
int m1,min1;
datetime start,end;
MqlTick  arr_ticks[];
MqlDateTime       now1;

void OnTick()
{
   TimeTradeServer(now1);
   if(min1 != now1.min)
   {
      if(m1==0){start=TimeTradeServer();}
      m1+=1;
      if(m1==4)
      {
         end = TimeTradeServer();
         ZeroMemory(arr_ticks);
         int len1 = CopyTicksRange(_Symbol,arr_ticks,COPY_TICKS_INFO,start,end);
         Print(__FUNCTION__," start: ", start," end: ",end," len: ",len1);
         ArrayPrint(arr_ticks);
         m1=0;
      }//old 3 min
   
   
   min1 = now1.min;
   }//New Minute

}//end OnTick

The description ofCopyTicksRange () states that the operator counts time in milliseconds,

the idea came up to collect in an array Ticks in minutes, but for some reason it works: