Handling Requotes

 

On Live account, I have found that certain brokers give requotes, when that happens the trade is not opened. I have done a search to find how to deal with this problem.

One suggestion was to put in a value for slippage=5 or large. However this does not seem to work, the trade still not opened.

Another suggestion was to use a loop to retry the OrderSend a number of times.

I would like to find out if there are other ideas to deal with the requote problem.

Thanks

 

hi

qq1:
On Live account, I have found that certain brokers give requotes, when that happens the trade is not opened. I have done a search to find how to deal with this problem.

One suggestion was to put in a value for slippage=5 or large. However this does not seem to work, the trade still not opened.

Another suggestion was to use a loop to retry the OrderSend a number of times.

I would like to find out if there are other ideas to deal with the requote problem.

Thanks

Did u mean after you click OK on requote form there's nothing happen ?

I think the problem lies in their server side ..just give them complaint about this ..

===================

Forex Indicators Collection

 
prasxz:
Did u mean after you click OK on requote form there's nothing happen ?

I think the problem lies in their server side ..just give them complaint about this ..

===================

Forex Indicators Collection

No, I mean how to handle requote in MQ4.

EA tried to open trade with OrderSend but due to requote the trade is not opened.

 

Here is a good order send function that handles errors.... set the O_ variables and call SendOrder();

void SendOrder(){

int ticket=0;

int err=0;

int c = 0;

int Attempts = 100;

for(c = Attempts ; c >= 0; c--){

HealthCheck(); // check to make sure EA is running correctly

RefreshRates();

ticket=OrderSend(O_Symbol,O_Type,O_Lots,O_OpenPrice,O_Slippage,O_StopLoss,O_TakeProfit,O_String,O_Magic,O_Exp,O_Color);

if (ticket > 0) {Print(" Order Symbol : "O_Symbol," Order Type : "O_Type," Lots : "O_Lots," Open Price : "O_OpenPrice," Slippage : "O_Slippage," Stop Loss : "O_StopLoss," Take Profit : "O_TakeProfit," "O_String," Order Magic : "O_Magic," Order Exp : "O_Exp," Order Color : "O_Color," Open Time : "OrderOpenTime()," EA Took ",GetTickCount() - TickStart," milliseconds" );break;}

err=GetLastError();

if(err==0 || err==2 || err==4 ||err==6 || err==8 || err==9 || err==64 || err==128 || err==132 || err==133 || err==137 || err==139 || err==141 || err==146){ //Sleep and retry errors

Print("....................... Sleep And Retry Error Code= ", err," "ErrorDescription(err));

Sleep(10);

continue;

}

if(err==135 || err==136 || err== 138){ // price change errors

Print ("..................Invalid Price " O_String + " ..............");

WindowScreenShot("S_REQUOTE_"+Month()+"_D"+Day()+"_H"+Hour()+"_M"+Minute()+"_S"+Seconds()+".gif",1440,900);

Print("....................... Price Error Code= ", err," "ErrorDescription(err));

start();//restart and make sure that new price meets our entry criteria

break;

}

else{ // other errors

Print(".......................Error Code= ", err," "ErrorDescription(err));

break;

}

}

}