Download MetaTrader 5

Оператор "return"

To add comments, please log in or register
Михаил
5
Михаил  

<Russian Content deleted>

 1. return value of 'OrderSend' should be checked 1.mq4 4 4

                           2.  function must return a value                         1.mq4 5 4

                           0 error(s), 2 warning(s), compile time: 967 msec


//--------------------------------------------------------------------
int start()                                  // Special function start()
  {                                          // Opening BUY
   OrderSend(Symbol(),OP_BUY,0.1,Ask,3,Bid-15*Point,Bid+15*Point);
   return; // Exit start()
  }
//--------------------------------------------------------------------


Keith Watford
Moderator
9641
Keith Watford  
int start()                                  // Special function start()
  {                                          // Opening BUY
   OrderSend(Symbol(),OP_BUY,0.1,Ask,3,Bid-15*Point,Bid+15*Point);
   return(0); // Exit start()
  }

Next time, please post on the Russian language forum


OrderSend returns -1 if it is not successful, you should code to check the error if this happends

To add comments, please log in or register