Get your API key

Lesson 4 of 5

Costs, slippage and honest numbers

Indian trading costs per trade, slippage, and a report with CAGR, max drawdown, trade count and time in the market.

9 min Log in to open

Education only. This is not investment advice and nothing here is a buy or sell recommendation. Trading carries risk of loss, and past results do not predict the future. Backtests are hypothetical: practise on paper only, never connect broker API keys or place live orders from these lessons. For personal advice, talk to a SEBI-registered Investment Adviser.

One step at a time, like flipping pages.

By the end of this lesson you will subtract real-world costs from every trade, read CAGR, max drawdown and trade count, and write a one-page honest report for any backtest.

You need: backtest.py and data/backtest_rows.csv from lesson 3, your coding agent · Time: 9 minutes

  1. In India, each buy or sell of shares pays several costs on top of the price:

    • Brokerage: your broker's fee. Zero for some delivery trades, a flat fee or a percentage for others.
    • STT (securities transaction tax): a tax set by the government, different for delivery, intraday and derivatives. Rates change: for example, STT on futures and options went up from 1 October 2024.
    • Exchange transaction charges and the SEBI turnover fee: small charges per trade.
    • GST: on brokerage and charges.
    • Stamp duty: on the buy side.
    • Slippage: not a fee, but real. The price you actually get is often a little worse than the price you saw.

    Your broker's charges page and your contract note (the document you get after every real trade) show the exact numbers. For a backtest, add them up into one cost per buy or sell, as a percentage.

    Match them

    Match each cost with what it is

    Tap an item on the left, then its meaning on the right.

    Why?

    SEBI found that individual traders in equity derivatives paid about ₹25,000 crore in transaction costs in FY26 alone. Costs are certain; profits are not. A backtest without costs is testing a market that doesn't exist.

Log in free to read the rest of this lesson

Every lesson is free. A free account unlocks all of them and saves your progress.

Still to come in this lesson:

  1. Put costs in the code
  2. Read the numbers honestly
  3. Write the honest report
  4. Recap