How Slippage, Brokerage and Market Liquidity Affect Backtesting Results
How Slippage, Brokerage and Market Liquidity Affect Backtesting Results

Introduction

Backtesting helps traders study how a trading strategy would have behaved using historical market data. It can provide useful information about entries, exits, trade frequency, drawdowns and risk. However, an impressive backtest may produce very different results in live market conditions.

Simplified backtests often assume perfect execution: every order is filled instantly, at the exact signal price and without cost. Real orders must interact with available buyers and sellers. Prices can move, charges apply, and the required quantity may not be available at one price.

Slippage, broking and market liquidity can therefore materially affect backtesting results. Their impact is especially important for intraday, scalping, options and high-turnover algo strategies.

What Is Backtesting in Algo Trading?

Backtesting applies predefined trading rules to historical data to estimate how a strategy might have performed in the past. Traders commonly review the number of trades, win rate, average trade result, drawdown, profit factor and risk-adjusted performance.

Backtesting is a research process—not a prediction. Its usefulness depends on the quality of the data, the strategy logic and the realism of its execution assumptions. Historical results do not guarantee future performance.

Why Backtested and Live Results Can Differ

A basic test may assume an order is executed at a candle’s open, close or another reference price. In live trading, the outcome can be affected by:

  • Price movement between signal and execution
  • Bid–ask spread and available market depth
  • Order size, order type and volatility
  • Broking, taxes and exchange-related charges
  • Partial fills, rejected orders or execution delays

Consequently, a strategy’s gross backtested result may differ substantially from its estimated net result after realistic trading costs.

What Is Slippage in Backtesting?

Slippage is the difference between the price expected by a strategy and the price at which an order is assumed or actually executed.

Suppose a strategy produces a buy signal at ₹500, but the order executes at ₹501. The ₹1 difference is adverse slippage. If the order executes at ₹499, it experiences favourable slippage. Conservative tests generally model a reasonable adverse allowance rather than depend on favourable fills.

Slippage may occur when the market moves quickly, the spread is wide, market depth is low, the order is large or a stop order is triggered during a sharp price move.

Market orders prioritise execution over price. Limit orders provide price control, but they may be only partially filled or not filled at all. A reliable backtest should reflect this trade-off.

How Slippage Changes Strategy Performance

Slippage can affect both sides of a trade. A higher buy price increases entry cost, while a lower sell price reduces exit value:

Net trade result = Gross trade result − Entry slippage − Exit slippage − Trading charges

Assume a strategy completes 200 trades with an average gross result of ₹120 per trade. Its theoretical gross result is ₹24,000. If combined entry and exit slippage averages ₹35 per trade, ₹7,000 is removed before broking and other charges are considered.

This matters when the average edge is small. A high win rate does not make a strategy robust if its average net gain is lower than the realistic cost of entering and exiting.

How to Model Slippage Realistically

No single assumption suits every strategy or instrument. Common models include:

  • Fixed-point slippage: Adds a fixed number of points or ticks to each order.
  • Percentage-based slippage: Applies a percentage of the expected execution price.
  • Bid–ask model: Assumes buys execute near the ask and sells near the bid.
  • Volatility-adjusted model: Increases the allowance when volatility rises.
  • Depth-based model: Estimates fills using available quantity at multiple price levels.

Instead of relying on one optimistic input, traders can test normal, moderately adverse and stressed slippage scenarios.

How Broking and Trading Charges Affect Backtesting

Borrowing is only one component of transaction cost. Depending on the instrument and segment, trades in India may also involve exchange transaction charges, Securities Transaction Tax, GST, SEBI-related fees, stamp duty and depository charges where applicable.

Charges can vary by segment, transaction type, exchange, regulation and broker pricing. Traders should use the latest official schedules and their broker’s current tariff rather than permanently hard-coding an old rate.

The NSE’s guidance on contract notes confirms that transaction charges and detailed trade information form part of trade reporting. Actual contract notes can help traders compare modelled costs with recorded costs. (NSE contract-note FAQs)

The complete relationship is:

Estimated net result = Gross result − Broking − Taxes and levies − Exchange charges − Slippage − Market impact

Why trade frequency matters

A low-frequency strategy may absorb a modest cost per trade more easily than a high-turnover strategy. Suppose two strategies produce the same gross result, but one completes 20 trades and the other completes 400. If their average round-trip cost is similar, the second strategy loses a much larger amount to transaction costs.

Turnover, average cost per trade and net expectancy should therefore be core backtesting metrics.

What Is Market Liquidity?

Market liquidity is the ability to buy or sell an instrument without causing a significant price change. It is influenced by trading activity, bid–ask spread and quantities available in the order book.

NSE explains that a liquid market allows larger orders to be executed without high transaction costs. It also distinguishes fixed charges from execution costs created by insufficient liquidity. (NSE: Impact Cost)

A liquid instrument typically has a narrow spread and adequate quantity near the best prices. An illiquid instrument may have wide spreads and limited depth, making theoretical backtest prices difficult to achieve.

Bid–Ask Spread, Market Depth and Impact Cost

The bid is the highest price a buyer is willing to pay; the ask is the lowest price a seller will accept. The difference is the bid–ask spread.

If a test buys and sells only at the last traded price, it may ignore this immediate execution cost. A more realistic model assumes buying at or near the ask and selling at or near the bid.

Spread alone does not capture the effect of a large order. If only 100 shares are available at the best ask, an order for 1,000 shares may consume multiple price levels. Its average execution price will then be worse than the displayed best ask.

NSE defines impact cost as the percentage price degradation experienced when executing a specified quantity relative to an ideal price. It changes with order size and outstanding orders, making it a practical measure of liquidity. (NSE: Impact Cost)

Liquidity also changes through the day and during volatile events. Daily OHLC data cannot show intraday changes in spread, depth or the sequence of prices within each candle. Short-term strategies may require granular data and more conservative assumptions.

Which Strategies Are Most Sensitive?

Strategy type Cost sensitivity Primary concern
Scalping Very high Tight targets may be consumed by costs.
Intraday algo strategy High Frequent orders and rapid price changes
Options strategy High Variable spreads and liquidity
Basket or multi-leg strategy High Legs may execute at different prices.
Swing strategy Moderate Gaps and stop-order slippage
Low-frequency strategy Lower Fewer trades, but liquidity still matters.

Multi-leg strategies require special attention. A test may assume all legs execute simultaneously at displayed prices. In practice, one leg can fill while another moves or remains pending. Spread, costs and possible slippage should be applied to every leg.

Practical Cost-Adjusted Backtesting Example

Consider this illustrative result for an intraday strategy:

Item Simplified test Cost-adjusted estimate
Gross result ₹60,000 ₹60,000
Broking and charges ₹0 ₹12,000
Slippage and spread ₹0 ₹9,000
Market impact ₹0 ₹3,000
Net result ₹60,000 ₹36,000

The strategy logic has not changed, but its interpretation has. The simplified result overstates the cost-adjusted estimate by ₹24,000. These figures are illustrative and do not represent expected performance or a return claim.

Common Backtesting Mistakes

Results can be overstated when traders:

  • Assume zero broking, spread and slippage
  • Execute every order at a candle’s exact close
  • Assume every limit order receives a complete fill
  • Ignore rejected orders, delays and partial fills
  • Test large quantities without checking liquidity
  • Ignore costs on individual legs of a basket
  • Optimise parameters excessively on the same data

These assumptions can introduce bias and create false confidence.

How to Make Backtesting More Realistic

Include every applicable cost.

Model broking, statutory levies, exchange charges and other relevant expenses. Review the assumptions whenever fee structures change.

Use realistic execution prices.

Where the data permits, the model buys from the ask side and sells from the bid side. Do not assume that every order executes at the last traded price.

Match order size with liquidity.

Use volume or depth filters. A strategy should not assume that a large quantity can be executed at one price when the market cannot reasonably support it.

Model missed and partial fills

Touching a limit price does not prove that the entire order would have filled. Add logical rules for incomplete orders, cancellations and rejections.

Account for execution delay.

Include a realistic delay between signal generation and assumed execution, particularly for short-term strategies. Even a brief delay can change a fill in a fast market.

Test different market regimes.

Evaluate trending, sideways, volatile and low-liquidity periods. Conduct sensitivity analysis using higher slippage, wider spreads and reduced available volume.

Validate unseen and forward data.

Develop the strategy on one dataset and validate it on unseen data. Paper trading or forward testing can then help compare simulated assumptions with live market behaviour before capital is used.

Metrics to Review After Costs

In addition to gross results and win rate, review net result, average net outcome per trade, turnover, cost per trade, maximum drawdown, profit factor, expectancy and strategy capacity at different order sizes. The difference between gross and net performance should remain clearly visible.

Conclusion

Slippage, broking and market liquidity directly affect execution prices, order completion and net strategy performance. Their influence is greatest in strategies with frequent trades, tight targets, large quantities or multiple legs.

A credible backtest should include applicable charges, realistic spread and slippage assumptions, order-size limits, missed fills and stress scenarios. Its objective is not to display the highest historical number but to provide a more honest estimate of how a strategy could behave in practical market conditions.

Bull8 helps retail users explore systematic trading ideas through backtesting and strategy tools in a structured environment. Backtest outputs should always be treated as research estimates, assessed with realistic costs and followed by appropriate risk evaluation. They do not guarantee future performance.

FAQ’s

What is slippage in backtesting?

It is the difference between the expected order price and the assumed execution price. It can result from spread, volatility, latency, order size or insufficient liquidity.

Should broking be included in every backtest?

Yes. Broking and all applicable charges should be included to estimate net performance. Use current official and broker-specific schedules.

Why does liquidity affect backtesting results?

Liquidity determines how easily an order can be filled near the expected price. Low depth can produce worse execution, partial fills and higher market impact.

Can slippage make a positive backtest negative?

Yes. A strategy with a small edge or high trade frequency may lose its theoretical advantage after realistic entry and exit slippage.

Do backtesting results guarantee live results?

No. Live results may differ due to market conditions, liquidity, execution, costs and system behaviour. Historical results do not guarantee future performance.