How to avoid slippage in equities trading with backtesting
Slippage is a familiar concept to anyone in electronic trading. Regardless of your trading strategy, it represents a source of variance to algorithmic models if unaccounted for. Backtesting, in combination with available historical performance, helps to account for slippage—modelling its scope and impact on profitability. The result is a more trustworthy strategy that better predicts the success of trading performance.
Understanding trading slippage
Slippage is the difference between an expected and executed price of a trade. A change in spread, created by shifts in liquidity, creates the environment for slippage, where either high trading volume can cause market orders to slip or low trading volume can cause portions of large orders to slip.
However, slippage happens in two directions, leading to both positive and negative slippage. If you are closing a long position and the intended sell order is for $100.10 but executed at $100.05, a negative slip of $0.05 occurred. In contrast, if that $100.10 sell order is executed at $100.15, a positive slip (or price improvement) of $0.05 is captured.
While slippage isn’t always negative, for algorithmic trading, it means deviation from the trading strategy. Any deviation decreases the confidence in the strategy’s intended outcomes. When slippage is not properly modeled, a theoretically-sound strategy could produce a large drawdown or negative returns. Even a winning strategy with negative slippage means best execution isn’t being attained, and auditing for best execution may be needed. So proactive management of slippage can establish greater confidence in the overall trading strategy.
Methods in limiting slippage
When managing for slippage, consider best practices for limiting risk. Since liquidity contributes to slippage, ensure a strategy accounts for changing positions at spikes and troughs of liquidity. Limiting market orders during high-volume trading periods and throttling order sizes when liquidity is low are common to reduce price slips.
In addition, as a more quantitative and procedural option, modeling for slippage and iteratively improving the cost model with backtesting can limit exposure to slippage. Backtesting is the process of applying a trading strategy to historical data to gauge how accurately the model performs. While it may often be used to gauge profitability through trading ratios like win rate or risk-reward ratio, backtesting can also unveil the underlying transaction costs. If slippage is perceived as a cost of doing business that is sought to be reduced, then trading models in backtesting account for it just as commissions or other fees.
Managing slippage with backtesting can be done with trading strategies both in development and in production. More commonly, trialing a theoretical trading strategy is done with historical trade data to illuminate the strategy’s tolerance for slippage and slippage’s projected impact on profitability. However, backtesting a production trading strategy with a robust dataset can help expose the strategy to unrealized profits and troubleshoot under-performance. In either case, the goal is to more accurately model the sources and impact of slippage.
How backtesting helps
Accounting for transaction costs like slippage is necessary for determining the profitability of a new trading strategy. Whether the model projects slippage as linear or as a function of liquidity, this is planned for prior to backtesting. From there, backtesting a comprehensive dataset of market ticks will project how slippage will impact cost at each submitted order. Slippage cost is then measured across risk and return ratios, like Sharpe and MAR, and projected for annual performance.
For strategies in production, backtesting is also valuable when a slippage issue is exposed. Slippage is then calculated as the difference in order prices between the model and production environments of your trading system, and historical performance from this internal data can help determine trends or sources of the slippage. If a reason for repeated misses in order price is found—for example, a threshold of message volume or other liquidity indicator—then backtesting can trial variations to the strategy.
When analysis of internal performance data does not explain patterns of slippage, introducing a different–sometime broader–dataset to backtest can improve visibility. Alternate feeds may indicate solutions for missed price ticks, whether it’s lower latency or a clearer view of the price book. For example, a direct feed would enable faster trades, while a depth of book view would introduce new variables to base an order event from.
If you’re looking for backtesting data sets, ensure accurate backtesting by seeking a dataset from exchanges or market data vendors with comprehensive tick data and NIST-synced timestamps. With market data vendors, the data from different exchanges are even normalized and consolidated for one ready-to-analyze book.
While slippage cannot always be avoided in high frequency trading, if it is impacting a trading strategy’s performance, it can be limited. Pinpointing trends or reasons for repeated slippage can help minimize it, while simply accounting for slippage in the trading model and back tests strengthens the validity of anticipated outcomes. In turn, the firm will have greater confidence in a strategy’s annualized projections of profitability.
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Exegy.
In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Exegy nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Exegy about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Exegy makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.