Opening Range Breakout Backtester for ThinkorSwim
Opening range breakout backtester for ThinkorSwim: trades each ORB with half or full-range stops and targets and labels winners, losers and win rate.
On this page
What it does
The opening range breakout backtester is the members-only strategy version of the ORB indicator I build in this 36-minute video. It uses the same opening range, trade entry window and entry types, and adds orders: an entry at the breakout, a stop and a target, each set at half the range or the full range.
Labels at the top of the chart count total breakouts, winners and losers on each side, and the average opening range, so you don't have to count trades by hand. I built it to find where the ORB strategy is working right now. The video builds the free indicator, and this page covers the backtester's rules, code and results.
Questions
What is an opening range breakout backtester?
An opening range breakout backtester turns ORB signals into simulated trades so you can see how the setup did on past data. Ours is a ThinkorSwim strategy that enters on a break of the opening range between 10:00 and 11:00 Eastern by default, exits at a half-range or full-range stop or target, and labels the winners, losers and win rate for each side.
How do I get the ORB backtester for ThinkorSwim?
The ORB backtester is included with Stock Volatility Box and Futures Volatility Box memberships. Members download a .zip from this page with one strategy file, TI_OpeningRangeBreakout_BacktesterSTRATEGY.ts, and import it into ThinkorSwim. The free ORB indicator, which draws the same levels without trades, has its own tutorial page.
What stop and target settings does the ORB backtester have?
Two of each. A halfRange stop exits at the mid-range line, and a fullRange stop exits at the opposite side of the opening range. A halfRange target exits at the breakout level plus or minus half the range, and a fullRange target at the level plus or minus the whole range. Both inputs default to halfRange.
What entry price does the ORB backtester use?
It depends on the entry type. With wick touch, a long fills at the opening range high and a short at the opening range low, on the bar where price trades through. With close above, the fill is the close of the candle that closed beyond the level, so on a 5-minute chart it waits for the 5-minute close.
What do the labels on the ORB backtester mean?
Total Breakouts counts sessions with a bullish breakout plus sessions with a bearish one. Long Winners and Losers count target hits and stop hits on long trades, with winners as a percent of both. Short Winners and Losers do the same for shorts. Average Range is the opening range width in dollars, summed and divided by Total Breakouts.
What win rate does the opening range breakout strategy have?
In the video I said the ORB strategy tends to be about a 50% win rate in most places, with a few pockets where it works, and I gave no trade count or period for that. In June 2022 screenshots covering 10 days of 1-minute bars, SPY long trades went 3 winners and 5 losers, while XLE short trades went 6 and 0.
Does the ORB backtester exit open trades at the close of each session?
No. The code has no time-based exit. New entries need the trade entry window, but an open trade stays open until it reaches its stop or target, even if that happens in a later session. Keep that in mind when you read the results on a chart with several days loaded.
Can I backtest a shorter opening range, like 9:30 to 9:45?
Yes. Set openingRangeEndTimeEST to 945 and tradeEntryStartTimeEST to 945, and the range, stops, targets and labels all recalculate from the 15-minute range. You can test any two times this way, such as 11:00 to 12:00 Eastern. Enter every time in Eastern, whatever time zone your chart shows.
Fair Value Gap
False Breakout Scanner
Heiken Ashi Trend



Stock Volatility Box
Futures Volatility Box
ORB Setups
Squeeze Setups
Opening Range Breakout (ORB) Indicator for ThinkOrSwim
How to Add Labels in ThinkOrSwim With AddLabel (6 Examples)
How to Build an Election Backtester in ThinkOrSwim
How to Build a Santa Claus Rally Backtester in ThinkOrSwim
TTM Squeeze Histogram Backtester for ThinkOrSwim
How to Build a SPY Meltdown Backtester in ThinkOrSwim