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.
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.
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:
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:
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.
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.
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.
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.
Now take a simple intraday strategy on 1,000 shares of a liquid large-cap stock.
What the backtest assumes:
What may happen live:
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.
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:
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.
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.
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.
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.
Slippage and impact cost matter most if:
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.
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.
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.
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.
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.
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.
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.
Attention Investors!
Stock Brokers can accept securities as margin from clients only by way of pledge in the depository system w.e.f. September 1, 2020. Update your mobile number & email Id with your stock broker/depository participant and receive OTP directly from the depository on your email id and/or mobile number to create a pledge. Pay 20% upfront margin of the transaction early to trade in the cash market segment. Investors may please refer to the Exchange’s Frequently Asked Questions (FAQs) issued vide circular reference NSE/INSP/45191 dated July 31, 2020, and NSE/INSP/45534 dated August 31, 2020, and other guidelines issued from time to time in this regard. Check your Securities /MF/ Bonds in the consolidated account statement issued by NSDL/CDSL every month.
Corporate Office: No. 153/2, 3rd Floor, M.R.B.Arcade, Bagalur Main Road, Dwaraka Nagar, Yelahanka, Bengaluru – 560 063, Karnataka.
Registered Office: Old No.56/2 ,New No.58, LIC Nagar, Vinayagar Kovil Street, Erode -8,Tamil Nadu– 638002.
Alice Blue Financial Services (P) Ltd : NSE EQ | NSE FO | NSE CDS-90112 SEBI REG : INZ000156038
Alice Blue Financial Services (P) Ltd : BSE EQ | BSE FO | BSE CD-6670 SEBI REG : INZ000156038
Alice Blue Financial Services (P) Ltd : CDSL DP ID 12085300 DP SEBI REG : IN-DP-364-2018
Alice Blue Financial Services (P) Ltd : MCX-56710 SEBI REG : INZ000156038
We hereby declare that we are doing PRO trading
Procedure to file a complaint on SEBI SCORES : Register on SEBI SCORES 2.0. Mandatory details for filing complaints on SCORES: Name, PAN, Address, Mobile Number, E-mail ID. Benefits: Effective Communication, Speedy redressal of the grievances
Click on the provided link to learn about the process for submitting a complaint on the ODR platform for resolving investor grievances.
Investment in securities markets are subject to market risks, read all the related documents carefully before investing. Brokerage will not exceed SEBI prescribed limit.
For queries regarding account opening or activation, email to [email protected] and for fund updates, email to [email protected]
Disclaimer : Prevent unauthorized transactions in your account. Update your mobile numbers/email IDs with your stock brokers. Receive information of your transactions directly from Exchange on your mobile/email at the end of the day. Issued in the interest of investors. All clients have to update their email id and mobile number with Member : Investor Grievance [email protected]
KYC is a one time exercise while dealing in securities markets – once KYC is done through a SEBI registered intermediary (broker, DP, Mutual Fund etc.), you need not undergo the same process again when you approach another intermediary.
No need to issue cheques by investors while subscribing to an IPO. Just write the bank account number and sign in the application form to authorise your bank to make payment in case of allotment. No worries for refund as the money remains in the investor’s account.
Investors are requested to note that Alice Blue Financial Services Private Limited is permitted to receive money from investor through designated bank accounts only named as Up streaming Client Nodal Bank Account (USCNBA). Alice Blue Financial Services Private Limited is also required to disclose these USCNB accounts to Stock Exchange. Hence, you are requested to use following USCNB accounts only for the purpose of dealings in your trading account with us. The details of these USCNB accounts are also displayed by Stock Exchanges on their website under “Know/ Locate your Stock Broker. Bank Details (Valid UPI FAQ).