Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Basically if u use normalize double it rounds the decimal to digits, and it seems like this would not be acceptable to the broker.
slippage is already a factor if the prices change..
I was looking at an include from IBFX that you can see here, that rounds the ask and bid to close the order
void CloseAll( string Sym, int MagicNumber, int Type, int MaxTry, int Slippage, string Commentary )
if( SymPoints == 0.001 ) { SymPoints = 0.01; SymDigits = 3; }
else if( SymPoints == 0.00001 ) { SymPoints = 0.0001; SymDigits = 5; }
double SymAsk = NormalizeDouble( MarketInfo( Sym, MODE_ASK ), SymDigits );
double SymBid = NormalizeDouble( MarketInfo( Sym, MODE_BID ), SymDigits );
if( OrdType == OP_BUY ) { OrderClose( OrderTicket(), OrderLots(), SymBid, Slippage*SymPoints, CLR_NONE ); }
else if( OrdType == OP_SELL ) { OrderClose( OrderTicket(), OrderLots(), SymAsk, Slippage*SymPoints, CLR_NONE ); }
I wonder if anyone can elaborate..