Expert Advisors: EA_MALR

 

EA_MALR:

The Expert Advisor based on the MALR indicator. Trawl function, lot increase, averaging, reversal are available

Author: Im_ hungry

 

One of the well Written EA,In a Good order,

If Some one hungry for a well written code, just have this one,

Thanks a loooot to the Author,

I still wonder, why dont others comment on this ea. 

 
fund some error in new version of mql5 anyone please fix this
  •      ')' - expression expected
  •       'close' - invalid array access
void OnTick()
  {
   bool pos=PositionSelect(Symbol());
   if(!pos || (pos && (use_Averaging || Position_overturn)))
     {
      datetime Now_time[1];
      int coptTime=CopyTime(Symbol(),NULL,0,1,Now_time);
      if(Now_time[0]>_time && coptTime!=-1)
        {
         int type=-1;
         double propn=0,prev_lot=0;
         if((use_Averaging || Position_overturn) && pos)
           {
            prev_lot=PositionGetDouble(POSITION_VOLUME);
            type=(int)PositionGetInteger(POSITION_TYPE);
            if(type==0 && prev_open!=0) propn = prev_open-SymbolInfoDouble(Symbol(),SYMBOL_ASK);
            if(type==1 && prev_open!=0) propn = SymbolInfoDouble(Symbol(),SYMBOL_BID)-prev_open;
           }
         ArrayInitialize(high_extr,0);
         ArrayInitialize(low_extr,0);
         int cop1 = CopyBuffer(handle_MALR,3,1,2,high_extr);
         int cop2 = CopyBuffer(handle_MALR,4,1,2,low_extr);
         if(cop1==2 || cop2==2 || high_extr[0]>0 || high_extr[1]>0 || low_extr[0]>0 || low_extr[1]>0)
           {
            double close[2];
            int copy_close = CopyClose(Symbol(),NULL,1,2,close);
            if(copy_close==2)
              {
               if(high_extr[0]<=close[0] && high_extr[1]>=close[1])
                 {

                  if(Position_overturn)
                    {
                     if(type==0)
                       {
                        if(close())
                          {
                           if(!open(1,prev_lot,3)) return;
                          }
                        _time=Now_time[0];
                        return;
                       }
                     if(!use_Averaging && pos)
                       {
                        _time=Now_time[0];
                        return;
                       }
                    }
                  if(use_Averaging)
                    {
                     if(type!=-1)
                       {
                        if(type==1 && propn>=loss_forAveraging*point && propn!=0)
                           if(!open(1,prev_avlot,2)) return;
                       }
                     else if(!open(1,0,1)) return;
                     _time=Now_time[0];
                     return;
                    }
                  else
                    {
                     if(!open(1,0,1)) return;
                    }
                 }
               if(low_extr[0]>=close[0] && low_extr[1]<=close[1])
                 {
                  if(Position_overturn)
                    {
                     if(type==1)
                       {
                        if(close())
                          {
                           if(!open(0,prev_lot,3)) return;
                          }
                        _time=Now_time[0];
                        return;
                       }
                     if(!use_Averaging && pos)
                       {
                        _time=Now_time[0];
                        return;
                       }
                    }
                  if(use_Averaging)
                    {
                     if(type!=-1)
                       {
                        if(type==0 && propn>=loss_forAveraging*point && propn!=0)
                           if(!open(0,prev_avlot,2)) return;
                       }
                     else if(!open(0,0,1)) return;
                     _time=Now_time[0];
                     return;
                    }
                  else
                    {
                     if(!open(0,0,1)) return;
                    }
                 }
               _time=Now_time[0];
              }
           }
        }
      else return;
     }
 
63839348 #:
fund some error in new version of mql5 anyone please fix this
  •      ')' - expression expected
  •       'close' - invalid array access

Change close() to Close(). Make the first upper case.

Although it has another error. the unsupported filling type error.

Reason: