Why do I suffer slippage in my OrderClose() function?

 

Hi, all.

I just wonder why I suffer slippage when I close the order. My OrderClose() function is like below.


OrderClose(OrderTicket(),OrderLots(),TargetPrice,0,Red)


As you can see, I defined the target price (like a limit order) and I allowed '0' for the slippage as I didn't want to close my order in unfavorable price than TargetPrice.

But sometimes I found that my order was closed at worse price than the TargetPrice. This happens often. Is there anyone has a idea?

Thank you.

 
Wonsuk Song:

Hi, all.

I just wonder why I suffer slippage when I close the order. My OrderClose() function is like below.


OrderClose(OrderTicket(),OrderLots(),TargetPrice,0,Red)


As you can see, I defined the target price (like a limit order) and I allowed '0' for the slippage as I didn't want to close my order in unfavorable price than TargetPrice.

But sometimes I found that my order was closed at worse price than the TargetPrice. This happens often. Is there anyone has a idea?

Thank you.

slippage is ignored in some order execution modes , at least in Market Execution ,afaik

 
Code2219 or probably 2319:

slippage is ignored in some order execution modes , at least in Market Execution ,afaik

Hello, thanks for your comment.

Do  you mean my '0' input to prevent slippage can be ignored? I really don't want to close my order below my target price...What could I do? Or...do I have to contact my broker?

 

Please do some researches before posting.

https://www.mql5.com/en/forum/31987

What is the real purpose of Slippage in OrderSend Function?
What is the real purpose of Slippage in OrderSend Function?
  • 2014.06.10
  • www.mql5.com
Just wondering what is the purpose of Slippage variable in ordersend function (http://docs.mql4.com/trading/ordersend...
 
Alain Verleyen:

Please do some researches before posting.

https://www.mql5.com/en/forum/31987

Oh, thank you for your links. I just researched the slippage issue on 'OrderClose' function only. As discussed in the forum, the slippage depends on my broker...I see. Thank you very much!
Reason: