You can only set the maximum deviation (slippage) if the broker supports "Instant execution" on that symbol, and that is usually only possible if it is a "dealing desk" account or broker.
However on NDD (non-dealing desk), STP (straight through processing) and ECN accounts, it is usually "Market execution" which does not support limiting deviation (slippage).
Basic Principles - Trading Operations - MetaTrader 5 Help
Types of Execution
Four order execution modes are available in the trading platform:
- Instant Execution
In this mode, an order is executed at the price offered to a broker. When sending an order to be executed, the platform automatically adds the current prices to the order. If the broker accepts the prices, the order is executed. If the broker does not accept the requested price, a "Requote" is sent — the broker returns prices, at which this order can be executed.- Request Execution
In this mode, a market order is executed at the price previously received from a broker. Prices for a certain market order are requested from the broker before the order is sent. After the prices have been received, order execution at the given price can be either confirmed or rejected.- Market Execution
In this order execution mode, a broker makes a decision about the order execution price without any additional discussion with a trader. Sending an order in such a mode means advance consent to its execution at this price.- Exchange Execution
In this mode, trade operations conducted in the trading platform are sent to an external trading system (exchange). Trade operations are executed at the prices of current market offers.Execution mode for each security is defined by the brokerage company.
You can only set the maximum deviation (slippage) if the broker supports "Instant execution" on that symbol, and that is usually only possible if it is a "dealing desk" account or broker.
However on NDD (non-dealing desk), STP (straight through processing) and ECN accounts, it is usually "Market execution" which does not support limiting deviation (slippage).
thanks mate
you were the only person who could help me.
cant we use any kind of trick to make slippage a certain value in "market execution " brokers ?
Unfortunately not! "Market execution", means accept ANY price the market offers at the time the order is filled.
All you can do is monitor the current prices and spread and execute when the conditions are most favourable, but there is no guarantee.
Well if you send a market order with a certain price the server (at least MQ demo account) refuses execution with the error Requote.
In the struct result you can find the actual ask and bid price of the server and then you can decide to resend the request with the new prices or not.
As I said it works on MQ demo accounts.
- www.mql5.com
It only gives "Requote" if it is Instant Execution. There are no requotes on Market Execution.
MetaQuotes demo accounts are not a realistic representation of most real broker accounts.
It only gives "Requote" if it is Instant Execution. There are no requotes on Market Execution.
MetaQuotes demo accounts are not a realistic representation of most real broker accounts.
?
OrderSend only knows:
Identifier | Description |
---|---|
Place a trade order for an immediate execution with the specified parameters (market order) | |
Place a trade order for the execution under specified conditions (pending order) | |
Modify Stop Loss and Take Profit values of an opened position | |
Modify the parameters of the order placed previously | |
Delete the pending order placed previously | |
Close a position by an opposite one |
So this TRADE_ACTION_DEAL is an immediate executed market order.
- www.mql5.com
Please read post #1.
For cTrade, I've found this explanation: https://www.mql5.com/en/docs/standardlibrary/tradeclasses/ctrade/ctradesettypefilling
The Order type filling codes: https://www.mql5.com/en/docs/constants/tradingconstants/orderproperties#enum_order_type_filling
- www.mql5.com
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi every one. if any one can help me , i would be really happy and thankful .
i want to set slippage in mt5 and also i used both order send and ctrade but for both of them there is no option to set the slippage, also i found the function Mytrade.SetDeviationInPoints() but it still does not control the Deviation
whatever i write for that function , it still does not respect the max slippage i write. please help me get out of this . i am working on it for weeks. thanks