How do Open tried2 after tried1

To add comments, please log in or register
Naqibjan
69
Naqibjan  

Hi everyone,

i want gave 10 tried or more but all is open

tried1 0.01 lot

tried2 0.02 lot

tried3 0.03 lot

tried4 0.04 lot

tried5 ...

for this cod open all order in Pendbuy() in 1 price. i don't want this.

//+------------------------------------------------------------------+
//|                                                                  |
//|                             "Ghobar"                             |
//|                                                                  |
//+------------------------------------------------------------------+

extern int Magic1=1;
extern int Magic2=2;
extern double lot1=0.1;
extern double lot2=0.2;
extern double lot3=0.3;
extern double lot4=0.4;
extern double lot5=0.5;
extern double lot6=0.6;
extern double lot7=0.7;
extern double lot8=0.8;
extern double lot9=0.9;
extern int slippage=6;
extern int stoploss=44440;
extern int takeprofit=55550;
extern bool EnableAlert=true;
extern double  timeclose=1;

//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
 
if(Volume[0]<=1)
{
 if(Orders()==0)
 {
  if(CandleStatus()=="buy")
  {
   Pendbuy();
   closeOrder();
   }
  if(CandleStatus()=="sell")
  {
 //  Pendsell();
   closeOrder();

     }
 
  }


 }
   return(0);
  }
//+------------------------------------------------------------------+
int Orders()
{
int num=0;

 for(int i=OrdersTotal()-1;i>=0;i--)
 {
 OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
 
 if(OrderMagicNumber()==Magic1 || OrderMagicNumber()==Magic2)
  
  num++;
  
  }
return(num);
}
//--------------------------------------------------------------------
string CandleStatus()
{
if(Close[1]>=Open[1])

return("buy");

else

if(Close[1]<Open[1])

return("sell");
}
//---------------------------------------------------------------------
void Pendbuy()
{
OrderSend(Symbol(),OP_BUY,lot1,Ask,slippage,Ask-stoploss*MathPow(10,-Digits)
,Ask+takeprofit*MathPow(10,-Digits),"Ghobar",Magic1,0,Blue);

OrderSend(Symbol(),OP_BUY,lot2,Ask,slippage,Ask-stoploss*MathPow(10,-Digits)
,Ask+takeprofit*MathPow(10,-Digits),"Ghobar",Magic1,0,Blue);

OrderSend(Symbol(),OP_BUY,lot3,Ask,slippage,Ask-stoploss*MathPow(10,-Digits)
,Ask+takeprofit*MathPow(10,-Digits),"Ghobar",Magic1,0,Blue);


}
//---------------------------------------------------------------------
//void Pendsell()
//{
//
//int ticket=OrderSend(Symbol(),OP_SELL,lot1,Bid,slippage,Bid+stoploss*MathPow(10,-Digits)
//,Bid-takeprofit*MathPow(10,-Digits),"Ghobar",Magic2,0,Red);
//
// if(EnableAlert==true)
// {
//  if(ticket>0)
//  Alert("Sell Signal");
//  
//  }
//}
//
//---------------------------------------------------------------------

 

can you help me and repair  for this cod.

tanks for all.

To add comments, please log in or register