Slippage and Deviation

To add comments, please log in or register
gburg14
14
gburg14  

In the Options|Trade dialog there is a setting for Deviation. I don't remember what the out-of-the-box value was. I think it was 10. About it, the User Guide states: 

  • The symbol price can change within the ordering time. As a result, the price of the prepared order will not correspond with the market one, and position will not be opened. The "Deviation" option helps to avoid this. Maximum permissible deviation from the value given in the order can be specified in this field. If prices do not correspond, the program will modify the order by itself what allows to open a new position.

 

I also saw in article www.mql5.com/en/articles/1946 the use of extern int slippage = 2. This value is used in the slippage parameter of OrderSend(). So I wondered what is the difference between trying to control the amount of slippage or deviation using either or both of these settings?

I was able to talk to someone at FXCM Customer Service. He was very helpful. He even called one of the programmers there. The Options|Trade|Deviation setting is similar to the Slippage parameter in OrderSend() but the Slippage amount specified in OrderSend() should take precedence. That said, it is a good idea to set the two to be the same. Also, when MetaTrader4 was updated to 5 they forgot to update that Deviation field to accommodate 5 decimal point systems. So if you use a broker that uses a 5 decimal point price and if you have, say 3, in the Deviation field, it is interpreted as 0.00003 (0.3 pips, not 3 pips). If you desire to set an acceptable price deviation of 0.0003  (3 pips) you need to enter 30.

The same is true for Slippage in OrderSend(). Therefore, if you want to control Slippage to, say, 3 pips, you can specify that with extern int Slippage =  30. (Not 3) 

Does anyone have any corrections, additions and/or wisdom to offer here?

Alain Verleyen
36601
Alain Verleyen  
gburg14:

In the Options|Trade dialog there is a setting for Deviation. I don't remember what the out-of-the-box value was. I think it was 10. About it, the User Guide states: 

  • The symbol price can change within the ordering time. As a result, the price of the prepared order will not correspond with the market one, and position will not be opened. The "Deviation" option helps to avoid this. Maximum permissible deviation from the value given in the order can be specified in this field. If prices do not correspond, the program will modify the order by itself what allows to open a new position.

 

I also saw in article www.mql5.com/en/articles/1946 the use of extern int slippage = 2. This value is used in the slippage parameter of OrderSend(). So I wondered what is the difference between trying to control the amount of slippage or deviation using either or both of these settings?

I was able to talk to someone at FXCM Customer Service. He was very helpful. He even called one of the programmers there. The Options|Trade|Deviation setting is similar to the Slippage parameter in OrderSend() but the Slippage amount specified in OrderSend() should take precedence. That said, it is a good idea to set the two to be the same. Also, when MetaTrader4 was updated to 5 they forgot to update that Deviation field to accommodate 5 decimal point systems. So if you use a broker that uses a 5 decimal point price and if you have, say 3, in the Deviation field, it is interpreted as 0.00003 (0.3 pips, not 3 pips). If you desire to set an acceptable price deviation of 0.0003  (3 pips) you need to enter 30.

The same is true for Slippage in OrderSend(). Therefore, if you want to control Slippage to, say, 3 pips, you can specify that with extern int Slippage =  30. (Not 3) 

Does anyone have any corrections, additions and/or wisdom to offer here?

Slippage is for automated trading, Deviation for manual trading, only 1 is used depending of the method your are using to place trade, not both.

There is nothing "forgot", the settings is in points, it's the only well defined unit. A pip is not well defined for some symbols and each trader can have his own idea about the meaning of a pip. So the unit is points, it's a choice. By the way a slippage of 3 pips is not acceptable in my opinion, but maybe it's a matter of taste.

On a ECN broker slippage/deviation is not used. You open a trade a the available market price.

To add comments, please log in or register