NineFifteenAM

The journey

Opening range breakout on Nifty: I tested 25 versions

5 min readBy NineFifteenAM

My first trading bot traded one classic idea, the opening range breakout. I built 25 versions of it on Nifty options. Here's what made the good ones good.

Short answer

I automated the opening range breakout as my first strategy and tested 25 versions on Nifty options, changing one thing at a time. The biggest lessons: win rate is a poor guide, backtests can be far too kind, entering on the first clean break beat waiting for a candle close, and with enough versions some winners are just luck — so the real winners are the ones that keep working on new trades.

My first trading bot did exactly one thing: it traded the opening range breakout.

I didn't invent it. It's one of the best-known intraday ideas there is, simple enough to automate in a weekend and popular enough that every trading forum has an opinion on it. So instead of hunting for something clever, I automated the classic and started improving it, one piece at a time.

Twenty-five versions later, the bot had run every one of them side by side on Nifty options, mostly in paper mode. Here's what that taught me, including the surprises.

What is the opening range breakout?

Watch the first few minutes after the 9:15 open and mark the highest and lowest price. That's the opening range. If price breaks above it, buy a call. If it breaks below, buy a put. Exit at a target, a stop or the end of the day.

It's popular because it's easy to define, easy to test, and there's academic research behind it. It's also easy to change — and every change is a new version to test.

The 25 versions

Each version differed from another by one thing, so I could see exactly what each change did:

What I changed Examples
Length of the range 5 minutes, 15 minutes, a custom window
How the break is confirmed First move past the level, a candle close, a retest
Which direction to trade Follow the break, fade it as a fake-out, trade the pullback after it
How to exit One fixed target, partial profit and trail, a time limit
Filters VWAP, volume, trend, the bot's own market read
Ideas from elsewhere A published research paper, and open-source trading code

How they compared

Version How it did
Pullback trade after a successful breakout Standout
Two-way breakout with partial profit and a trailing stop Standout
Breakout with a single fixed target Strong, but less steady
Same breakout with extra filters stacked on About break-even
Breakout on individual stocks About break-even
Research-paper version Didn't carry over to Nifty
Wait for a candle close before entering Clearly worse
Classic mechanical 15-minute breakout Didn't work

A handful of versions stood out, and the rest taught me something just as useful. Here are the five lessons.

1. Win rate can fool you

Some versions won most of their trades and still ended up flat. They collected lots of small wins and handed them back in a few big losses. The version with extra filters looked brilliant by win rate and was barely break-even in reality.

Now, whenever I see a strategy's win rate, the next thing I look at is the size of its average win and average loss. That one habit has saved me from a lot of false hope.

2. The backtest was far too kind

The classic 15-minute breakout arrived with a beautiful backtest: years of data, a high win rate and a smooth rising curve. Traded forward, it lost most of the time. It became my weakest version.

The backtest had quietly assumed things real markets don't give you — stops that follow the price perfectly, tick by tick, and fills at exactly the price you wanted. This turned out to be one of the most valuable results of the whole project, because it changed how I test everything. I now replay real sessions instead of trusting a neat curve.

3. Being early beat being sure

The natural fix for false breakouts is to wait for a candle to close beyond the range. So I ran a clean head-to-head: the same strategy, one version entering on the first move past the level, the other waiting for a 5-minute close.

Entering early won comfortably. Waiting did skip a few false breaks, but on the real ones it arrived after the easy part of the move was over. In a breakout, speed is part of the edge.

4. A great paper is a starting point

In 2024, Zarattini, Barbon and Aziz published a widely cited paper showing a 5-minute opening range, traded only on unusually active stocks, performed very well on US equities. I built a version that follows it as closely as I could.

On Nifty options it didn't carry over. That isn't a knock on the paper — US stocks and Indian index options behave differently. Options lose value every minute you hold them, and the Nifty index reports no volume of its own, so I had to use futures volume instead. The paper gave me ideas worth testing, and a few of them found their way into better versions.

5. The real winners keep winning

Test enough versions of anything and a few will look great by pure chance. So I set a stricter bar: does the result hold up when you look across many different days, rather than a few lucky ones?

The two standouts passed that test. Even so, I treat them as candidates that have to keep earning on new trades before they get more responsibility. That's not pessimism. It's what makes me trust the ones that make it.

What I'd do if I started again

Twenty-five versions of one idea sounds like a lot. But it gave my bot its foundation, and a way of testing that everything since has been built on.

Next in the story: letting two AI models help choose my entries — GPT vs Claude in a live trading bot. If you're setting up from scratch, start with algo trading in India: the rules, the cost, and what to do first.

Questions people ask me

Does the opening range breakout work on Nifty?

It can, but the details decide it. In my testing a few versions stood out clearly, many were ordinary, and some didn't work at all — even though they all started from the same idea. How you enter and exit matters far more than the idea itself.

Is a 5-minute or 15-minute opening range better?

Neither won on its own in my tests. The length of the range made less difference than how the trade was entered and exited. Pick one, then spend your effort on entries, exits and testing.

Why can a strategy with a high win rate still lose money?

Because the size of wins and losses matters more than how often you win. Some of my versions won most of their trades and still ended up flat or negative, because a few large losses cancelled out many small wins.

Should I wait for a candle close to confirm a breakout?

I tested this head to head: the same strategy entering on the first move past the range, versus waiting for a 5-minute candle to close beyond it. Entering early did clearly better. Waiting filtered some false breaks but gave away too much of the real moves.

How do I know a strategy result isn't just luck?

Test it on trades that happened after you picked it, and check it holds up across many different days rather than a few big ones. The more versions you try, the higher the bar should be before you call one a winner.

opening range breakoutORB strategynifty optionsbacktestingstrategy testing
N

NineFifteenAM

One trader building an options bot for Indian index markets since early 2026. I write down how it is built, what broke, and what it cost — no tips, no calls, no returns.

Related

27 Sept 2026
GPT vs Claude in a live trading bot: letting two AIs voteI asked GPT and Claude to read the same Nifty chart thousands of times and made them vote on my trades. What I learned about using AI in a trading bot.
The journey
27 Sept 2026
Zerodha Kite Connect: get your API key and refresh the token dailyA short, practical guide to getting a Kite Connect API key and handling the access token that expires every morning.
Guides
26 Sept 2026
Algo trading in India: the rules, the cost, and what to do firstWhat the law requires of a retail algo trader in India, what a system costs to run after the April 2026 STT change, and the order to build it in.
Guides