Last updated: May 17, 2026
System Specs

Slippage Control in MQL4: Precision Order Execution

Trade-Charts IntelUpdate 2026.03

The Logic of the Tolerance: What is the Slippage Parameter?

In the OrderSend() function of MQL4, one of the most important arguments is the Slippage. This integer value (measured in 'Points') tells the broker's server how much price deviation you are willing to accept from your requested price.

Because the Forex market moves in milliseconds, the price you see on your screen might be slightly different from the price the broker's server has at the moment your order arrives. The slippage parameter is your 'Safety Margin'. If the price has moved more than your limit, the order is rejected (Requoted). If it is within the limit, the order is filled at the best available price.

Points vs. Pips: The 5-Digit Broker Trap

A common mistake for new developers is confusing 'Points' with 'Pips'. On a standard 5-digit broker, a 'Point' is 1/10th of a 'Pip'. If you want to allow 3 pips of slippage, you must set the slippage parameter to 30. If you set it to 3, you are only allowing 0.3 pips—which is so small that your EA will face constant 'Error 136' (Off Quotes) rejections during even minor market volatility.

⚙️Parameter Logic

{ Slippage Control Checklist }

01

Primary: Set slippage in Points (30 points = 3 pips on 5-digit brokers)

02

Constraint: Use a higher slippage for 'Market Execution' placeholders

03

Threshold: 3-5 pips is the industry standard for retail EAs

04

Sequence: RefreshRates() before calling OrderSend()

05

Verified: Check the 'Experts' tab for Error 136/138 (Requotes)

06

Risk: Be aware that high slippage can reduce your Risk-Reward ratio

Strategy: Slippage in Instant vs. Market Execution

Instant Execution: The slippage parameter is strictly enforced. If the price is 1 point outside your limit, you get a requote. This gives you control over the price but can lead to missed trades. Market Execution (ECN): The slippage parameter is often ignored by the broker. You are filled at the 'Next available price' regardless of what you put in the OrderSend() function. On ECN accounts, the slippage parameter is usually set to a large value (like 100) as a placeholder, as the actual market fill logic happens at the liquidity provider level.

Coding Best Practice: The Dynamic Slippage Filter

For advanced EAs, you can code a Dynamic Slippage Filter. During quiet market times, the EA uses a tight slippage (e.g., 2 pips). During high-volatility events (measured by ATR or a news filter), the EA automatically widens the slippage to 10 pips to ensure the trade is filled. This 'Adaptive' execution style ensures you capture the fast-moving breakouts that a fixed-slippage EA would miss.

Frequently Asked Questions

Can I get positive slippage?

On ECN/Market Execution accounts, yes. Positive slippage happens when the price improves in your favor during the execution time. On Instant Execution (B-Book) accounts, you almost never get positive slippage because any improvement is usually pocketed by the broker, while negative movements result in requotes or fills at your limit.

Does slippage affect Take-Profit levels?

No. The slippage parameter only applies to the Opening of the order. Once the order is open, the Take-Profit and Stop-Loss levels reside on the broker's server and are subject to the broker's specific exit-fill policies, which often involve their own slippage dynamics during high volatility.

Recommended Reading