We'll help you map out a plan to fix the problems in your trading and get you to the next level. Answer a few questions on our application and then choose a time that works for you.
BOOK YOUR FREE STRATEGY SESSION NOW >>The Opening Range Breakout is a simple but interesting intraday strategy. Ever heard of it?
In this video, we test it on the Nasdaq futures, focusing only on the cash session (08:30–15:00 CME time).
We start with the logic, move on to the code, and then analyze the performance.
Here’s what you’ll see:
•How the strategy is built using the first bar of the day
•A weekday-based filter that significantly improves short trades
•Equity line, average trade, and ideas for further development
It’s not ready to go live just yet… but we’re getting close.
How would you improve it?
Enjoy the video!
Introduction to the Opening Range Breakout
Today, we’re going to take a look at a very interesting intraday strategy, which became popular in the 1980s thanks to Toby Crabel.
I’m talking about the Opening Range Breakout.
But what does it actually consist of? It’s a strategy that takes advantage of the range formed in the first few minutes of a market’s trading session, what we define as the opening range.
Basically, we go long or short at the breakout of these levels to take advantage of a directional move that should occur after the initial stages of the session opening.
Focus on the Nasdaq Cash Session
So, let’s move to the chart to better understand how it works, and let’s walk through an example using the Nasdaq.
And here we are in front of the chart. As you can see, I’ve already set up the Nasdaq future.
One important thing to keep in mind before diving into how the strategy works is that this future is open 23 hours a day.
However, we’re not going to consider the entire trading day, but we’ll focus exclusively on what’s defined as the cash session, which is the part that overlaps with the stock markets being open.
In this case, since the Nasdaq is listed on the CME in Chicago, it runs from 8:30 a.m. exchange time until 3:00 p.m.
To make this point clear, I’ve added bar-by-bar volume data right here.
And as you can see, until 8:30 a.m., there isn’t much volume. But after 8:30, once the cash session starts, the volume picks up significantly.
Building the Strategy and Setting Up Orders
Great, now let’s talk about the Opening Range Breakout.
As we said before, what we need to do is take the first bar of the session — in this case, the cash session — and identify the high and the low of that bar.
Here, I’ve set a 30-minute time frame, so the first bar we’ll use to calculate the Opening Range Breakout is the one that goes from 8:30 to 9:00.
Of course, there are multiple variants. You could calculate the Opening Range Breakout using 5-minute bars or 15-minute bars. But in those cases, we’d likely be facing more false signals.
Once we’ve identified this high level and this low level, we’ll place stop orders and enter a position at the breakout of these levels, as you can see here in this example.
Code Analysis and Operational Logic
Now let’s go and take a look at the code, because there are some interesting points to discuss.
Here in the initial section, I simply defined two variables that capture the high and the low — these two levels you see here — which are then used to determine the breakout points.
Some of you might be wondering why I didn’t set time = 8:30 here but instead used 9. The reason is simply that the bar from 8:30 to 9:00 gets a timestamp of 9.
Then, I set a time window for trading operations, which matches the cash session. So, we’ll only buy or sell at the breakout of these levels during the cash session.
Here, we have the buy and sell orders that enter us into a position, and we also have exit conditions in case the price breaks through the opposite level from the one initially triggered.
Finally, I’ve added a “set exit on close” because this is an intraday strategy, and I’ve set both a stop loss and a take profit at $2,000 and $5,000 respectively, just to eliminate outliers during development.
I want to stress that these values are probably not optimal, but we can optimize them or fine-tune later on.
For this initial development phase, since these values make logical sense and help eliminate outliers, I’ll keep them as they are.
Initial Performance and Equity Line
Alright, now let’s look at the performance results.
Here, as you can see, with an equity line based on buying one contract per trade, we’re seeing very solid growth.
What’s interesting is that this growth is clearly positive on the long side — and for those with experience in systematic trading, it’s not too difficult to build something that works using a breakout on this instrument.
But what’s also noteworthy is that on the short side, the performance is not bad at all, even though the buy-and-hold strategy for this instrument — which you can see here — is quite bullish.
Let’s now analyze the strategy’s average trade.
As you can see, this strategy places a large number of trades — more than 6,190 — with about 3,200 on the long side and nearly 3,000 on the short side.
What jumps out immediately is that the average trade, assuming one contract, unfortunately isn’t large enough to cover trading costs — like slippage and commissions.
We also notice that the average trade is significantly larger on the long side and a bit narrower on the short side, which makes sense if we look at the buy-and-hold performance of this instrument.
So, at this point, we understand that the strategy works overall, but it needs further filters in order to become truly tradable.
Improving the Strategy with a Weekly Filter
Now, there are several filters we could introduce.
We could use patterns, we could use conditions related to the months, or we could also use what’s called the “trading days of the week,” something that Larry Williams brought to light decades ago.
That means we could trade, for example, only long or only short on certain days of the week, since recurring trends are often present over the course of the week.
That’s why I’ve prepared a chart from the Bias Finder — a software that helps us analyze biases, or recurring trends.
What we’re looking at here is the intraweek bias. Basically, what does this tell us? By analyzing the blue line, which shows the average price excursion during the week from 2010 to September 2024, we can see how this instrument has behaved.
We notice that during Monday, Tuesday, Wednesday, and even Thursday sessions, it has generally trended upward.
However, if we analyze the Friday session, we notice that the price has statistically shown downward phases — especially if we focus on the cash session.
Additionally, if we look at the surrounding curves, which show the same bias over different periods — specifically from 2010 to 2013, from 2014 to 2017, from 2018 to 2021, and so on — we can see that this bearish trend on the last trading day of the week has appeared consistently in all these periods.
It’s pretty clear — all the curves displayed here have shown a decline.
So, how could we use this information in our strategy?
Since, from the performance report, we saw that the average trade on the short side is only $30, we could choose to limit trading activity to only the Friday session — at least on the short side — since that’s statistically the session with the highest occurrence of downward movements.
Alright, so now let’s test this new filter based on the analysis we just conducted. It’s a very simple condition to add.
Basically, I’m telling the strategy to operate only if this condition is met — meaning, if the day of the week is equal to 5, which in Easy Language corresponds to Friday.
Let’s compile the strategy and look at the new performance results. And here it is — we already have a much smoother equity line compared to before.
Results After Applying the Filter: Higher Average Trade
On the long side, of course, nothing has changed — it’s virtually the same. But on the short side, we see that trading activity has been reduced — fewer trades are placed — yet the equity curve grows more consistently.
Now we need to see the real test: did the average trade improve?
Yes, it did — as you can see, we’re now at around $95 per average trade, with $84 on the long side — where we didn’t apply any filters — and $155 on the short side, where we did.
So, the trading activity was indeed filtered.
I want to stress that this value is still not high enough to justify going live with the strategy, and of course, the higher it is, the better.
But we’ve seen that with a very simple idea and a fairly basic filter — based on the average behavior of this financial instrument — we’ve managed to improve the average trade on the short side from $30 to a solid $155.
What’s left now is to work on the long side so that the strategy can be ready for live trading.
We’ve seen that this is a relatively simple approach that works well on this instrument, both long and short, despite the Nasdaq’s overall bullish trend.
Ideas for Further Development and Final Thoughts
However, as mentioned before, this strategy isn’t ready for live trading just yet — we still need to reach a higher average trade.
How can we do that? We’ve seen one example using the trading day of the week, but there are other ways too.
For example, since our trading activity begins after 8:30 a.m. exchange time, but the future is open 23 hours a day, we could analyze what happens in the hours before that.
So, we could check how the strategy behaves if there was an uptrend or downtrend earlier, or whether there was an expansion or compression in volatility.
But for today, I’ll leave that task to you. Now it’s your turn — let us know how you would improve this strategy. And if topics like these interest you, you can find more useful info at the first link in the description.
See you in the next video!
We'll help you map out a plan to fix the problems in your trading and get you to the next level. Answer a few questions on our application and then choose a time that works for you.
BOOK YOUR FREE STRATEGY SESSION NOW >>Andrea Unger here and I help retail traders to improve their trading, scientifically. I went from being a cog in the machine in a multinational company to the only 4-Time World Trading Champion in a little more than 10 years.
I've been a professional trader since 2001 and in 2008 I became World Champion using just 4 automated trading systems.
In 2015 I founded Unger Academy, where I teach my method of developing effecting trading strategies: a scientific, replicable and universal method, based on numbers and statistics, not hunches, which led me and my students to become Champions again and again.
Now I'm here to help you learn how to develop your own strategies, autonomously. This channel will help you improve your trading, know the markets better, and apply the scientific method to financial markets.
Becoming a trader is harder than you think, but if you have passion, will, and sufficient capital, you'll learn how to code and develop effective strategies, manage risk, and diversify a portfolio of trading systems to greatly improve your chances of becoming successful.