Skip to main content

Opening Range Breakout (ORB) Indicator for ThinkOrSwim (Free Download)

IndicatorFreeAdvanced36 min video91 lines of codeJun 12, 2022Updated Oct 21, 2026

Free opening range breakout indicator for ThinkOrSwim: it shades the 9:30 to 10:00 range and plots half-range and full-range projections after a breakout.

Opening Range Breakout on a ThinkOrSwim chart
On this page

Overview

In this tutorial I build an opening range breakout indicator for ThinkOrSwim from a blank study. It shades the opening range, 9:30 to 10:00 Eastern by default, carries its high and low forward as dashed lines for the next hour, and draws half-range and full-range projections only after price breaks out.

I added a few twists to the typical ORB indicator. The opening range and the trade entry window are inputs you change from the studies menu, and you pick whether a wick touch or a candle close counts as the breakout, which most ORB indicators I've seen don't account for. The video runs 36 minutes for traders who want to follow the thinkScript line by line, and the download has the finished study.

Key Takeaways

  • The opening range breakout indicator shades the high and low of the first 30 minutes of trading, 9:30 to 10:00 Eastern by default, in gray.
  • Breakouts count only inside a trade entry window, 10:00 to 11:00 Eastern by default, and the entryType input picks a wick touch or a candle close as the trigger.
  • After a bullish breakout the indicator plots a half-range projection (light green) and a full-range projection (green) above the range. After a bearish breakout it plots them below in light red and red.
  • A dashed gray mid-range line marks the half-range pullback level for the whole trade entry window, breakout or not.
  • All 4 times are inputs in Eastern time, so a 9:30 to 9:45 opening range needs no code changes.

What Is an Opening Range Breakout?

An opening range breakout is a setup where you wait for price to leave the range it set right after the market opened. The typical opening range is the first 30 minutes, 9:30 to 10:00 Eastern. During that window you track two numbers: the highest high and the lowest low.

The highest high becomes the opening range high and the lowest low becomes the opening range low. Those two horizontal lines are the levels you watch for price to break, one direction or the other. A move above the high is a bullish breakout and a move below the low is a bearish breakout. Our opening range breakout hub collects the rest of our ORB tools and research.

Intraday chart with the opening range shaded from 6:30 to 7:00 Pacific and yellow lines marking the ORB high and ORB low
The opening range on a chart set to Pacific time. The highest high and lowest low from 6:30 to 7:00 Pacific (9:30 to 10:00 Eastern) become the ORB high and the ORB low.

Wick Touch vs. Close Above

The entryType input is the ORB indicator's breakout definition: wickTouch counts a wick that pokes through the opening range level, and closeAbove waits for a candle that closes beyond it. Traders split into these two camps, and an indicator that only looks at closes can't show a wick-touch strategy accurately, so the choice is yours.

Entry typeBullish breakoutBearish breakout
wickTouch (default)The bar's high goes above the opening range high, and the previous bar's high was at or below itThe bar's low goes below the opening range low, and the previous bar's low was at or above it
closeAboveThe bar closes above the opening range high, and the previous close was at or below itThe bar closes below the opening range low, and the previous close was at or above it

The closeAbove setting means a close beyond either side of the range, as the table shows. With it, a 1-minute chart gives you the most accurate trigger. On a 5-minute chart, the indicator waits for the 5-minute candle's close.

What the ORB Indicator Plots

The ORB indicator has 9 plots plus a gray cloud, and most of them stay hidden until they matter. My rule was not to crowd the chart: if no breakout triggers, the projection lines never appear. The table lists each plot by the name you'll see in the study settings.

PlotWhat it marksWhen it showsDefault look
highCloud, lowCloudThe running opening range high and low, shaded betweenDuring the opening rangeGray cloud
tradeEntryHighExtension, tradeEntryLowExtensionThe final opening range high and low, carried forwardDuring the trade entry windowGray short dashes
midRangePlotThe midpoint of the range, the half-range pullback levelDuring the trade entry windowGray short dashes
halfwayUpsideProjectionPlotHigh plus half the rangeAfter a bullish breakout, until the window endsLight green line
fullUpsideProjectionPlotHigh plus the full rangeAfter a bullish breakout, until the window endsGreen line
halfwayDownsideProjectionPlotLow minus half the rangeAfter a bearish breakout, until the window endsLight red line
fullDownsideProjectionPlotLow minus the full rangeAfter a bearish breakout, until the window endsRed line

The gray cloud and dashes are subtle on purpose, so they blend into the chart. The projection lines are solid and brighter, so you can see at a glance that a breakout has triggered.

SPY chart from June 1, 2022 with a bearish opening range breakout circled and the half-range and full-range projection lines below the gray opening range
A bearish opening range breakout in SPY on June 1, 2022. After the break below the opening range low, the half-range and full-range projections appeared below the gray range.

The Inputs and Default Settings

Every ORB indicator setting is an input you change from the studies menu, and the cloud, lines and projections recalculate with no code edits. The 4 times are in Eastern, because that's the time zone thinkScript uses.

InputDefaultWhat it controls
entryTypewickTouchWhether a wick through the level or a candle close beyond it counts as the breakout
openingRangeStartTimeEST930First bar of the opening range
openingRangeEndTimeEST1000Last bar of the opening range (the bar at this time is included)
tradeEntryStartTimeEST1000Start of the window where breakouts count
tradeEntryEndTimeEST1100End of that window. The dashed lines and projections stop here

Times are written as hours and minutes with no colon, so 9:45 is 945. In the video I changed the opening range end to 945 and the gray box redrew itself as a 15-minute range. You could test any two times, such as 11:00 to 12:00 Eastern.

The trade entry window starts when the opening range ends. If you move one, move the other, or breakouts in the gap won't count. Move tradeEntryEndTimeEST later if you want breakouts after 11:00 to count. For more on time windows, see our tutorial on how to set custom hours in thinkScript.

How to Add the ORB Indicator to ThinkOrSwim

The ORB indicator download is a .zip with one study file, TI_OpeningRangeBreakoutSTUDY.ts. Installing it takes the same steps as any custom study.

  1. Download the indicator from this page and unzip it.
  2. Import the study into ThinkOrSwim. Our guide on how to import a study into ThinkOrSwim walks through each step.
  3. To build it yourself instead, click the Studies icon, choose Create, name the study (I called mine TI_OpeningRangeBreakout), and paste in the code from the Code tab.
  4. Add the study to an intraday chart. I built it on a 1-minute chart.
  5. Open the study settings to pick the entry type and times. If you change colors or line styles on the plots, click Save as default to keep them.

How the Code Works

The ORB indicator code follows the game plan I wrote before typing anything: define the opening range, define the trade entry window, build the entry type switch, then plot the levels. The 5 steps below walk through it, and each snippet comes from the download.

Step 1: Define the Opening Range

This step’s code is free with an account. Create one or sign in.

SecondsTillTime counts the seconds until a given time. Zero or less for the start time means the bar is at or past 9:30. Zero or more for the end time means it hasn't passed 10:00.

Both true means the bar is inside the opening range, so openingRange returns 1 from 9:30 through the 10:00 bar and 0 from 10:01 on. I included that last minute on purpose.

Step 2: Track the High and Low

This step’s code is free with an account. Create one or sign in.

Read it in three parts. On the first bar, where the seconds until the start time equal 0, take that bar's high. Inside the range, take any higher high. Otherwise carry the last value forward with [1].

Because the last branch carries the value, the high stays fixed once 10:00 passes, which is what the extension lines and breakout tests need. openingRangeLow works the same way with lows and a less-than test.

To check both, I printed each value in a temporary AddChartBubble, then commented the bubble out. If a value looks wrong in your own code, our guide on how to fix bugs in thinkScript code is a good next stop.

Step 3: Define the Trade Entry Window and Shade the Range

This step’s code is free with an account. Create one or sign in.

tradeEntryRange runs the same time test with the trade entry inputs, 10:00 to 11:00 by default.

This step’s code is free with an account. Create one or sign in.

The cloud plots return the high and low only while openingRange is true, and AddCloud shades between them in gray. double.nan means plot nothing, which keeps each line off the chart outside its window.

This step’s code is free with an account. Create one or sign in.

The extension plots carry the same high and low through the trade entry window as short dashes. On my chart, set to Pacific time, they stopped at the 8:00 mark, which is 11:00 Eastern.

Step 4: Build the Entry Type Switch

This step’s code is free with an account. Create one or sign in.

The two bare def lines declare the conditions without a value. On their own they'd throw errors, so the switch fills them in, and the rest of the code reads whichever version the user picked.

This step’s code is free with an account. Create one or sign in.

Each condition checks three things: the bar is inside the trade entry window, it crossed the level, and the previous bar hadn't. That last check makes it true only on the bar where the break happens.

This step’s code is free with an account. Create one or sign in.

The closeAbove case runs the same test on closes in place of highs and lows.

This step’s code is free with an account. Create one or sign in.

bullishORB turns the one-bar event into a state. It becomes 1 on the breakout bar, stays 1 for the rest of the window, and resets to 0 when the window closes.

Step 5: Calculate the Range and Plot the Levels

This step’s code is free with an account. Create one or sign in.

range is the width of the opening range, halfRange is half of it, and midRange adds that half to the low to get the midpoint. The mid-range line shows for the whole trade entry window.

This step’s code is free with an account. Create one or sign in.

The halfway upside projection adds half the range to the high, and the full projection adds the whole range. Both plot only while bullishORB is 1.

The downside pair subtracts from the low and checks bearishORB. The last line of the download is a test bubble, commented out. Remove the # to print the range on each bar after a breakout, green for bullish and red for bearish.

The June 7 Example From the Video

The June 7, 2022 session in SPY is the chart I used to test each piece of the code in the video. My chart was set to Pacific time, so the opening range ran from 6:30 to 7:00 on screen. These are the values the test bubbles printed:

  • The first candle at 9:30 set the opening range high at 408.52. The next candle didn't make a higher high, so the value held, and the candle after that moved it to 408.75.
  • The high kept updating until 10:00, when it stood at 410.54. After that it held at 410.54 through the trade entry window.
  • The first candle's low was 408.02. The next lower low moved it to 407.97, and later lows kept pulling it down.
  • When I printed the range, high minus low, the bubble showed 2.93, which puts the final low at 407.61.

Half of 2.93 is 1.465, so the half-range projection sat at 412.01 and the full-range projection at 413.47. The SPY backtester screenshot further down shows those two values as its light green and green price tags, and June 7 is the Tuesday on that chart.

With wick touch selected, the first green bubble appeared on the candle whose wick broke above the high. Price then pulled back to the mid-range line, broke above again, and this time closed above the high before moving higher. On June 7 price respected the full upside projection well. On days without a breakout, no projection lines plotted, which is the behavior I wanted.

How I Read the ORB Levels

The ORB indicator marks levels and shows when price crossed them. A wick through the high, a close beyond it and a pullback to the mid-range are each things to read with the rest of the chart, and the June 7 example had all three in one morning.

Before you take a breakout, decide where your stop goes and size the position so a stop-out costs a small, fixed share of your account. The mid-range line and the opposite side of the range are levels you can plan around, and the two projections give you reference points for targets.

An alert when price pulls back to the half-range level after a breakout is a good addition. I left it out of the video as a challenge, and our text message alert tutorial shows one alert setup. Breakouts that fall back into the range are the main risk with any ORB trade, and our article on how to identify and trade false breakouts covers them.

Backtesting the ORB Strategy (Volatility Box Members)

The ORB backtester is the members-only version of this indicator. It turns the same levels into trades and labels the results, so Volatility Box members can measure the P/L of the opening range breakout strategy on any market and timeframe, with wick touch or close entries. In the video I said the strategy tends to be about a 50% win rate in most places, with a few pockets where it works.

The June 2022 screenshots below cover the same 10 days on 1-minute charts, with wick touch entries, a full-range stop and a half-range target. SPY's P/L was negative over those 10 days and XLE's was positive: historical results from a short window. The ORB backtester page has the full walkthrough, and the backtesters page lists our other strategy testers.

ORB backtester labels on a 10-day 1-minute SPY chart ending June 10, 2022, with a negative floating P/L panel below
SPY, 10 days of 1-minute bars ending June 10, 2022: 10 total breakouts, long trades 3 winners and 5 losers (37.5%), short trades 3 winners and 2 losers (60%), average range $3.45.
ORB backtester labels on a 10-day 1-minute XLE chart ending June 10, 2022, with a positive floating P/L panel below
XLE over the same 10 days: 9 total breakouts, long trades 3 winners and 1 loser (75%), short trades 6 winners and 0 losers (100%), average range $1.75.

The ORB indicator on real charts

Drawn from real intraday bars with the code on this page, through the Oct 20, 2026 close. The indicator's defaults: the opening range runs from the 9:30 bar through the 10:00 bar (SecondsTillTime(1000) is still 0 on the 10:00 bar, so it counts), breakouts count from 10:00 to 11:00, and a breakout is a wick touch: the bar's high goes above the range high after the previous bar's high was at or below it. The lines stop at 11:00 on the chart; I drew them faintly to the close to show where price went.

SPY, Oct 19: a breakout that reached the full range

Opening range breakout indicator on a SPY 5-minute chart in ThinkOrSwim, October 19, 2026: a bullish break that reached the full-range projection
SPY on Oct 19, 2026: the gray box is the opening range; light green and green are the half and full-range projections.

SPY's opening range was $765.82 to $768.06, a $2.24 range. At 10:10 the high poked above $768.06, and price reached the full-range projection of $770.30 at 11:25. SPY closed the day at $766.54.

SPY, Oct 2: a breakout that faded

Opening range breakout indicator on a SPY 5-minute chart in ThinkOrSwim, October 2, 2026: a bullish break that never reached the half-range projection
SPY on Oct 2, 2026: the break above the range high, and no follow-through.

On Oct 2, SPY broke above its $772.09 range high at 10:20, never reached the half-range projection of $773.60, and closed at $769.65, back below the range high.

By the numbers

39%Days with a bullish break by 11:00
51%Bullish breaks that reached the half range by the close
21%Reached the full range
22%Bearish breaks that reached the full range below

5-minute bars for 44 stocks and ETFs, Apr 1 to Oct 20, 2026: 6,160 sessions, 2,411 bullish and 2,248 bearish breaks. 171 sessions broke both ways inside the hour. Reaching a projection is not the same as a winning trade: there is no stop in these counts.

Full thinkScript code

Opening Range Breakout.tsthinkScript · 91 lines
The full code is free with an account

Create a free account or sign in to copy all 91 lines and download the file.

Download

ORB Indicator

Download the Opening Range Breakout (ORB) Indicator for ThinkOrSwim. The download is a .zip with one study file, TI_OpeningRangeBreakoutSTUDY.ts: the finished indicator from the video, with the adjustable opening range and trade entry window, the wick touch or close above entry type, the mid-range pullback line, and the half-range and full-range projections. If you haven't added a custom study before, here's how to import an indicator into your ThinkOrSwim platform. Note: ORB Setups is a different web-based platform, dedicated for advanced Opening Range Breakout traders.

Download free

Video: Opening Range Breakout, built line by line

36 minutes on YouTube.

Watch on YouTube

Questions

What is an opening range breakout indicator?

An opening range breakout indicator marks the high and low of the first part of the trading day and shows when price breaks out of that range. Ours shades the 9:30 to 10:00 Eastern range in gray, extends the high and low as dashed lines until 11:00, and plots half-range and full-range projections after a bullish or bearish breakout.

How do I add the ORB indicator to ThinkOrSwim?

Download the .zip from this page and import the TI_OpeningRangeBreakoutSTUDY.ts file as a study. To build it yourself, click Studies, then Create, name the study and paste in the code from the Code tab. Add it to an intraday chart. I built it on a 1-minute chart, which gives the most accurate trigger for close entries.

How do I change the opening range to 15 minutes?

Open the study settings and change openingRangeEndTimeEST from 1000 to 945. The gray box redraws as a 9:30 to 9:45 range with no code changes. Set tradeEntryStartTimeEST to 945 as well, so breakouts right after the range ends still count. All the time inputs are in Eastern time.

What is the difference between wick touch and close above?

Wick touch counts a breakout as soon as a candle's high goes above the opening range high, or its low goes below the opening range low. Close above waits for a candle to close beyond the level: above the high for bullish, below the low for bearish. Wick touch is the default. Close above uses the candle close of your chart's timeframe.

What are the half range and full range projections?

They are projection levels measured from the opening range. The half range projection adds half the range's height to the high after a bullish breakout, or subtracts it from the low after a bearish one. The full range projection adds or subtracts the whole range. Both plot only after a breakout and only inside the trade entry window.

Why don't the projection lines show on my chart?

The projections plot only after a breakout inside the trade entry window, which runs 10:00 to 11:00 Eastern by default. If price stays inside the range, or breaks out after 11:00, you'll see the gray range and dashed lines with no projections. Check the entry type too: close above needs a candle close beyond the level, so it can trigger later than wick touch.

Why does the opening range start at 6:30 on my chart?

The inputs are in Eastern time, and your chart's time axis may be set to another zone. In the video my chart shows Pacific time, so the 9:30 to 10:00 Eastern range appears from 6:30 to 7:00 and the trade entry window ends at 8:00. Enter the inputs in Eastern time whatever your chart shows.

Can I backtest the opening range breakout strategy in ThinkOrSwim?

Yes. Volatility Box members get an ORB backtester built from this indicator. It turns breakouts into trades, lets you choose a half range or full range stop and target, and labels total breakouts, long and short winners and losers, and the average range. You can run it on any market and timeframe and compare wick touch with close entries.

Goes with

Get each new indicator by email

One email on Sundays with the week's new tool and its code. A free account also unlocks every .txt download.

No credit card. Unsubscribe anytime.