Please Help For Error 138 - ERR_REQUOTE. No useful answer were found.

Back to topics list To post a new topic, please log in or register
avatar
2
sohail 2016.01.07 21:24
 

Here is the code:

if(OrderSelect(ticket,SELECT_BY_TICKET) == true)
      {      
         if(position == IN_SELL){
            double avg = get_average();
            if(value <= avg){
               RefreshRates();
               if(OrderClose(OrderTicket(),OrderLots(),Bid,3,Red) == true)
                  position = NULL;
               else
                  Alert("ERR for selllllll: " , GetLastError());   
            }   
         }
         if(position ==IN_BUY){
            double avg = get_average();
            if(value >= avg){
               RefreshRates();
               if(OrderClose(OrderTicket(),OrderLots(),Ask,3,Red) == true)
                  position = NULL;
               else
               Alert("ERR for buyyyyy: " , GetLastError());      
            }   
         }
      }

Here is the result in testing:

Result


 

avatar
Moderator
3418
GumRai 2016.01.08 00:18 #
 

Close a Buy at Bid and a Sell at Ask

or use

  OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),3,Red)

 for either

avatar
2
sohail 2016.01.08 08:41 #
 

Opss .. ! Fixed.

Thanks. 

Back to topics list  

To add comments, please log in or register