You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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..