Download MetaTrader 5

Getting errors but don't know where to correct, please help! - page 2

To add comments, please log in or register
ffoorr
1097
ffoorr  

This part will be an endless loop, no ?

while(true)                                  // Cycle that opens an order    
{     
int ticket1=OrderSend(Symbol(), OP_BUY, Lot, Ask, 2, SL, TP);
int ticket2=OrderSend(Symbol(), OP_SELL, Lot, Bid, 2, SL, TP);    
Alert (GetLastError()); 
Alert(Symbol(),"  Sell = ",AccountFreeMargin()// At selling       
  -AccountFreeMarginCheck(Symbol(),OP_SELL,1)); 
   Alert(Symbol(),"  Buy = ",AccountFreeMargin() // At buying       
  -AccountFreeMarginCheck(Symbol(),OP_BUY,1));  
  return(true);
  }
Keith Watford
Moderator
10651
Keith Watford  
ffoorr:

This part will be an endless loop, no ?

I don't think so.

there are no conditions for the return so all code after the return will not be executed 

12
To add comments, please log in or register