Slippage in Market Execution Mode

 
In market execution mode, we can't specify an opening price and a maximum deviation, but the broker sets the openprice for the trade. This raises two questions for me:
1. Cannot we set a limit to slippage? Could the broker set an open price significantly different from the one I got before opening the trade?
2. If the actual open price isn't the one I used to perform my money management calculations (with the relative stoploss price), I could have, in worst case, an higher risk than what I calculated. Is that correct?

What are the ways to solve or at least minimize this problem?

Thanks.

 
antony23:
1. Cannot we set a limit to slippage? Could the broker set an open price significantly different from the one I got before opening the trade?

1. Manually, no. Programmatically, yes via an EA or Script (search the CodeBase if you can't code it). What you're referring to is requested price versus execution price, so yes--that's the nature of slippage.

antony23:
2. If the actual open price isn't the one I used to perform my money management calculations (with the relative stoploss price), I could have, in worst case, an higher risk than what I calculated. Is that correct?

2. Manually, yes because fixed price levels are used. In contrast, you can manually place a stoploss after an entry order is executed. Again, this can be semi-automated by way of an EA or Script.

As a side note, you have to ultimately decide whether you want to trade a given price move or not. If you end up getting in later on the same move, the price level could be worse even though the spread is lower. I recommend staying flat during times of unusually high spreads.

Here is someone else's trading panel EA for MT5 (I have not fully tested it):

 

Hi, i mean using EA.

Programmatically, we cannot set price and deviation in SYMBOL_TRADE_EXECUTION_MARKET and SYMBOL_TRADE_EXECUTION_EXCHANGE mode, as reported here. My current broker has MARKET mode for forex instruments, i don't know if it is a special condition of my broker.

About risk calculation, if my strategy use a price StopLoss, and not x points SL, i cannot move SL based on real openprice. That would mean changing strategy logic.

Manuale MQL5: Buying and selling operations / Trading automation
Manuale MQL5: Buying and selling operations / Trading automation
  • www.mql5.com
In this section, we finally begin to study the application of MQL5 functions for specific trading tasks. The purpose of these functions is to fill...
 
antony23 #:
{I]f my strategy use[s] a price StopLoss, and not x points SL, i cannot move SL based on real openprice.

Thank you for clarifying. I now understand that you lack the required programming skills to call the position open price and/or convert price difference to points.

This is a feature of many EA's. It's not advanced code, but it's not exactly basic either.

 
Ryan L Johnson #:

Thank you for clarifying. I now understand that you lack the required programming skills to call the position open price and/or convert price difference to points.

This is a feature of many EA's. It's not advanced code, but it's not exactly basic either.

Sorry, but how do you understand that i lack programming skills?! That's not the case. 

I explain it better. I DON'T WANT move my SL based on broker open price, because my strategy logic working this way, that is not using x points from open price but using price levels for SL. Hope it is clear now.

 
antony23 #:

Sorry, but how do you understand that i lack programming skills?! That's not the case. 

I explain it better. I DON'T WANT move my SL based on broker open price, because my strategy logic working this way, that is not using x points from open price but using price levels for SL. Hope it is clear now.

I guess that it's tough for me to imagine any other reason for not calculating risk based on a position that actually exists on a trade server. My thinking is that if the stoploss logic is not referencing the reality of the position, then what good is the logic?

If you only want to alter your trade entry logic, the best that you can do is add a spread filter to your trade entry conditions (subject to its potential limitation in my Post #1). Slippage generally worsens when spreads are high/liquidity is low. This assumes that you don't want to add a time filter to avoid typical high spread times (my preferred approach).

 
antony23:

Thanks.

in my experience the only way to avoid the majority of this slippage is to use eas. 1 ea that I use to add or drag lines on the chart where is my desired open price(s), and the ea then opens trades when price either hits or crosses that line named "opening", i found avoids over 50% of slippage i got in past when I did manual opening of trades. and another 1 for closing strategies. This avoids the similar 50% slippages that i would get in the past when closing them manually.

2. That would depend on if your eas coding and strategy. But your assumption sounds right to me. But the ea would (hopefully) make allowances for that extra slippage.

 
antony23:
In market execution mode, we can't specify an opening price and a maximum deviation, but the broker sets the openprice for the trade. This raises two questions for me:
1. Cannot we set a limit to slippage? Could the broker set an open price significantly different from the one I got before opening the trade?
2. If the actual open price isn't the one I used to perform my money management calculations (with the relative stoploss price), I could have, in worst case, an higher risk than what I calculated. Is that correct?

What are the ways to solve or at least minimize this problem?

Thanks.

1. In market execution the market decide. Yes it could be significantly different, you can use limit order (pending order) to control your slippage, it's then possible the order will not be triggered though.

2. Yes it's correct. Technically you can adjust your stop loss to match your risk once the position is open, up to you to decide if that change your strategy or not.

What market are you trading ? (Forex ?)

 
Alain Verleyen #:

1. In market execution the market decide. Yes it could be significantly different, you can use limit order (pending order) to control your slippage, it's then possible the order will not be triggered though.

2. Yes it's correct. Technically you can adjust your stop loss to match your risk once the position is open, up to you to decide if that change your strategy or not.

What market are you trading ? (Forex ?)

Yes, forex. But i'm coding EA to be used in other markets if i would in the future.

Do you think checking spread (which checks? on x points?) could help avoid the big slippages? It could help during news? Or it would be better coding a filter time for news?

About risk, yes, changing SL could be a big trouble for my strategy, i'll think about it.

 
antony23 #:

Yes, forex. But i'm coding EA to be used in other markets if i would in the future.

Do you think checking spread (which checks? on x points?) could help avoid the big slippages? It could help during news? Or it would be better coding a filter time for news?

About risk, yes, changing SL could be a big trouble for my strategy, i'll think about it.

Checking spread or time is only an indirect solution, you could still have slippage. The only solution that actually allow you to control slippage is limit orders as I already said.

 
antony23 #:

Yes, forex. But i'm coding EA to be used in other markets if i would in the future.

If you can afford trading options and some algorithmic complication, then probably just take an option for the same asset with required strike price as a solid (uneffected by slippage) alternative for the stop loss.
antony23 #:

About risk, yes, changing SL could be a big trouble for my strategy, i'll think about it.

This is a very strange passage. You can change SL for any direction, any level, any number of times, and optimize all risks as you wish (taking into account related limitations, such as stop levels and freeze levels).