Requote 138 - how to solve?

 
Hello guys I have my EA codes with RefreshRates as per following, but I still have requote and my EA stop sending new CloseOrder after 1 or 2 try. How to I write a code that will ask my EA to keep sending CloseOrder until it accepted by the broker server? Thanks for (int i=0; i < RepeatN; i++) { RefreshRates(); bool res = CloseOrder(OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_BID)); if (res) break; }
 

If you really want it to try until it succeeds...

bool result;

while(result == false){

   RefreshRates();

   result = OrderSend(... closing parameters...);

}
 

fwiw - could also put in a sleep, allow terminal/server cool off period between each retry...

Reason: