Experts: Auto ADX

 

Auto ADX:

An Expert Advisor based on indicator iADX (Average Directional Movement Index, ADX).


Author: Vladimir Karputov

 
Amazing Ea Try it with less volatile Pairs like NzdUsd AudCad NzdCad
 

When I try to compile the EA got two 2 errors: "INIT FAILED" - expression not boolean.

Both errors are the same.

'INIT_FAILED' - expression not boolean Auto ADX.mq5 line 279 column 20

'INIT_FAILED' - expression not boolean Auto ADX.mq5 line 285 column 17.

Where is the mistake in the code? Thank you for helping.

Hatee



 
Heinz Thieme :

When I try to compile the EA got two 2 errors: "INIT FAILED" - expression not boolean.

Both errors are the same.

'INIT_FAILED' - expression not boolean Auto ADX.mq5 line 279 column 20

'INIT_FAILED' - expression not boolean Auto ADX.mq5 line 285 column 17.

Where is the mistake in the code? Thank you for helping.

Hatee



Replace the old function with this one:

//+------------------------------------------------------------------+
//| Lots or risk in percent for a deal from a free margin |
//+------------------------------------------------------------------+
bool LotsOrRisk(const double lots,const double risk,const int digits_adjust)
  {
   if(lots<0.0 && risk<0.0)
     {
      Print(__FUNCTION__,", ERROR: Parameter (\"lots\" or \"risk\") can't be less than zero");
      return(false);
     }
   if(lots==0.0 && risk==0.0)
     {
      Print(__FUNCTION__,", ERROR: Trade is impossible: You have set \"lots\" == 0.0 and \"risk\" == 0.0");
      return(false);
     }
   if(lots>0.0 && risk>0.0)
     {
      Print(__FUNCTION__,", ERROR: Trade is impossible: You have set \"lots\" > 0.0 and \"risk\" > 0.0");
      return(false);
     }
   if(lots>0.0)
     {
      string err_text="";
      if(!CheckVolumeValue(lots,err_text))
        {
         Print(__FUNCTION__,", ERROR: ",err_text);
         return(false);
        }
     }
   else if(risk>0.0)
     {
      if(m_money!=NULL)
         delete m_money;
      m_money=new CMoneyFixedMargin;
      if(m_money!=NULL)
        {
         if(!m_money.Init(GetPointer(m_symbol),Period(),m_symbol.Point()*digits_adjust))
            return(false);
         m_money.Percent(risk);
        }
      else
        {
         Print(__FUNCTION__,", ERROR: Object CMoneyFixedMargin is NULL");
         return(false);
        }
     }
//---
   return(true);
  }
 
I get an error message when compiling an expression not logical row 1 column 1 column 1
 
mfhassan22:
I get an error message when compiling the expression no logical row 1 column 1 column 1

Here is version "1.001

Files:
Auto_ADX.mq5  46 kb