Errors, bugs, questions - page 1885

 
Why EX5 such code
void OnStart() {}

weighs 5Kb?

 
fxsaber:
Why EX5 such code

weighs 5Kb?

Decompile protection?
 
fxsaber:
Localized the bug on Metaquotes-Demo

The script goes into deep thought.

Reproducible.

Probably because the tick chart of this tool is "waiting for update".

When the script stops, put -1 in the log is displayed, i.e. it does not hang tight, but waits for the terminal to respond.

 
fxsaber:
Localized the bug on Metaquotes-Demo

The script goes into deep thought.

Everything works correctly (according to documentation):
In Expert Advisors and scripts CopyTicks() can wait up to 45 seconds for the result: Unlike the indicator, each expert and script works in its own thread, and therefore can wait up to 45 seconds for the completion of synchronization. If during this time, the ticks won't be synchronized in the necessary volume, CopyTicks() will return only available ticks by timeout, and synchronization will continue.
2017.05.11 14:41:31.154 Scripts script test_bug (EURUSD,M1) loaded successfully
2017.05.11 14:42:14.742 Scripts script test_bug (EURUSD,M1) removed

 

The long wait for copyticks will be fixed - this shows up on dead characters that haven't had ticks for a long time.

It will work instantly

 
Renat Fatkhullin:

The long wait for copyticks will be fixed - this shows up on dead characters that haven't had ticks for a long time.

It will work out instantly.

What time costs should be considered as normal?

Checked SymbolInfoTick (96 characters).

#define _CS(A) ((!IsStopped()) && (A))
#define  TOSTRING(A) #A + " = " + (string)(A)

void OnStart()
{
  ulong MaxInterval = 0;
  MqlTick Tick;
  
  while (_CS(true))
  {
    const ulong StartTime = GetMicrosecondCount();
    
    for (int i = SymbolsTotal(true) - 1; _CS(i >= 0); i--)
      SymbolInfoTick(SymbolName(i, true), Tick);

    const ulong Interval = GetMicrosecondCount() - StartTime;              
    
    if (Interval > MaxInterval)
    {
      MaxInterval = Interval;
      
      Print(TOSTRING(MaxInterval));
    }
  }
}

Got

MaxInterval = 7631

Normal?

 
fxsaber:

Which time costs should be considered as the norm?

Checked SymbolInfoTick (96 characters)

Got it

Norm?

45 seconds per dead instrument.
 
Andrey Khatimlianskii:
45 seconds per dead instrument.
Only the live ones are of interest. One by one 100 pieces.
 

Is this even normal?

The same value is returned for different situations.

I understand that I need to check, but things happen...

positions

result printout


Files:
posi.mq5  2 kb
 
Alexandr Bryzgalov:

Is this even normal?

The same value is returned for different situations.

I understand that I need to check, but things happen...

positions

result printout



And what is the question?

Where can you see that under the number "i" there is a position with such-and-such ticket, for such-and-such symbol? In general, in addition to simply display the serial number, output also the ticket and symbol.


Reason: