Learn Algo Trading Step by Step

Week 6: Build Your First Backtest

Back to Learn Algo Trading Step by Step
Lesson 7 of 14·intermediate
Written by Amit Khari·Reviewed by Pramita Singh·Published on 30 August 2026·Last updated on 30 August 2026

Week 6: Build Your First Backtest

Now convert your strategy rules into a historical test. You can use a no-code backtesting platform, a spreadsheet for a very simple strategy, Python with Pandas, or a dedicated backtesting framework.

Your backtest should record, for every trade

  • Date and time of the signal
  • Entry and exit prices, and quantity
  • Stop-loss and target
  • Gross profit or loss
  • Brokerage and estimated charges
  • Slippage and the net result
  • Reason for exit

Include realistic costs

A strategy that appears marginally profitable before costs may become unprofitable after them. Account for:

  • Brokerage
  • Securities transaction tax (STT)
  • Exchange and regulatory charges
  • GST and stamp duty where applicable
  • Bid-ask spread and slippage

Week 6 outcome

You should have a trade-by-trade backtest rather than only a final profit figure.

This lesson is for educational purposes only. It is not investment advice, a recommendation or an assurance of returns. Trading and derivatives involve substantial risk, and backtested or paper-trading results do not guarantee future performance.

About the author

Amit Khari
Amit KhariContributor, LiveWorldMarket

NISM-Series-X-A Investment Adviser Level 1 examination completed

Amit writes about Indian equity markets, technical analysis, macro themes and the day-to-day mechanics of trading, with a focus on making the flow of global markets legible for retail investors. He has completed the NISM-Series-X-A Investment Adviser Level 1 examination.