Invalid ex5

 

I was trying to report this in service request but it failed to save:

Client Terminal Build and Version (32 or 64 bit)

Build 470

Problem description

No compilation error but I when I tried to load my expert:

expert xxx (EURUSD H1) loaded succcessfully

initializing of xxx (EURUSD H1) failed 

expert xxx (EURUSD H1) removed

When I looked at Expert tab, it says invalid ex5.

Where should I start looking for the problem?

Moreover, when I ran debugger, the terminal just disappeared, I have to restart terminal 

 

It is very strange behavior. Could you attach logs of terminal and experts, source file of your expert and ex5 file.

You can write a private message to me. All sources will be deleted after solving your problem.

Also it would be helpful if you could specify exact date and time when you tried to write to servicedesk. We will try to solve this problem too. 

Get in touch with developers using Service Desk!
  • www.mql5.com
We therefore attach great importance to all user reports about issues in our programs and try to answer each one of them.
 

I get the Invalid EX5 error message, but I can resolve.
The problem is the implicit variable conversion double to bool. MT 5.00.b642 x64

Here is the sample code:
class CErrorClass
  {
public: double DblFunc(int i)
     {
      return(i);
     }
public: bool Error(void)
     {
      return(DblFunc(1));
     }
  };

CErrorClass ErrorClass;

int OnInit()
  {
   Print(ErrorClass.Error());
   return(0);

  }

and the solution:

class CErrorClass
  {
public: double DblFunc(int i)
     {
      return(i);
     }
public: bool Error(void)
     {
      return(int(DblFunc(1)));
     }
  };

CErrorClass ErrorClass;

int OnInit()
  {
   Print(ErrorClass.Error());
   return(0);
  }

Files:
 

Problem was fixed. Please wait for the next build.

 

Similar error from below source. Build 842.

 

         MqlDateTime _time;

         if(_is_true){
           if(_val<=MathFloor(int(_time.hour/(PeriodSeconds(_value_timeframe)/PeriodSeconds(PERIOD_H1)))))
 
ssn:

Similar error from below source. Build 842.

 

Can you provide code that compiles to demonstrate your issue ? Thanks.

MathFloor takes a double as argument, so it's pointless in your code.

Reason: