How to Backtest Algo Trading Strategies: Intraday, BTST, Positional & More (Step-by-Step)

Every profitable-looking strategy has a backstory. Most of the time, that backstory is a backtest.

Before you risk a single rupee of margin, backtesting lets you replay a strategy against years of real market data and see, honestly, whether it holds up. It's the step between "I have an idea" and "I have evidence."

This guide covers two things:

  • What actually makes a backtest reliable — principles that apply no matter which platform you use

  • How to run each type of backtest on AlgoTest, step by step

What a Backtest Actually Tells You

A good backtest isn't just a profit number. It's a report card across several dimensions:

  • Win rate — how often the strategy makes money, not just whether it's profitable overall

  • Maximum drawdown — the worst peak-to-trough loss you'd have had to sit through

  • Consistency — whether returns hold up across different months, or depend on one lucky quarter

  • Cost sensitivity — whether the edge survives once brokerage, slippage, and taxes are subtracted

  • Regime dependence — whether the strategy only works in trending markets, or sideways ones, or both

  • Risk-adjusted return (Sharpe ratio) — whether the returns justify the risk taken, not just the raw profit number

If you only look at the total P&L, you're missing most of what a backtest is actually for.

Popular read: 5 Mistakes Traders Make in Algo Trading

5 Things That Make a Backtest Trustworthy

Backtesting is easy to do badly. These five checks apply whether you're using AlgoTest, a spreadsheet, or a Python script.

1. Realistic Costs

Brokerage, STT, exchange charges, and slippage all eat into returns. A backtest that ignores them will always look better than real trading does.

2. Enough History, Across Regimes

A strategy tested only on the last three bullish months tells you almost nothing about how it behaves in a volatile or sideways market. Aim for multiple years and multiple market conditions.

3. Mechanical Rules, Not Vibes

"Sell when it feels toppy" can't be backtested. Every entry, exit, and adjustment needs a rule specific enough that a computer — or a stranger — could execute it without asking you a follow-up question.

4. Out-of-Sample Validation

If you tweak a strategy until it looks perfect on your test data, you've probably just fit the past, not found an edge. Hold back a chunk of data you don't touch until the strategy is finalised, then check it there.

5. Enough Trades to Mean Something

Ten trades over one expiry can look great by luck alone. Look for a large enough sample — ideally 100+ trades across a couple of years — before trusting the numbers.

The Main Types of Algo Strategies You Can Backtest

Most retail algo strategies in India fall into a few structural buckets:

  • Intraday — entered and exited within the same trading day, with no overnight exposure

  • BTST (Buy Today, Sell Tomorrow) — positions held overnight and squared off the next session

  • Positional — held across multiple days, often tied to how many trading days remain before expiry

  • Indicator/signal-based — entries and exits driven by technical conditions (EMA crossovers, RSI, SuperTrend) rather than a fixed clock time

  • Crypto — the same structures, applied to BTCUSD or ETHUSD instead of NSE indices

Each of these needs slightly different settings once you actually sit down to backtest it — which is where a purpose-built platform saves a lot of manual setup.

How to Backtest Algo Trading Strategies on AlgoTest

AlgoTest is built specifically for Indian options and futures traders, with a no-code strategy builder and 7.5+ years of historical NSE data behind every backtest. You get 25 free backtests every week to start.

The core workflow stays the same regardless of strategy type:

  1. Create a strategy from the AlgoTest dashboard

  2. Set your Strategy Type — Intraday, BTST, or Positional

  3. Choose your index or stock, and whether strikes are based on Cash or Futures price

  4. Build your legs (option type, position, strike selection, expiry) using the leg builder

  5. Add stop-loss, target, and re-entry rules

  6. Save the strategy, pick your date range, and click Backtest

Here's how the settings shift depending on what you're testing.

Backtesting an Intraday Strategy

Intraday strategies enter and exit within the same session, so the settings you'll configure are:

  • Entry Time and Exit Time — when the strategy activates and when it force-closes for the day

  • Restrict Re-entry Time — an optional cutoff after which the strategy won't take a fresh entry

  • Partial or complete square-off — whether a stop-loss or target closes the whole position or just part of it

Once your legs and stop-loss rules are in place, save the strategy, pick a backtest window, and run it.

how to backtest algo trading strategies

Backtesting a BTST Strategy

BTST strategies carry a position overnight, which introduces gap risk that intraday strategies don't have. AlgoTest's BTST backtest includes one setting worth knowing about:

  • Delayed Restart — by default, overnight positions are marked to the 9:15 AM price. Turning this on exits at 9:16 AM (or a time you choose) instead, which is a fairer real-world number, since gap-ups and gap-downs at the open can move prices sharply before you'd realistically be able to react.

Beyond that, the same square-off and leg-builder settings from intraday carry over.

Backtesting a Positional Strategy

how to backtest algo trading strategies

Positional strategies hold across several days and are usually built around how far out the expiry is, rather than a fixed calendar date. The settings that matter most here:

  • Trading days before expiry (DTE) — instead of picking a fixed date, you set entry/exit relative to expiry (for example, "5 trading days before expiry"), so the same logic applies automatically to every future expiry cycle

  • Weekly vs. monthly expiry — positional strategies can behave differently depending on which expiry cycle you're targeting, so it's worth testing both if your strategy could apply to either

  • SEBI expiry-change toggle — a toggle lets you include or exclude backtest data from before the latest SEBI expiry-day changes, since market behaviour shifted meaningfully around that change

Backtesting the 920 Straddle

The 920 Straddle is one of the most widely used intraday strategies in India — selling an ATM call and an ATM put around 9:20 AM to capture premium decay once the opening volatility settles. It's worth knowing how to set up, since the same leg-builder logic applies to most other straddle and strangle variants:

  • Set Strategy Type to Intraday, Entry Time to 9:20, and Exit Time to your chosen square-off (commonly 3:10 PM)

  • Add a Sell ATM Call leg — Options segment, 1 lot, Sell, Call, Weekly expiry, ATM strike

  • Add a Sell ATM Put leg with the same settings, swapping Call for Put

  • Set a stop-loss (a common starting point is 25% per leg, or a combined-premium stop)

  • Save and backtest across a few years to see how it holds up across different volatility regimes

Backtesting Crypto Strategies (Delta Exchange)

how to backtest algo trading strategies

If you trade BTCUSD or ETHUSD, AlgoTest lets you backtest crypto strategies through the same interface used for indices and stocks, powered by Delta Exchange data:

  • Select BTCUSD or ETHUSD from the Index dropdown

  • Choose Cash or Futures as your underlying

  • Pick Intraday, BTST, or Positional as the strategy type, same as you would for NSE indices

  • Build Options or Futures legs the same way — lot size, position, strike selection, expiry

For more details, read the 'How to Master Backtesting on AlgoTest' doc

Comparing and Combining Backtests

Once you've run a few backtests, two features help you move from "I have a strategy" to "I have a system":

Common Backtesting Mistakes to Avoid

  • Testing only recent, bullish data — a strategy that only survives calm uptrends isn't tested; it's untested with extra steps

  • Ignoring slippage and brokerage — this is usually the single biggest gap between backtested and live returns

  • Over-optimising strike distance or stop-loss % until the backtest looks perfect — this often means you've fit noise, not found an edge

  • Skipping forward testing — a backtest validates the logic; forward testing (paper trading) validates the execution, including delays and fills a backtest can't fully model

  • Confusing correlation with diversification — two strategies that look uncorrelated over one year can move together the moment markets get volatile

For worked examples across straddles, strangles, and iron condors, AlgoTest's detailed guide on backtesting options strategies walks through entry rules, strike selection, and what to look for in the results.

Still comparing platforms before committing to one? These two roundups are worth a look: the best free backtesting and trading tools in India, and a closer comparison of backtesting software built specifically for options trading.

Join Us as We Simplify Algo Trading in India

Backtesting is what separates a strategy you believe in from one you've actually proven. Skip it, and you end up paying tuition in live capital for lessons a free backtest could have taught you in seconds.

Sign up for free and get the full AlgoTest toolkit built for Indian options traders:

Backtesting tests your strategy against years of historical data before you risk real money.

Forward testing validates the strategy on live market data without putting any capital at risk.

→ The strategy builder lets you build and customize strategies with a no-code interface.

→ The simulator lets you practice execution in real market conditions using virtual capital.

From pricing a single option to running a full strategy, AlgoTest gives you the tools to trade with more confidence and less guesswork.

Run your first backtest today.

Frequently Asked Questions

How many free backtests do I get on AlgoTest?
25 free backtests every week, with paid plans available if you need to run more.
Can I backtest crypto strategies on AlgoTest?
Yes - BTCUSD and ETHUSD, using Delta Exchange data, with the same Intraday/BTST/Positional structure available for index and stock options.
How much historical data should I use to backtest a strategy?
Aim for at least 1-3 years, covering trending, sideways, and volatile periods. Testing on a single market regime tends to overstate how reliable a strategy really is.
Does a good backtest guarantee live profitability?
No. Backtesting validates the logic, not the execution. Slippage, broker congestion, and liquidity gaps can all cause live results to differ from a backtest - which is why forward testing is a required next step, not an optional one.
What's the difference between backtesting and forward testing?
Backtesting runs your strategy against historical data to see how it would have performed. Forward testing (paper trading) runs it in live market conditions using virtual capital, so you can see how execution behaves in real time before risking money.
Can I backtest options strategies without coding?
Yes. AlgoTest's strategy builder is entirely no-code - you configure legs, entry/exit rules, and risk settings through a visual interface, and the backtest engine handles the historical data matching in the background.