Explore how slippage and liquidity impact backtesting results, revealing the hidden challenges in trading strategy performance.
Backtesting often fails to reflect real trading conditions. Why? It overlooks slippage and liquidity, two forces that can drastically distort your strategy’s performance.
- Slippage – the difference between expected and actual trade prices – can be as low as 0.1 percent in liquid markets or well above 1 percent when liquidity thins out.
- Liquidity – how easily orders are filled without moving price – depends on market depth, bid-ask spreads and trading volume.
Key takeaways
- Slippage rises with bigger order sizes and during volatile sessions.
- Most backtests assume perfect fills, ignoring real-world frictions such as order-book depth.
- Liquidity changes with asset type, market hours and news-driven events.
To improve accuracy:
- Use variable slippage models.
- Model realistic volumes and spreads.
- Avoid testing during low-liquidity windows.
LuxAlgo’s AI Backtesting Assistant can scan millions of strategy combinations in seconds, filter them by asset, timeframe or risk, then export any pick straight to TradingView. Inside TradingView you can set precise slippage, spread and commission values, turning a quick screen into a fully realistic simulation.
How to use LuxAlgo AI Backtesting Assistant to locate strategies
Slippage in Backtesting
Slippage is the gap between the price you expect and the price you actually receive. While classic backtests assume flawless execution, live markets rarely comply. During calm sessions major FX pairs may slip just 1-3 pips, but under stress the same pairs can gap 5-10 pips[1].
Common Slippage Types
Backtesting platforms usually offer two core models:
Slippage Model | Description | Typical Use |
---|---|---|
Fixed | Constant rate per trade | Simpler systems |
Variable | Adapts to market conditions | Advanced systems |
Variable models are more realistic, factoring trade size and volume. Trading EUR/USD in peak hours might cost just 1 pip, while the same order overnight can slip 3 pips or more[2][3].
Market Factors Causing Slippage
- Latency – A 500 ms delay can cost 2 pips in fast markets. During the 2015 CHF crisis, gaps of 100+ pips were recorded[2][4].
- Order size – Big orders sweep multiple levels. A 1 000-lot order that looks fine in a backtest may slip 5 pips when real liquidity dries up[2][4].
Slippage Gaps in Backtesting
Traditional engines ignore:
- Order-book depth – Unlimited liquidity at best price is assumed, giving inflated results for sizeable trades[2][4].
- Stop-order gaps – Stops often fill far from triggers in gap scenarios[5][6].
Liquidity Issues in Backtesting
Liquidity is uneven across markets and timeframes. Oversimplifying it leads to false confidence.
Key Liquidity Metrics
Metric | Description | Backtest Impact |
---|---|---|
Trading volume | Shares / contracts per day | Execution ease |
Bid-ask spread | Best buy vs. sell quote | Direct trading cost |
Market depth | Orders at each level | Position sizing realism |
Liquidity Across Markets
- Forex – majors like EUR/USD have razor-thin spreads, yet these widen sharply on news.
- Stocks – large-caps trade millions daily, but small-caps may require a 0.75-1 percent slippage allowance[1].
Market Hours and Liquidity
Liquidity peaks during the London–New York overlap and ebbs in the Asian session[1].
Guidelines for realistic tests
- Cap each order to 5 percent of average daily volume.
- Model spread changes by session.
- Avoid known illiquid windows.
Measuring Slippage and Liquidity Effects
Return Calculation Methods
Method | Description | Use Case |
---|---|---|
Adjusted Close | Adds fixed 0.1 percent slippage | Long-term |
VWAP-based | Uses volume-weighted prices (VWAP indicator) | Intraday |
Tick-by-tick | Simulates against order-book data | High-frequency |
Liquidity-adjusted | Slippage scales with depth | Multi-asset |
Market-Specific Slippage Rates
Market | Asset | Typical | Stress |
---|---|---|---|
Stocks | Large-cap | 0.01-0.05 % | 0.1-0.2 % |
Stocks | Small-cap | 0.15-0.5 % | 0.5-1.5 % |
Forex | Majors | 0.1-0.3 % | 0.5-1.0 % |
Crypto | Top coins | 0.1-0.5 % | 1-5 % |
Even S&P 100 names slipped more than 1 percent on medium orders during the March 2020 crash[3].
Practical Tips for Traders
- Log execution gaps on every fill.
- Backtest under a range of market conditions.
- Flag unusual slippage to spot patterns.
Remember, slippage rises non-linearly with order size – a painful lesson from LTCM.
Reducing Backtest Accuracy Errors
Order-Book Data Integration
Historical order books clarify true market behaviour and are baked into LuxAlgo’s Price Action Concepts toolkit.
Component | Purpose | Accuracy Gain |
---|---|---|
Tick reconstruction | Captures micro moves | High |
VWAP simulation | Realistic fill prices | Medium |
Limit-order dynamics | Models matching engine | High |
Market Volatility Adjustments
- Condition-based slippage curves.
- Intraday volatility templates.
- Cross-asset correlations.
Indicators such as RSI, MACD, Bollinger Bands, Donchian Channel, Ichimoku Cloud and VWAP help visualise the volatility shifts that drive slippage.
Modern Testing Tools
Feature | Benefit | Application |
---|---|---|
High-frequency data | Minute-level realism | Intraday systems |
Custom slippage curves | Tuned for each market | Multi-asset portfolios |
Cost analysis | Tracks true expenses | Portfolio planning |
Impact simulation | Estimates order footprint | Large trades |
LuxAlgo’s AI Backtesting Assistant blends these techniques, using live slippage simulations to refine strategies.
“Including realistic slippage can trim simulated returns by 0.5-3 percent per year[7] – a vital adjustment for credible trading plans.”
Conclusion
Accurate backtests must model slippage and liquidity. Ignoring them leads to inflated performance and disappointment in live trading. Modern engines now support:
- Order-book simulation for realistic fills.
- Volatility conditioning to match regime shifts.
- Liquidity filters that skip trades no market can absorb.
LuxAlgo brings these elements together, combining hundreds of free indicators in the Oscillator Matrix toolkit, powerful signal modes in the Signals & Overlays toolkit, and its AI agent for creating trading strategies.
Finding Strategies with LuxAlgo AI Backtesting
LuxAlgo’s AI Backtesting Assistant can scan millions of pre-built strategy variations in seconds, filtering them by asset class, timeframe and risk profile. Once you spot a promising setup you can export it straight to the TradingView backtester, where you can dial in real-world parameters such as slippage, spread and commission for a more realistic simulation. The full workflow is covered in its documentation, and advanced market-pattern filters from the Price Action Concepts toolkit help you zero in on high-probability trades.
FAQs
What is the problem with backtesting?
Beyond slippage and liquidity, three more pitfalls matter:
Unrealistic liquidity assumptions – backtests often ignore changing depth, leading to over-sizing.
Execution challenges
Backtest Assumption | Reality |
---|---|
Perfect prices | 0.1-1 % slippage |
No impact | Large orders move markets |
Negligible costs | Fees can erase 30-50 % of profit |
Use out-of-sample tests, dynamic slippage curves and volume caps to keep strategies robust.
References
- Order Book Depth – LuxAlgo Library
- Order Blocks – Price Action Concepts Toolkit
- Liquidity Filters – Price Action Concepts Toolkit
- AI Backtesting Assistant – Main Page
- AI Backtesting Assistant – Documentation
- Oscillator Matrix Toolkit – Introduction
- Signals & Overlays Toolkit – Introduction
- Price Action Concepts Toolkit – Introduction
- VWAP Indicator – Periodic Close
- Ultimate RSI Indicator – LuxAlgo Library
- MACD-Based Price Forecasting – LuxAlgo Library
- Ichimoku Theories – LuxAlgo Library
- Bollinger Bands – LuxAlgo Library
- Donchian MA Bands – LuxAlgo Library
- Rolling VWAP Channel – LuxAlgo Library
- Enlightened Stock Trading (Homepage)
- Commission & Slippage Guide
- Trading Heroes – Backtesting Limitations
- Market Crash Case Study
- TrendSpider – Backtesting Risks
- Capacity in Backtesting
- Strand Package – Liquidity Study
- Source Quality & Bias
- Long-Term Capital Management (Wikipedia)
- Video – Strategy Search Demo