Why do i get slippage when i don't allow it?

 
.. when i set max slippage to 0?
int ticket;
double iAsk = Ask;
     ticket=OrderSend(Symbol(),OP_BUY,1,iAsk,0,0,0,""+iAsk,0,0,Green);
     if(ticket<0)
       {
        Print("OrderSend failed with error #",GetLastError());
        return(0);
       }
    

This code will put the iAsk (thus Ask price) in the comment of the order. With 0 slippage allowed, the orderopenprice should be exactly iAsk (as seen in comment).

But, very often the price is above iAsk. How is this possible?

Thanks!

 

Something just occurred to me . . don't know if it's true or not . . . is slippage just determined from the bid price ? what I'm saying is that maybe the issue isn't slippage but it's the spread changing ?

Talk to you broker about it, they should be able to give you an answer . . . who is your broker ?

 
RaptorUK:

Something just occurred to me . . don't know if it's true or not . . . is slippage just determined from the bid price ? what I'm saying is that maybe the issue isn't slippage but it's the spread changing ?

Talk to you broker about it, they should be able to give you an answer . . . who is your broker ?


Thanks for your reply. I'm testing it with many mt4 brokers (demo and some live). Seems to happen everywhere. Try it, you will be surprised. Seems that at opening and closing we automatically loose some extra pips here. Have seen differences for over 10 pips. And hard to detect, unless you pay attention to it. So nobody will see.. :(
 

captaincrunchy:

as seen in comment

Technically speaking, there is nothing in the posted code to prove (or disprove) what you actually saw.
 
captaincrunchy:

And hard to detect, unless you pay attention to it. So nobody will see.. :(
You can add Print statements to record the relevant data to the logs and then show the data of the trade opened beyond the Ask price . . .
 
RaptorUK:
You can add Print statements to record the relevant data to the logs and then show the data of the trade opened beyond the Ask price . . .

Is exactly what i've done, added the requested price in the comments. I'm a scalper, so every pip counts. Really, try it yourself if you have some free time. You will be surprised..