Оператор "return"

Back to topics list To post a new topic, please log in or register
avatar
1
i_maikl 2016.02.13 12:50
 

<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()
  }
//--------------------------------------------------------------------


avatar
Moderator
3404
GumRai 2016.02.13 13:25 #
 
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

Back to topics list  

To add comments, please log in or register