Please,how put MAXORDER function in this expert ? - page 2

 
  1. You must use refreshRates between each server call and between sleep and a server call to update Ask/Bid/ordersTotal etc
  2. You are opening multiple trades in a loop but your test (10) is outside of the loop
 
u right i delete it
 
WHRoeder:
  1. You must use refreshRates between each server call and between sleep and a server call to update Ask/Bid/ordersTotal etc
  2. You are opening multiple trades in a loop but your test (10) is outside of the loop


thanks for your help,but i am not a programer.

concretly,what is the code?

 

like this,stil not working too (100 lot opened).


//+------------------------------------------------------------------+
//| EA_E-mail.mq4 |
//| triadinvest@yahoo.fr|
//| 
//+------------------------------------------------------------------+
#property copyright "triadinvest@yahoo.fr"
#property link "itriad"

//---- input parameters
extern int TimeInterval= 1; // xx minutes to send the order
extern int lotsize = 0.001;

double SumLots;

//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----
//----
return(0);
}

//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
                while(TimeInterval>0)
                {
                for(int y = OrdersTotal() - 1; y >= 0; y--)
                {
                if(OrderSelect(y, SELECT_BY_POS, MODE_TRADES))
                SumLots = SumLots + OrderLots();
                }
                if (SumLots >= 10)
                OrderSend(Symbol(), OP_BUY,lotsize,MarketInfo("EURUSD",MODE_ASK),0,1.3132,0); 
                OrderSend(Symbol(),OP_SELL,lotsize,MarketInfo("EURUSD",MODE_BID),0,1.3135,0); 

                Sleep( TimeInterval*100);//sleep in miliseconds, so use 60*1000 to change to minute 
                }
//----
return(0);
}
//+------------------------------------------------------------------+ 

-----------------------------------------------------------+

 

here we go

//+------------------------------------------------------------------+
//|                                                    EA_E-mail.mq4 |
//|                                              triadinvest@yahoo.fr|
//|                                         
//+------------------------------------------------------------------+
#property copyright "triadinvest@yahoo.fr"
#property link      "itriad"

//---- input parameters
extern int TimeInterval= 1;    // xx minutes to send the order
extern int lotsize     = 0.001;
int res = 0;
double SumLots = 0;
//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//----
    
//----
      
   
   return(0);
  }

//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()

  {
  while(TimeInterval>0 && SumLots < 10)
   {
   RefreshRates();
   res=OrderSend(Symbol(), OP_BUY,lotsize,Ask,0,0,0,NULL,0,0,Green);
   
      if(res > 0)
      {
      OrderSelect(res,SELECT_BY_TICKET,MODE_TRADES);
      SumLots = SumLots + OrderLots();
      }
      res=OrderSend(Symbol(),OP_SELL,lotsize,Bid,0,0,0,NULL,0,0,Red); 
      if(res > 0)
      {
      OrderSelect(res,SELECT_BY_TICKET,MODE_TRADES);
      SumLots = SumLots + OrderLots();
      }
       
       
       Sleep( TimeInterval*1*1000);//sleep in miliseconds, so use 60*1000 to change to minute  
   }
//----
   return(0);
  }
//+------------------------------------------------------------------+
 

but still not finished

 
qjol:

but still not finished


yes,i try it the problem stil not resolved

thanks

 
This is strategy COBRA from www.pay4pips.com
Files:
thcjcobraev3.zip  1500 kb
Reason: