My EA is not expert and cannot be executed

 

Hi.

After last update build 1147 of MT4 , I want to make some modification to my EA and as you see bellow everything is OK after compiling the EA but when I try to drag it to the chart I got this message "the EA is not expert and cannot be executed"

Could you help me to know what happen with the last update.?????


This is bellow the result after compiling!!!!

'Golden Core V1.08.mq4' Golden Core V1.08.mq4

0 error(s), 0 warning(s), compile time: 373 msec


Regards

Osama

 
Maybe it is an indicator?
 

Hi Osana

That's right, some of function orders are changed. 

 
Keith Watford:
Maybe it is an indicator?

Of course not it is EA and was working for more than a year

 
Shahrokh Firouzi:

Hi Osana

That's right, some of function orders are changed. 

Nice tell we found some one from Meta Quote reply us and explain what changes we back to build 1601

Regards

 
Shahrokh Firouzi:

Hi Osana

That's right, some of function orders are changed. 

What do you mean ?
 
Osama Hussein:

Hi.

After last update build 1147 of MT4 , I want to make some modification to my EA and as you see bellow everything is OK after compiling the EA but when I try to drag it to the chart I got this message "the EA is not expert and cannot be executed"

Could you help me to know what happen with the last update.?????


This is bellow the result after compiling!!!!

'Golden Core V1.08.mq4' Golden Core V1.08.mq4

0 error(s), 0 warning(s), compile time: 373 msec


Regards

Osama

Don't use a function OnStart() or start().
 
Osama Hussein: After last update build 1147 of MT4 , I want to make some modification to my EA and as you see bellow everything is OK after compiling the EA but when I try to drag it to the chart I got this message "the EA is not expert and cannot be executed"

Could you help me to know what happen with the last update.?????

Forum on trading, automated trading systems and testing trading strategies

MetaTrader 4 platform beta build 1145

Fernando Carreiro, 2018.11.17 16:39

Probably the very old style event handlers init(), deinit() and start() are now considered obsolete and no longer supported.

If that is the case, you will have to update to the MQL4+ version of using OnInit(), OnDeinit() and OnTick() which have been the standard for many years now.

 
Fernando Carreiro:

Hello,

I do as you said and I change all old style to be as you mentioned and compile it with zero errors and when I attach to the chart I got the same message 

This is bellow the result after compiling!!!!

'Super Rock V3.mq4' Super Rock V3.mq4

'stdlib.mqh' stdlib.mqh

'stderror.mqh' stderror.mqh

0 error(s), 0 warning(s), compile time: 498 msec


here the new version as your advice

void OnStart()

  {

   if(MarketInfo(Symbol(),MODE_DIGITS)==4 || MarketInfo(Symbol(),MODE_DIGITS)==2)

     {

      slippage=user_slippage;

     }

   else if(MarketInfo(Symbol(),MODE_DIGITS)==5 || MarketInfo(Symbol(),MODE_DIGITS)==3)

     {

      slippage=10*user_slippage;

     }


   if(IsTradeAllowed()==false)

     {

      Comment("Copyright © 2020, www.golden4xeg.blogspot.com\nTrade not allowed.");

  //    return;

     }


// Updating current status

   if(ShowTitle)

     {

      Display_Title();

     }

   if(ShowTradeComment)

     {

      Display_Info();

     }

   if(ShowStats)

     {

      DrawStats();

     }

   InitVars();

   UpdateVars();

   SortByLots();

   ShowData();

   ShowLines();

   Robot();

//   return;

  }


 
Alain Verleyen:
Don't use a function OnStart() or start().

Ok what i have to use instead ? which function I have to replace ?

 
Osama Hussein:

Ok what i have to use instead ? which function I have to replace ?

OnStart() is for scripts

OnTick() is for EAs

Reason: