Indicator · Pine Script v5 · On the chart

ORB Hooplah

by g-moe· code credited to goodgains

The ORB Hooplah indicator calculates the opening range high and low for a user-selected session such as 0930-1000 in New York time.

View on GitHub

GitHub stars3on the repository
Pine versionv5runs as is
Lines of code86
Settings3inputs
LicenceNone statedfile: MPL-2.0
Last update5 months ago27 May 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.

Source Code

86 lines of Pine Script v5 from Tradingview/orb-hooplah.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.

orb-hooplah.pine
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © goodgains


//@version=5
indicator("ORB_hooplah", overlay = true, max_labels_count = 500)

// @keywords: orb-hooplah, opening-range-breakout, or-high-or-low, opening-range-box, session-or-calculation, breakout-breakdown-alerts, call-long-labels, put-short-labels, colored-candles, or-fill-band, max-bars-since-break, est-session-orb, range-breakout-scan, barssince-filter, or-session-high-low, plotcandle-overlay, crossover-close-orh, crossunder-close-orl, intraday-orb, alert-on-breakout

// inputs
_orb_session = input.session('0930-1000', title = 'ORB Session')
_color_candles = input.bool(false, title = 'Color Candles')
_max_bars_break = input.int(1, title = 'Max Bars Since Break')


// calculate orb
or_session = time(timeframe.period, str.format('{0}:1234567', _orb_session), 'America/New_York')
var or_high = 0.0
var or_low = 0.0
var or_mid = 0.0
var days_open = 0.0

var bool orh_break = na
var bool orl_break = na
var bool breakout_scan = na
var bool breakdown_scan = na

if or_session
    if not or_session[1]
        or_low := low
        or_high := high
        days_open := open
    else 
        or_low := math.min(low, or_low)
        or_high := math.max(high, or_high)
else if dayofweek != dayofweek[1]
    or_low := na
    or_high := na
    days_open := na


orh_break := ta.crossover(close, or_high)
orl_break := ta.crossunder(close, or_low)

breakout_scan := ta.barssince(orh_break) < _max_bars_break
breakdown_scan := ta.barssince(orl_break) < _max_bars_break



// visualize
or_high_plot = plot(not or_session ? or_high : na, title='ORH', 
 color=color.new(color.white, 0), linewidth=2, style=plot.style_linebr, offset = -1)
or_low_plot = plot(not or_session ? or_low : na, title='ORL', 
 color=color.new(color.white, 0), linewidth=2, style=plot.style_linebr, offset = -1)

fill(or_high_plot, or_low_plot, title='OR Fill', color=color.new(color.silver, 90))


orb_color = not _color_candles ? na 
 : not or_session and na(or_high) ? color.gray
 : or_session ? color.white
 : close > or_high ? color.lime
 : close < or_low ? color.red 
 : color.yellow

barcolor(orb_color)
plotcandle(open, high, low, close, title = 'Custom Candles',
 color = orb_color, wickcolor = orb_color, bordercolor = orb_color)

// plotshape(breakout_scan, title = 'Breakout', location = location.belowbar,
//  color = color.green, text = 'CALL ' + str.tostring(close), textcolor = color.white, style = shape.labelup)

// plotshape(breakdown_scan, title = 'Breakdown', location = location.abovebar,
//  color = color.red, text = 'PUT ' + str.tostring(close), textcolor = color.white, style = shape.labelup)


// alerts
if breakout_scan
    alert("OR Breakout", alert.freq_once_per_bar_close)
    label.new(bar_index, low, text = 'CALL/LONG ' + str.tostring(close),
     color = color.green, textcolor = color.white, style = label.style_label_up)

if breakdown_scan
    alert("OR Breakdown", alert.freq_once_per_bar_close)
    label.new(bar_index, high, text = 'PUT/SHORT ' + str.tostring(close),
     color = color.red, textcolor = color.white, style = label.style_label_down)

Overview

ORB Hooplah plots the OR band on the price chart, fills the area between high and low, and colors candles accordingly based on whether they are inside the range or have broken out. It signals potential breakouts or breakdowns by plotting labels and sending alerts when price crosses the OR high or low within the specified number of bars since the break. The main settings allow customization of the session, candle coloring, and maximum bars to check for breakouts. It draws everything on the price chart with no separate pane.

Details

Published by

g-moe on GitHub

Code credit

goodgains, as written in the script's header

Draws

On the price chart

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
ORB Sessionsession0930-1000_orb_session
Color Candlesboolfalse_color_candles
Max Bars Since Breakint1_max_bars_break
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

220 stars

This indicator identifies High Of Low Price (HOLP) and Low Of High Price (LOHP) candlestick setups based on price extremes over a specified lookback period. A HOLP signal triggers when the current bar closes above the high of a recent session low, whereas a LO

Indicator v5 Candlestick patternsBreakout
Updated 1 year ago · None stated GitHub repository of Candlestick Patterns - HOLP-LOHP
56 stars

This overlay indicator highlights candles with a body smaller than 50% of their total range by coloring them white on the price chart. Simultaneously, it calculates and plots horizontal lines for open prices across multiple higher timeframes, such as daily, we

Indicator v6 Support & resistanceCandlestick patterns Repaints
Updated 2 months ago · None stated GitHub repository of Daily Weekly Monthly Yearly Opens

IB / ORB Live Stats

by TamaraKGreen
46 stars

This overlay indicator marks the New York initial balance and a configurable opening range on the price chart and reports live range statistics in two tables. It builds an IB box for a default 09:30–10:30 ET window, an ORB box from 09:30 for a set number of mi

Indicator v6 Sessions & timeBreakout
Updated 8 weeks ago · None stated GitHub repository of IB / ORB Live Stats

Zen-DAX GX

by Zen-Tim
29 stars

This indicator calculates and plots session ranges and key breakout levels for DAX futures directly on the price chart. It defines the overnight Globex session, the Frankfurt pre-market range, and the regular trading hours open using European timezone settings

Indicator v5 Sessions & timeBreakout
Updated 2 weeks ago · MIT GitHub repository of Zen-DAX GX
23 stars

Point-Clip Unified Indicator plots breakout and directional labels on the price chart. It scores volume spikes against a volume average, range or opening-range breaks, optional VWAP or session-anchored VWAP, fast and slow EMA trend, and a higher-timeframe EMA

Indicator v6 BreakoutVolume Repaints
Updated 4 weeks ago · Custom licence GitHub repository of Point-Clip Unified Indicator

ORB Pro - Research-Based ORB

by Mrshahidali420
16 stars

The ORB Pro indicator calculates and plots Opening Range Breakout levels, stop-loss and take-profit zones, signal labels, and an status dashboard on the price chart. Built on academic research, it evaluates trades using an opening-candle direction filter, open

Indicator v6 BreakoutSessions & time Repaints
Updated 3 months ago · None stated GitHub repository of ORB Pro - Research-Based ORB

More Breakout scripts

Related on ForexR

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers