Question about slippage affecting TP or SL

 

Hi, i have some important questions to ask about slippage in my EA (using ECN broker and low timeframe):

1) If i put an OrderSend() function it actually and set the slippage to lets say 20 fractional pips, that means that if wont go in the trade if the price moves more than 20 fpips before the execution,but if will at any given value below?

2) If i set an OrderClose() to 20 fpips slippage what means that it wont close the order if the slippage gets above 20 fpips, so for an EA with only orderclose feature and no SL or TP set its best to put a huge number here like 99999999999 to close the order no matter what?

3) Are the SL or TP levels affected by the slippage? Lets say i put a predetermined SL or TP level and if a slippage would get normally to 50 fpips but the TP or SL level is below that, would the trade be closed by the SL/TP or by the OrderClose() ? So basically are the predetermined TP and SL levels also affected and delayed by the slippage or only the Ordersend and Orderclose orders in the EA?

4) What maximum slippage do you recommend to set on low timeframes like 1 and 5 min to my EA, on EUR/USD or GBP/USD pairs in fractional pips to the OrderSend() and OrderClose() functions?

SL=stop loss

TP=take profit

fpips=fractional pips

 
Proximus:

Hi, i have some important questions to ask about slippage in my EA (using ECN broker and low timeframe):

Slippage may not be applicable with your Broker, have you tested ?

https://www.mql5.com/en/forum/143997/page2#773665

 
RaptorUK:

Slippage may not be applicable with your Broker, have you tested ?

https://www.mql5.com/en/forum/143997/page2#773665

Yes i have slippage unfortunately,since the broker has variable spread.It's and STP-ECN broker.
 
Proximus:
Yes i have slippage unfortunately,since the broker has variable spread.It's and STP-ECN broker.
You ran the test ?
 
RaptorUK:
You ran the test ?


Yes, if i use ORDERCLOSE or ORDERSEND it will hve sometimes a delay.I know this because i marked the points where the conditions were approved to set a buy or sell order,and sometimes it executes the order 3-4 candles away.Or if i put a maximum slippage of 9999 then it will execute it many many candles away.


I have a more important question to ask:

Can i cheat out the slippage of the orderclose by this method? Let's say the EA wants to close an order, but the effective slippage is 3 pips, and the maximum slippage allowed to close it 2 pips.Will it close the order at 2 pip slippage if i put like 10 OrderClose() functions one after another at a maximum of 2 pip slippage?

 
Proximus:

Yes, if i use ORDERCLOSE or ORDERSEND it will hve sometimes a delay.I know this because i marked the points where the conditions were approved to set a buy or sell order,and sometimes it executes the order 3-4 candles away.Or if i put a maximum slippage of 9999 then it will execute it many many candles away.


I have a more important question to ask:

Can i cheat out the slippage of the orderclose by this method? Let's say the EA wants to close an order, but the effective slippage is 3 pips, and the maximum slippage allowed to close it 2 pips.Will it close the order at 2 pip slippage if i put like 10 OrderClose() functions one after another at a maximum of 2 pip slippage?

The higher the slippage you allow the more likely you are to get your order filled immediately . . . not any candles away, not even M1 candles . . . unless you are opening pending orders.
 
RaptorUK:
The higher the slippage you allow the more likely you are to get your order filled immediately . . . not any candles away, not even M1 candles . . . unless you are opening pending orders.

Yes but if i allow high slippage and if the market is volatile, it will close my order many pips away.But if i dont put max high slippage then if the market is volatile and goes against me i cant exit quickly and lose more.
 
Proximus:
Yes but if i allow high slippage and if the market is volatile, it will close my order many pips away.But if i dont put max high slippage then if the market is volatile and goes against me i cant exit quickly and lose more.

Correct. Do you want to lose more or less ?
 
Proximus: Yes but if i allow high slippage and if the market is volatile, it will close my order many pips away.But if i dont put max high slippage then if the market is volatile and goes against me i cant exit quickly and lose more.
The quickest is when it happens on the broker's servers. That is what the SL/TP is for. There is no slippage value with SL/TP, they close wherever the market is.
 
WHRoeder:
The quickest is when it happens on the broker's servers. That is what the SL/TP is for. There is no slippage value with SL/TP, they close wherever the market is.

I agree. But, just to clarify for the OP, there can be a small amount of slippage when closing an order via SL or TP (unless the broker guarantees the SL or TP prices).

  • A buy order (OP_BUY) is closed when: Bid >= TP or Bid <= SL.
  • A sell order (OP_SELL) is closed when: Ask <= TP or Ask >= SL.
For example, if the current Bid price is 1.35102 and a buy order has a SL of 1.35100 and the subsequent Bid price becomes 1.35098 on the next tick, the buy order will close at 1.35098. That equates to 2 points of slippage, which is not allot but it is some.
 
Thirteen: But, just to clarify for the OP, there can be a small amount of slippage when closing an order via SL or TP (unless the broker guarantees the SL or TP prices)
If the market gaps there can be a large amount of slippage when closing an order via SL or TP (no broker is going to guarantee the future prices.)
Reason: