Trade Slippage: How Can You Simulate and Minimize It?

Oct 15, 2021

Trade slippage is the common enemy that erodes your strategy’s expectancy, and usually becomes more severe after going live.

This post will cover:

  • Why slippage occurs
  • 4 simple ways to minimize slippage
  • 3 ways to simulate slippage while backtesting

Every trader has complained about slippage at some point. Like spread and commissions, it is sometimes an unavoidable cost of trading.

Nonetheless, minimizing slippage should be a goal of every trader. In addition, can we improve our backtest realism by simulating slippage?

Let’s discuss!

What’s Slippage, and Why Does It Happen?

Slippage is the difference between the expected price of a trade, and the actual price at which the trade is executed.

For example, if you place a market order at $100, but you actually get filled at $101, you’ve just experienced a $1 slippage.

In general, there are two causes of slippage:

1. Execution Delay

There is a small delay between the time your order is placed and the time it’s executed by the server. Even if it’s only a fraction of a second, the market price may have changed, or the spread may have widened.

2. Low Liquidity

When market liquidity is low, there may be insufficient buyers/sellers at your requested price.

Suppose you place a market order to buy two lots at $100. This will be executed at the lowest price offered by sellers. If there are ample lots on sale at $100, your order will be filled without slippage.

Otherwise, your order will move up to the next available price. This will occur repeatedly until your order is completely filled. Eventually you may have one lot filled at $101, and the other at $102, giving you a total slippage of $3.

Tips to Minimize Trade Slippage

Slippage is especially detrimental if you trade frequently or have a small expectancy.

Here are four tips to minimize slippage:

1. Avoid Illiquid Hours

The first hour after the New York close is typically the most illiquid period of the trading day.

Your risk of slippage increases dramatically within this period.

I previously measured the GBPCAD spread over a 24-hour period using my Spread Recorder algorithm. The drastic spread widening (20 pips!) shortly after New York’s close illustrates the thin liquidity during this period.

After 1 a.m., spreads fall below 5 pips and approach the 24-hour average. Preventing entries and exits during the illiquid 12-1 a.m. window is a good way to minimize slippage.

Some mean reversion strategies, like the so-called Asian scalpers, exploit the random noise during these illiquid market hours. These can work very well; just be wary that slippage can have a large impact.

2. Avoid Trading the News

In volatile fast-moving markets, prices are likely to change during your order’s execution delay. If your strategy trades through the news, or even trades off the news, some slippage is practically guaranteed.

A good time to observe this is during the monthly US Nonfarm Payroll report. Central bank announcements aside, this has consistently been the mother of all US economic releases.

The strong price action and tick volume indicate the vastly increased trading activity.

To mitigate this, you can:

  • Add a live news filter that pauses trading before high impact news
  • Add a time entry filter that prevents trading in a certain window (e.g. Friday mornings)

Whatever option you choose, ensure that you can replicate similar filtering conditions in your backtest.

3. Use Limit Orders

A limit order is only executed at the price you specify, or better.

A buy limit is placed below the current market price, while a sell limit is placed above the current price.

Unlike market orders and stop orders, limit orders won’t fill at a worse price. Any stop or market order that you can replace with a limit order will reduce slippage.

Be careful about using limit orders for your stop loss. If you need to exit the market in a hurry, the immediate execution of a market order will be handy.

Limit orders have their own drawbacks, however.

Firstly, the market may never reach your limit price, so you may miss the trade entirely. And even if your limit price is hit, chances are you’ll only get a complete fill if the market penetrates (not just touches) your price.

The second problem is ‘phantom’ backtest fills.

These ‘phantom’ fills occur because conventional backtest engines assume a limit order will be completely filled when the price is hit. If the market bounces off your buy limit and rallies to profit, your backtest will register a full winning trade. In live trading, the trade could have been a partial fill, or even missed.

This creates an optimistic backtest with many winning trades that can’t be replicated in reality.

Changing your order type should only be a means of fine-tuning your strategy; your overall trading idea should take priority.

For example, I generally find that stop entries work better than limit entries for trend following strategies. I’m not going to use a limit entry simply because of slippage.

4. Use a Forex VPS

A virtual private server (VPS) is a computer that you can access remotely and house your MT4 platforms on.

Selecting a forex VPS that is located close to your broker’s servers will minimize latency and keep slippage low. The chart below shows the latency in milliseconds between FXVM’s New York server and several prominent brokers. 

If you’re a scalper and every pip is critical, renting a VPS is highly recommended.

I run all my live and incubation portfolios on my FXVM VPS. Although slippage is rarely a problem for me, the added reliability of a VPS is priceless.

Click the banner below to check out FXVM’s plans.

Simulating Trade Slippage in Your Backtests

I’m a firm believer in backtesting. Your backtest displays your strategy’s historical profitability, and helps you establish performance expectations for live trading.

For a realistic backtest, all transaction costs (including slippage) need to be included.

You don’t want inflated performance metrics that cannot be replicated in live trading. In addition, when optimizing your strategy, excluding slippage usually creates a bias towards parameters that increase trading frequency. This creates a double whammy because the more you trade, the more you lose to slippage.

Now let’s discuss several ways to include slippage in your backtests.

1. Adding a Constant Slippage per Trade

StrategyQuant’s backtest engine lets you separately specify each type of transaction cost, including slippage.

The slippage specified here (1 pip in the image above) will be applied to every market order in your strategy.

This includes stop orders, since they are converted to market orders when the stop price is hit.

So for example, if you enter the market on a buy stop, and exit using a stop loss, the backtest engine will register a 2-pip slippage.

If you instead enter on a limit order, and exit on a profit target, you will not have any slippage.

To illustrate the effects of slippage, I’ll use a GBPNZD scalping strategy for the rest of this article. Here’s how it backtests with a 2-pip spread and no slippage.

After adding a constant slippage per trade, here’s how the equity curves compare.

Even a modest 2-pip slippage is enough to halve the strategy’s profit.

So how much slippage should you specify per trade? This depends on your strategy and market. Here are some factors to consider:

  • Are you trading a thin market? (e.g. emerging market currencies)
  • Are you mainly using market orders?
  • Do you often trade during periods of high volatility and/or low liquidity?

If many of the above apply to you, a larger slippage is warranted. It’s better to be conservative during your development than be disappointed during live trading.

You can refer to the Analysis tab to find out your strategy’s typical trading days and hours.

If you use MT4 for backtesting, you won’t be able to directly specify slippage. You can increase your spread to reflect higher transaction costs, but you won’t be able to specifically target your strategy’s market orders.

2. Randomizing Spread Using Monte Carlo Simulations

Monte Carlo simulations use repeated random sampling to provide a probabilistic assessment of strategy performance.

In this case, this involves running 1000 separate backtest runs, each using a random slippage within the 0.5-3.0 pip range.

Let’s set up StrategyQuant’s Monte Carlo simulator.

And here is the collection of simulated equity curves:

The original equity curve, which has zero slippage, is outlined in blue. Since all 1000 simulations have slippage applied, they perform poorer than the original.

There is still a $5700 profit at the 95% confidence level. This means that of the 1000 simulations, only 50 produce a profit worse than $5700.

This is an acceptable result to me. Once again, the strictness of your passing criteria will depend on your strategy and market.

3. Adding an Execution Delay to Each Trade

Rather than directly specifying the slippage in pips, you can also introduce an execution delay to each trade.

Birt’s Tick Data Suite, which is known to be the gold standard in MT4 tick-precision backtesting, offers such a capability.

Adding an execution delay lets you simulate slippage as it occurs when using an ECN broker. Your backtest orders will be executed at the current price after addition of the delay.

Wrapping Up

Accounting for trade slippage during strategy development is essential if you trade frequently or have a small expectancy.

Minimizing slippage using the tips above, and subsequently including slippage in your backtests, will help avoid unpleasant surprises while trading live.

Nonetheless, if you suspect your strategy is very prone to slippage, testing it on a small live account is recommended. This is the most accurate way to study the effects of market liquidity.

To do the backtests and Monte Carlo simulations above, don’t forget to make use of StrategyQuant’s 14-day Free Trial!

Powered By

Development Platform

Forex VPS

FXVM Forex VPS

Popular Posts

No Results Found

The page you requested could not be found. Try refining your search, or use the navigation above to locate the post.

Make your money work for you!

Get promotions, trading ideas and strategy development tips delivered to your inbox!

Comments

1 Comment

  1. Mike

    Thank you for your feedback. Here are the improved versions of your sentences:

    It would be beneficial if StrategyQuant could incorporate the feature of “Adding an Execution Delay to Each Trade.” Do you have any insights on how this is implemented in Birt’s Tick Data Suite?

    Additionally, you did not mention the potential for positive slippage, which could result in obtaining a more favorable price, leading to larger profits and smaller losses. Could you provide some information on this aspect?

    I understand that you primarily trade forex. However, I would appreciate any advice or suggestions on studying slippage in gold for beginners. Gold tends to have relatively significant slippage, so how can a beginner reasonably estimate and simulate the slippage in Monte Carlo simulations using StrategyQuant?

    Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

Trading Strategies

Ichimoku Trend Following Strategy

Ichimoku Trend Following Strategy

Like candlesticks, the Ichimoku indicator is a fine Japanese creation. Here I’ll explain how the Ichimoku is plotted, and use it to build a trend following strategy for the USDJPY.

Forex Trading With Volume – Does It Work?

Forex Trading With Volume – Does It Work?

Volume is seldom discussed in forex trading. But as a stock trader would tell you, volume provides insights into the underlying market sentiment. Here I’ll demonstrate the use of two simple volume filters to improve entry reliability.

What Is the Kaufman Adaptive Moving Average?

What Is the Kaufman Adaptive Moving Average?

The Kaufman Adaptive Moving Average is a unique indicator that automatically adapts to the market’s noise. Here I explain its inner workings and show you how to build a trend following strategy around it.

Awesome Oscillator Forex Trend Strategy

Awesome Oscillator Forex Trend Strategy

The Awesome Oscillator is one of Bill Williams’ fine creations. It is a simple yet effective momentum indicator that can be a valuable addition to your strategy. Here we’ll use it together with a moving average to fine-tune our trend following entries.

Dual CCI Indicator Forex Trend Strategy

Dual CCI Indicator Forex Trend Strategy

The Commodity Channel Index (CCI) is an underrated momentum indicator that is often overshadowed by the RSI and MACD. I’ll show you how to build a simple trend following strategy using a pair of CCI indicators!

What is Fixed Ratio Money Management?

What is Fixed Ratio Money Management?

Have you heard of fixed ratio money management? How does it compare to the popular fixed fractional approach? Here I’ll explain how fixed ratio works, and see how it stacks up against fixed fractional money management.

What Is the Kaufman Efficiency Ratio?

What Is the Kaufman Efficiency Ratio?

Avoiding false breakouts is a common goal among trend traders. The Kaufman Efficiency Ratio provides a simple method of quantifying a market’s noise, helping traders focus on the smoothest trends. Let’s add the efficiency ratio to a simple trend following strategy and see whether its performance improves.

What Is the QQE Indicator?

What Is the QQE Indicator?

The QQE is a mysterious indicator that sometimes pops up in trading forums. Does it deserve a place alongside the more traditional momentum indicators like the RSI and CCI? Let’s add it to a trend following strategy to find out!

Do Bollinger Bands + Candlestick Patterns Work?

Do Bollinger Bands + Candlestick Patterns Work?

Bollinger Bands are great at detecting overbought and oversold conditions. Let’s use them to develop a countertrend strategy, and then refine our entries using limit entries and candlestick patterns.

How Good Are The Bollinger Bands’ Trailing Stops?

How Good Are The Bollinger Bands’ Trailing Stops?

Trailing stop losses are a popular feature in many trend following systems. Bollinger Bands, the ever-popular technical indicator among retail traders, actually contain two inbuilt trailing stops. Are these any good? Let’s find out!

Bollinger Bands vs. Keltner Channels

Bollinger Bands vs. Keltner Channels

Bollinger Bands are ubiquitous in the trading world, but there’s less discussion about their lesser-known cousin, the Keltner Channels. Do these perform as well as the Bollinger Bands? Let’s compare them over a broad range of input parameters.

Strategy Development

No Results Found

The page you requested could not be found. Try refining your search, or use the navigation above to locate the post.

Live Trading

No Results Found

The page you requested could not be found. Try refining your search, or use the navigation above to locate the post.

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Pin It on Pinterest

Share This