Errors, bugs, questions - page 2324

 

1. why the "apps" section? in a nutshell. i don't get it.

2. where is the servicedesk section? i want them to send someone to this thread:

https://www.mql5.com/ru/forum/290284

thanks

 
The chart starts shifting again, as when the "Home" button is pressed - no pattern detected, no problem for about half a year and now it's back... build 1940.
 
A pointer bug
class A {};

void OnStart()
{
  A* a = NULL;
  
  if (true && a) // '&&' - illegal operation use
    ;
    
  if (a) // OK
    ;
}
 
Vladimir Pastushak:

Is this normal function behaviour ? If so, how can the time be reduced ? The history has been preloaded

Result :

ARSA symbol 16 544 647

AVAN 16 506 592

AVAZ symbol 16 553 408

AVAZP 16 511 019

Symbol ASSB 16 521 310


This behaviour appears on CFD


Behavior appears on all

Here is the script, it takes 16 seconds to request the price, at this point the program hangs on the spot...

void OnStart()
  {
   int     all_symbols = SymbolsTotal(false);
   string  sym_name    = "";
   MqlRates   mas[];
   Print("Symbols all ",all_symbols);
   ulong time_=GetMicrosecondCount();
   
   for(int i=0;i<all_symbols;i++)
      if((sym_name=SymbolName(i,false))!="")
        {
         SymbolSelect(sym_name,true);
         ArrayResize(mas,i+1,100000);

         time_=GetMicrosecondCount();

         CopyRates(sym_name,PERIOD_D1,0,1,mas);

         Print("Copy   N ",(i+1)," Name ",sym_name," time = ",(GetMicrosecondCount()-time_));

        }

   for(int i=0;i<all_symbols;i++)
      if((sym_name=SymbolName(i,false))!="")
        {
         SymbolSelect(sym_name,true);
         ArrayResize(mas,i+1,100000);

         time_=GetMicrosecondCount();

         double rez = iOpen(sym_name,PERIOD_D1,0);

         Print("iOpen   N ",(i+1)," Name ",sym_name," time = ",(GetMicrosecondCount()-time_));

        }
  }

Here is a partial log

DJ 0 12:18:33.507 TestCopy (EURUSD,H1) Copy N 63 Name SGDJPY time = 46076

OP 0 12:18:33.552 TestCopy (EURUSD,H1) Copy N 64 Name USDEUR_BASKET time = 44995

IG 0 12:18:33.597 TestCopy (EURUSD,H1) Copy N 65 Name EURRUB_TOD time = 44863

LI 0 12:18:33.642 TestCopy (EURUSD,H1) Copy N 66 Name EURRUB_TOM time = 45040

GS 0 12:18:33.698 TestCopy (EURUSD,H1) Copy N 67 Name USDRUB_TOD time = 56006

CF 0 12:18:33.743 TestCopy (EURUSD,H1) Copy N 68 Name USDRUB_TOM time = 44925

CI 0 12:18:33.787 TestCopy (EURUSD,H1) Copy N 69 Name CNYRUB_TOD time = 44820

ES 0 12:18:33.833 TestCopy (EURUSD,H1) Copy N 70 Name CNYRUB_TOM time = 45086

CF 0 12:18:50.336 TestCopy (EURUSD,H1) Copy N 71 Name ABRD time = 16503669

KL 0 12:19:06.836 TestCopy (EURUSD,H1) Copy N 72 Name AESL time = 16499892

FF 0 12:19:06.881 TestCopy (EURUSD,H1) Copy N 73 Name AFKS time = 44842

CH 0 12:19:06.926 TestCopy (EURUSD,H1) Copy N 74 Name AFLT time = 44963

DP 0 12:19:23.429 TestCopy (EURUSD,H1) Copy N 75 Name AKRN time = 16502943

CG 0 12:19:39.929 TestCopy (EURUSD,H1) Copy N 76 Name ALBK time = 16499755

RL 0 12:19:56.433 TestCopy (EURUSD,H1) Copy N 77 Name ALNU time = 16503651

EG 0 12:19:56.478 TestCopy (EURUSD,H1) Copy N 78 Name ALRS time = 44989

OK 0 12:20:12.978 TestCopy (EURUSD,H1) Copy N 79 Name AMEZ time = 16500788

QS 0 12:20:13.034 TestCopy (EURUSD,H1) Copy N 80 Name APTK time = 55954

GF 0 12:20:29.541 TestCopy (EURUSD,H1) Copy N 81 Name ARMD time = 16506946

HM 0 12:20:46.051 TestCopy (EURUSD,H1) Copy N 82 Name ARSA time = 16509620

DD 0 12:21:02.553 TestCopy (EURUSD,H1) Copy N 83 Name ASSB time = 16501809

GK 0 12:21:19.083 TestCopy (EURUSD,H1) Copy N 84 Name AVAN time = 16529765

HP 0 12:21:35.586 TestCopy (EURUSD,H1) Copy N 85 Name AVAZ time = 16502812

HK 0 12:21:52.085 TestCopy (EURUSD,H1) Copy N 86 Name AVAZP time = 16499796

NO 0 12:21:52.130 TestCopy (EURUSD,H1) Copy N 87 Name BANE time = 44973


Full log at the bottom.

Files:
20181120.log  196 kb
 
fxsaber:
A pointer bug

What's the difference?

Forum on trading, automated trading systems and trading strategy testing

Bugs, bugs, questions

fxsaber, 2018.09.17 14:17

Is it a bug?
class A {};

A* a = NULL;

bool b1 = a && true; // OK
bool b2 = true && a; // '&&' - illegal operation use

 
A100:

What's the difference with that?

I have a very bad memory. Some "bicycles" I reinvent several times over.

 
I think there is a reason for this error, because (if there were a free implicit pointer conversion to bool) it is not clear how to interpret
class A {
public:
        bool operator&&( bool a ) { return a; }
};
void OnStart()
{
        A *a, *b;
        if (a && b);
}

whether or not

        if ((bool)a &&(bool)b);       //(1)

or as

        if ((*a).operator&&((bool)b));//(2)
 
A100:
I think this error is there for a reason, because (if there were free implicit pointer conversion to bool) it's not clear how to interpret

Yes, there is ambiguity in your case. In a good way, there should be at least a compiler warning for this kind of thing.

In my case, which is much simpler, everything is clear. I think C++ agrees with that too.

 

fxsaber:
Это баг?

class A {};

A* a = NULL;

bool b1 = a && true; // OK
bool b2 = true && a; // '&&' - illegal operation use

As a temporary solution, use the operator '!' (logical not)

class A {};

A* a = NULL;

bool b1 = !!a && true;
bool b2 = true && !!a;


We'll think about the solution (can we change the behaviour now, when there is a lot of code?)
It's possible that for a pointer, a bool conversion operation would be an operation on the pointer and not on the object it points to.

In this case, to perform the operation on the object, we will need to write the code like this

class A {};

A* a = NULL;

bool b1 = *a && true;
bool b2 = true && *a;

The conversion operators, too, we want to add, but this task is (very) low priority
 
Ilyas:

As a temporary solution, use the operator '!' (logical not)

Does the compiler optimise the double negation?