Help with EA

 

Hello!
I am writing an expert adviser and i have a problem. I am new in MQL.

void Check(double& test,double& test2, bool& UP, bool& DOWN)
{
   if( getvalue() > test ) 
   {
      CloseAll();
      OrderSend(Symbol(),OP_BUY,0.01,Ask,3,Bid-15*Point,Bid+6*Point);
      UP = true;
      DOWN = false;
      }
   if( getvalue2() < test2 ) 
   {
      CloseALL();
      OrderSend(Symbol(),OP_SELL,0.01,Bid,3,Bid-15*Point,Bid+6*Point);
      UP = false;
      DOWN = true;
   }   
}


void CloseAll()
{
  for(int i=OrdersTotal()-1;i>=0;i--)
 {
    OrderSelect(i, SELECT_BY_POS);
    bool result = false;
        if ( OrderType() == OP_BUY)  result = OrderClose( OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_BID), 5, Red );
        if ( OrderType() == OP_SELL)  result = OrderClose( OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_ASK), 5, Red );
        if ( OrderType()== OP_BUYSTOP)  result = OrderDelete( OrderTicket() );
        if ( OrderType()== OP_SELLSTOP)  result = OrderDelete( OrderTicket() );
        PlaySound("alert.wav");
 }
  return; 
}  
int start()
  {
   Check();
}

When i compile it i have 2 errors: ')' - wrong parameters count and 'CloseALL' - function is not defined

How can I solve the problems?

 

wrong parameters count

Look to your OrderSend count the parameters

int OrderSend( string symbol, int cmd, double volume, double price, int slippage, double stoploss, double takeprofit, string comment=NULL, int magic=0, datetime expiration=0, color arrow_color=CLR_NONE)

Here I count eleven

 
12345679x9:

Hello!
I am writing an expert adviser and i have a problem. I am new in MQL.

When i compile it i have 2 errors: ')' - wrong parameters count and 'CloseALL' - function is not defined

How can I solve the problems?

The problem is not in the code you have shown . . .