My EA TestGenerators: unmatched data error

 

Hi there,

I created an EA based on 4 custom indicators: Braind Trend1Sig1, sidus v.2, Support and Resistance(Barry) and FX Snipers T3 CCI.

The code (MQL4) is as below,

If anyone could point me in the right direction, that'd be lovely.

Thank you. 

//+------------------------------------------------------------------+
//|                                                     cobadeh4.mq4 |
//|                                          Copyright 2013, drcompt |
//|                                      http://drcompt.blogspot.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2013, drcompt"
#property link      "http://drcompt.blogspot.com"

extern string  Nama_EA                 = "cobadeh4";
extern int     TP                      = 10;
extern int     SL                      = 50;
extern double  lot                     = 0.1;
extern int     Magic                   = 140781;
double         slb,tpb,sls,tps,pt;


int init()
{
//----
if(Digits==3 || Digits==5) pt=10*Point;   else   pt=Point;
//----
 return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
{ 
//-------------------------------------------------------------------+
//-------------------------------------------------------------------+
if(OrdersTotal()>0){
  for(int u=1; u<=OrdersTotal(); u++)         
     {
      if (OrderSelect(u-1,SELECT_BY_POS)==true)
        {
          if(OrderMagicNumber()==Magic&&OrderSymbol()==Symbol()) {int halt1=1;}
 
        }
     }
double a = iCustom(Symbol(),0,"Braind Trend1Sig1",500,0,0,0,0);
double b = iCustom(Symbol(),0,"Braind Trend1Sig1",500,0,0,1,0);
double c = iCustom(Symbol(),0,"sidus v.2",14,21,17,false,0,0);
double d = iCustom(Symbol(),0,"sidus v.2",14,21,17,false,1,0);
double e = iCustom(Symbol(),0,"Support and Resistance (Barry)",0,0);
double f = iCustom(Symbol(),0,"Support and Resistance (Barry)",1,0);
double g = iCustom(Symbol(),0,"FX Snipers T3 CCI",14,5,0.618,0,0);
int signal;
   if(Ask>b || Ask>d || Ask>e && g>0) signal=1;
   if(Bid<a || Bid<c || Bid<f && g<0) signal=2;
   if(SL==0)slb=0;else slb=Ask-SL*pt;
   if(SL==0)sls=0;else sls=Bid+SL*pt;
   if(TP==0)tpb=0;else tpb=Ask+TP*pt;
   if(TP==0)tps=0;else tps=Bid-TP*pt;
   if(OrdersTotal()==0 && signal==1) {OrderSend(Symbol(),OP_BUY,(lot),Ask,3,slb, tpb,"cobadeh4",Magic,0,Yellow);}
   if(OrdersTotal()==0 && signal==2) {OrderSend(Symbol(),OP_SELL,(lot),Bid,3,sls, tps,"cobadeh4",Magic,0,White);}
 }
//-----------------------------------------------------------------------------------------------------
if(OrdersTotal()>0)
{
  for(u=1; u<=OrdersTotal(); u++)
  {         
        if (OrderSelect(u-1,SELECT_BY_POS)==true)
        {
              // Menghitung take profit
                double tpb=NormalizeDouble(OrderOpenPrice()+TP*Point,Digits);
                double tps=NormalizeDouble(OrderOpenPrice()-TP*Point,Digits);
               // Menghitung stop loss
                double slb=NormalizeDouble(OrderOpenPrice()-SL*Point,Digits);
                double sls=NormalizeDouble(OrderOpenPrice()+SL*Point,Digits);
       
          if((OrderMagicNumber()==Magic&&OrderType()==OP_BUY)&&(OrderTakeProfit()==0||OrderStopLoss()==0)&&OrderSymbol()==Symbol()) { OrderModify(OrderTicket(),0,slb,tpb,0,CLR_NONE); }
          if((OrderMagicNumber()==Magic&&OrderType()==OP_SELL)&&(OrderTakeProfit()==0||OrderStopLoss()==0)&&OrderSymbol()==Symbol()) { OrderModify(OrderTicket(),0,sls,tps,0,CLR_NONE); }
 }}}}
       

//-------------------------------------------------------------------+

        if(OrderSelect(OrdersHistoryTotal()-1,SELECT_BY_POS,MODE_HISTORY))
      
         
          if (CurTime()<OrderCloseTime()+30*60) return(0);
               
//-------------------------------------------------------------------
   return(0);
 
//+----------------------End-------------
Files:
cobadeh4.mq4  5 kb
 
mukh47:

Hi there,

I created an EA based on 4 custom indicators: Braind Trend1Sig1, sidus v.2, Support and Resistance(Barry) and FX Snipers T3 CCI.

The code (MQL4) is as below

If anyone could point me in the right direction, that'd be lovely.

Thank you. 

<CODE DELETED>

Please read some other posts before posting . . .

Please edit your post . . .    please use the   SRC   button to post code: How to use the   SRC   button. 

 
mukh47:

Hi there,

I created an EA based on 4 custom indicators: Braind Trend1Sig1, sidus v.2, Support and Resistance(Barry) and FX Snipers T3 CCI.


Read this thread:  https://www.mql5.com/en/forum/110327
Reason: