Download MetaTrader 5

Invalid ex5

To add comments, please log in or register
One billion tasks have already been executed with MQL5 Cloud Network. Test trading robots even faster!
williamwong
632
williamwong 2011.07.02 02:42 

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 

Alexey Da
Moderator
6599
Alexey Da 2011.07.04 10:09  

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.
Gabor Torma
2670
Gabor Torma 2012.06.13 20:45  

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);
  }

Alexey Da
Moderator
6599
Alexey Da 2012.06.19 10:45  

Problem was fixed. Please wait for the next build.

Stephen Njuki
5179
Stephen Njuki 2013.08.09 19:34  

Similar error from below source. Build 842.

 

         MqlDateTime _time;

         if(_is_true){
           if(_val<=MathFloor(int(_time.hour/(PeriodSeconds(_value_timeframe)/PeriodSeconds(PERIOD_H1)))))
Alain Verleyen
Moderator
30711
Alain Verleyen 2013.08.09 19:44  
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.

To add comments, please log in or register