Aliceblue ANT
Aliceblue ANTInstall and trade smarter everywhere

Slippage and Impact Cost in Algo Trading: Why Backtest Returns Differ From Live Trading

Blog by Aliceblue News Desk

21 October 2026

15 minutes

Your algo strategy may look profitable in a backtest, but live trading can give a lower return. The main reasons are slippage, impact cost, latency, partial fills, brokerage, STT, and other charges that a basic backtest may not include correctly.

Slippage is the difference between the price your algo expects and the price at which the order actually fills. Impact cost is the extra cost of buying or selling a large quantity when there are not enough shares available at the best price. Both reduce live returns, which is why backtest profits do not always repeat in real trading.

Table of Contents

  1. What Is Slippage and Impact Cost in Algo Trading?
  2. What Is Slippage in Algo Trading?
  3. What Is Impact Cost in the Stock Market?
  4. Slippage and Impact Cost Example With Numbers
  5. Why Do Backtest Returns Differ From Live Algo Trading?
  6. How to Calculate Real Profit After Slippage and Charges
  7. How to Reduce Slippage and Impact Cost in Algo Trading
  8. Slippage vs Impact Cost vs Bid-Ask Spread
  9. Common Mistakes That Increase Execution Costs
  10. Who Should Pay Attention to These Costs?
  11. Conclusion
  12. Frequently Asked Questions
  13. Valid Sources

What Is Slippage and Impact Cost in Algo Trading?

Suppose your backtest shows a strategy earning a steady profit over five years. You deploy it live and find that the profit is smaller. The strategy rules have not changed, but the cost of entering and exiting trades has reduced the final result.

That gap often comes from slippage and impact cost in algo trading.

Slippage is the difference between the price your algorithm expects and the price at which the order actually fills. If your algo wants to buy a stock at ₹1,000 but the order fills at ₹1,000.50, you have paid ₹0.50 more than planned.

Impact cost is the extra cost that appears when your order is large compared with the shares available at the best price. Your order may consume several price levels in the order book, increasing your average buy price or reducing your average sell price.

Both are execution costs. They do not appear as a separate line called slippage on your contract note, but they reduce the money you keep from each trade.

What Is Slippage in Algo Trading?

Slippage happens because there is a gap between the moment your strategy generates a signal and the moment your order is matched on the exchange.

The usual sequence is:

  1. Your algo spots a signal. For example, it decides to buy Nifty futures when the price crosses above a moving average.
  2. The order is created and sent through your strategy, broker API, risk checks, and the exchange.
  3. The market moves. Other buyers may have already taken the available sell orders.
  4. Your order fills at a new price. A buy order may fill above the expected price, while a sell order may fill below it.
  5. Your profit per trade changes. Even ₹0.20 or ₹0.50 per share can matter when the strategy trades many times.

Slippage can be positive or negative. If you place a buy order and the price falls before execution, you may get a better price. But algo traders mostly focus on negative slippage because it reduces expected profit.

Slippage is usually higher when:

  • The market is moving quickly.
  • The stock or contract has low trading volume.
  • You use a market order instead of a limit order.
  • You trade near market open, during news, or close to expiry.
  • Your order size is large compared with normal volume.

A backtest may assume that the buy signal price and the actual fill price are the same. Live trading rarely works that neatly. Broker documentation notes that live results can differ from backtests because of slippage, liquidity, fast price movement, order execution, brokerage, taxes, and other charges.

What Is Impact Cost in the Stock Market?

Impact cost is a measure of how expensive it is to trade a particular quantity in a stock. It is closely linked to liquidity.

Liquidity means how easily you can buy or sell without moving the price much. A liquid stock has many buyers and sellers, so normal-sized orders usually fill close to the quoted price. An illiquid stock has fewer orders waiting in the market, so a larger order may have to buy from several sellers at rising prices.

NSE explains that impact cost is the percentage difference between the price actually achieved for an order and the ideal price. The ideal price is the average of the best bid and best ask price. NSE also states that impact cost changes with order size, is calculated separately for buying and selling, and depends on the orders available at that moment.

Simple example

Imagine you want to buy 10,000 shares of a small-cap stock.

Available sell orders

Price

Shares available

First level

₹100.00

2,000

Second level

₹100.30

3,000

Third level

₹100.80

5,000

Your algo wanted to buy at ₹100. But to buy all 10,000 shares, it must buy from all three levels.

The average buy price is:

(2,000 × 100) + (3,000 × 100.30) + (5,000 × 100.80) divided by 10,000

This equals ₹100.49 per share.

You paid ₹0.49 per share more than the first available price. That is the impact cost. The larger your order, the more likely it is to move through several price levels.

This is why a stock may look cheap on a chart but become expensive to trade in size. The chart shows the last traded price. It does not show whether enough shares are available at that price for your order.

Slippage and Impact Cost Example With Numbers

NSE provides a useful example of how impact cost works.

In its example, the best bid is ₹3.50 and the best ask is ₹4.00. The ideal price is therefore ₹3.75, which is the average of the two prices.

If a trader sells 4,000 shares, the available buy orders are:

Buy order level

Price

Shares available

Value

Level 1

₹3.50

1,000

₹3,500

Level 2

₹3.40

1,000

₹3,400

Level 3

₹3.40

2,000

₹6,800

Total

 

4,000

₹13,700

The average sale price is ₹13,700 divided by 4,000 shares, which equals ₹3.43 per share.

The ideal price is ₹3.75. The sale price of ₹3.43 is 8.53% worse than the ideal price. NSE describes this as the impact cost faced in selling 4,000 shares.

This example shows why a larger order can face a worse average price. The first 1,000 shares may sell at ₹3.50, but the remaining shares must be sold at lower prices because there are not enough buyers at the better price.

Slippage example

Now take a simple intraday strategy on 1,000 shares of a liquid large-cap stock.

What the backtest assumes:

  • Buy price: ₹1,000
  • Sell price: ₹1,010
  • Gross profit per share: ₹10
  • Gross profit for 1,000 shares: ₹10,000

What may happen live:

  • Buy order fills at ₹1,000.40 instead of ₹1,000
  • Sell order fills at ₹1,009.50 instead of ₹1,010

Actual profit per share:

₹1,009.50 minus ₹1,000.40 equals ₹9.10

For 1,000 shares:

₹9.10 × 1,000 equals ₹9,100

You lose ₹900 to slippage before brokerage, STT, exchange transaction charges, GST, stamp duty, and other costs.

If the strategy takes 10 trades a day and the same slippage repeats, execution alone can cost about ₹9,000 a day. Add brokerage and statutory charges, and a strategy that looked profitable on paper may become marginal.

Why Do Backtest Returns Differ From Live Algo Trading?

A backtest replays historical data and checks whether your rules would have made money. It is useful, but it cannot fully recreate live market conditions.

1. Backtests often assume full fills

Many backtests assume that when the strategy says buy 1,000 shares, all 1,000 shares fill at the signal price. In live trading, the order may fill partly, at different prices, or not at all if you use a limit order.

2. Historical candles do not show the order book

A candlestick shows the open, high, low, and close for a period. It does not show how many shares were available at each price level at that exact second.

Your algo may see a buy signal at ₹500, but there may be only 200 shares available at ₹500. The remaining 800 shares may be available at ₹500.20, ₹500.40, or higher.

3. Latency delays execution

Latency is the delay between signal generation and order execution. It can come from your internet connection, the algo platform, broker systems, order validation, and exchange matching.

In a fast-moving market, even a few seconds can change the fill price.

4. Liquidity changes through the day

A stock may have good average volume, but liquidity can fall during the first few minutes, lunch hours, news events, or sharp market moves. A strategy that works well in a backtest may face poor fills during exactly the periods when it trades most.

5. Costs are sometimes underestimated

A backtest should include:

  • Brokerage
  • STT
  • Exchange transaction charges
  • SEBI charges
  • Stamp duty
  • GST
  • Slippage
  • Impact cost
  • API or platform charges, if applicable

If the backtest includes only brokerage, it will overstate the likely return. FYERS specifically notes that live performance can differ because of slippage, liquidity, charges, and market conditions.

6. The strategy may be overfitted

Overfitting happens when a strategy is adjusted too much to past data. It may have many rules that fit old price movements but do not work when market behaviour changes.

For example, a strategy with 15 conditions may look excellent from 2019 to 2023. But if those conditions were selected only because they fit that period, the strategy may fail in a different market phase.

7. Market conditions change

A strategy designed for trending markets may suffer when the market moves sideways. A strategy built for low volatility may face larger losses when volatility rises. A backtest cannot guarantee that future market behaviour will match the tested period.

8. How to Calculate Real Profit After Slippage and Charges

Use this formula before deploying an algo strategy:

Net profit per trade = Gross profit minus Slippage minus Impact cost minus Brokerage minus STT and other charges

Suppose your backtest shows an average gross profit of ₹15 per share.

Cost head

Assumed cost per share

Slippage

₹2

Impact cost

₹1

Brokerage, STT, and other charges

₹3

Total cost

₹6

Your realistic profit per share is:

₹15 minus ₹6 equals ₹9

That may still be workable. But if your gross profit is only ₹7 per share, the same ₹6 cost leaves just ₹1 per share. One unusually bad fill can turn the trade into a loss.

A useful rule: if execution costs and charges take away more than 30 to 40 percent of your expected gross profit per trade, test the strategy more carefully before scaling it.

How to Reduce Slippage and Impact Cost in Algo Trading

These costs cannot be removed, but they can be reduced.

1. Trade liquid instruments

Start with liquid large-cap stocks, index futures, and actively traded options. Nifty and Bank Nifty contracts usually have more participants and tighter pricing than low-volume stock derivatives.

Avoid illiquid small caps and deep out-of-the-money options unless your strategy specifically accounts for their poor liquidity.

2. Use limit orders where suitable

A market order buys or sells immediately at whatever price is available. It gives execution certainty but can face a worse price in a fast market.

A limit order tells the exchange the maximum price you are willing to pay for a buy order, or the minimum price you will accept for a sell order. It gives you price control, but the order may not fill if the market moves away.

Many algo traders use limit orders for entries where price control matters and market orders for exits where getting out quickly matters more.

3. Keep order size realistic

Do not send one large order if the stock normally trades in small quantities. If your strategy needs 50,000 shares but only 5,000 shares are available near your target price, split the order.

Order slicing means sending smaller orders over time instead of one large order. It can reduce impact cost, though it also introduces timing risk because the price may move while the remaining quantity is still pending.

4. Avoid poor liquidity periods

The first few minutes after market open can have wider spreads and fast price movement. News announcements, quarterly results, expiry day moves, and sudden index level volatility can also worsen execution.

If your strategy does not specifically depend on the opening move, consider avoiding the first few minutes.

5. Measure expected versus actual fills

Maintain a simple execution log:

Field

Example

Date and time

14 October, 10:15 AM

Stock or contract

Reliance Industries

Signal type

Buy

Quantity

500 shares

Expected price

₹2,900

Actual fill price

₹2,900.60

Slippage per share

₹0.60

Total slippage

₹300

Charges

₹120

Net trade result

Calculated after exit

After 50 or 100 trades, you will know whether slippage is a minor cost or a major problem for that strategy.

6. Add a slippage buffer in backtests

Do not test a strategy assuming every trade fills at the exact signal price. Add a realistic buffer based on the instrument and order size.

For example, if your strategy earns ₹10 per share and historical testing shows average slippage of ₹1.50 per share, test the strategy with ₹1.50 to ₹2 per share as a cost. If it remains profitable after that buffer, it has a better chance of surviving live trading.

Slippage vs Impact Cost vs Bid-Ask Spread

These three terms are related, but they are not the same.

Parameter

Bid-ask spread

Slippage

Impact cost

Meaning

Difference between the best buy and best sell price

Difference between expected and actual fill price

Extra cost when a large order consumes available liquidity

Main cause

Difference between buyer and seller quotes

Delay, volatility, order type, and changing quotes

Low market depth relative to order size

When it matters

Every trade

Almost every live trade

Mostly large orders or illiquid instruments

Example

Best bid ₹100, best ask ₹100.10

Buy signal at ₹100.10, fill at ₹100.30

Buying 50,000 shares pushes the average price above ₹100.10

How to manage it

Choose liquid instruments

Use limit orders, avoid volatile periods, reduce latency

Reduce order size, slice orders, trade deeper markets

The bid-ask spread is already visible in the market before you trade. NSE explains that the spread represents the transaction cost for a small trade, while impact cost becomes relevant for larger orders that must use several price levels.

Common Mistakes That Increase Execution Costs

1. Using market orders for large quantities

A market order may be fine for a small quantity in a liquid stock. But for thousands of shares, it can fill across several price levels and increase your average cost.

Do this instead: Check available quantity near your price, then use limit orders or split the order.

2. Trading illiquid instruments

A low-volume stock or option may show an attractive price on the chart, but the order book may be thin. Exiting can become difficult during a sharp move.

Do this instead: Check average volume, open interest for derivatives, and the quantity available near your entry price.

3. Ignoring partial fills

Your algo may plan to buy 2,000 shares, but only 700 fill. If the strategy does not handle the remaining quantity, it may take an unintended position.

Do this instead: Decide in advance whether to wait, cancel, reprice, or cancel the unfilled part after a set time.

4. Backtesting with unrealistic fills

Assuming every trade fills at the exact signal price makes results look better than they are.

Do this instead: Add slippage, use conservative fill assumptions, and include all charges.

5. Overtrading

A strategy that earns ₹3 per trade but takes 40 trades a day may lose its edge after slippage and charges.

Do this instead: Calculate net profit after all costs. If the cost per trade is close to the expected profit, reduce trade frequency or improve the entry logic.

6. Changing the strategy after a few losses

A few losing trades do not prove a strategy has failed. But repeatedly overriding the algo, increasing quantity after losses, or disabling stop losses can create larger problems.

Do this instead: Set a maximum daily loss, maximum drawdown, and review period before going live.

Who Should Pay Attention to These Costs?

Slippage and impact cost matter most if:

  • Your strategy trades several times a day.
  • You trade futures and options.
  • You use market orders.
  • You trade illiquid stocks or option strikes.
  • Your expected profit per trade is small.
  • You place large orders relative to normal volume.

It matters less for a long-term investor who buys a diversified basket of liquid stocks or index funds and holds for years. Even then, it is sensible to avoid illiquid stocks and to place large orders carefully.

Conclusion

A backtest is not a promise of future returns. It is only a starting point. Slippage and impact cost explain much of the difference between backtest results and live algo trading results.

Before deploying a strategy, add realistic slippage assumptions, include every charge, choose liquid instruments, control order size, and track actual fills against expected prices. If the strategy still leaves a reasonable profit after these costs, it has a better chance of working in live trading.

Frequently Asked Questions

Edit Content

Slippage is the difference between the price your algo expects and the price at which the trade actually fills. It usually happens because of latency, volatility, or limited liquidity.

Edit Content

Impact cost is the extra cost of executing a large order because there are not enough shares available at the best price. Your order may consume several price levels, increasing the average buy price or reducing the average sell price.

Edit Content

Backtests may not include realistic slippage, partial fills, latency, changing liquidity, and all transaction costs. Live markets also change, so past performance does not guarantee future results.

Edit Content

Yes, but usually in a different way. A limit order controls the maximum buy price or minimum sell price, but it may not fill if the market does not reach that price. If it fills after the price moves, the realised result can still differ from the original signal.

Edit Content

There is no fixed number for every strategy. Use a buffer based on the instrument liquidity, your order size, and your historical live fills. For a beginner, testing with a conservative slippage assumption is safer than assuming zero slippage.

avatar

Blog by Aliceblue News Desk

The Alice Blue Research Team is a passionate group of analysts delivering expert market insights, comprehensive coverage of stocks, economy, commodities, and personal finance through clear, actionable research.

Take your first step into the market with ₹0 opening charges

Open Free Demat Account
Alice Blue mobile app with 1lyAlgos