TRADING RANCH ORB 30
30-minute Opening Range Breakout indicator for TradingView

INSTALL ON A COMPUTER

1. Extract Trading-Ranch-ORB-30.zip.
2. Open Trading-Ranch-ORB-30-COPY-PASTE.txt and copy ALL the code.
3. Open TradingView and choose standard 5-minute candles.
4. Open Pine Editor > Create new > Indicator. Select all the starter code
   and paste the copied code. The first line must be //@version=6.
5. Save as Trading Ranch ORB 30, then click Add to chart.

Install just one code file: the .pine and COPY-PASTE.txt files are identical.
Use the 15-minute and 30-minute indicators individually. If you add both,
turn off Show status panel in one: their panels occupy the same corner.

SESSION AND DISPLAY

The fixed opening range is 09:30-10:00 America/New_York, Monday-Friday.
Daylight saving time adjusts automatically. Your chart's display timezone
can differ without changing the range's New York times.

The gold box marks the opening window. Green is the range high, red is the
range low, and the dashed gold line is the midpoint. Values build during
the window, then freeze when its final candle closes. Completed levels
extend to 16:00 ET by default.

Settings let you change the cutoff hour/minute, show 1-20 sessions (default
10), and toggle the box, midpoint, breakout markers and status panel.
The cutoff must be after 10:00 on the same New York day.
Use 5m; other standard minute intervals must divide 30 exactly and align
with 09:30 and 10:00. Synthetic charts are not supported.

EXACT BREAKOUT RULES

LONG: a confirmed candle closes strictly above the completed range high,
with the previous candle's close at or below that high.
SHORT: a confirmed candle closes strictly below the completed range low,
with the previous candle's close at or above that low.

The breakout candle must open at/after 10:00 and close at/before the cutoff.
On 5m, the earliest eligible breakout CLOSE is 10:05 ET. A wick alone
does not qualify. There is at most one LONG and one SHORT per session;
both directions may occur, and their limits reset each New York date.

The exact 09:30 bar and every complete opening-range bar are required.
Missing opening data, gaps or partial opening bars suppress the completed
range and signals. Load enough chart history if INCOMPLETE DATA appears.

ALERTS

The script supplies two alert conditions; it does not create alerts for you.
In TradingView, create an alert, select this indicator, choose Long breakout
or Short breakout, and select Once Per Bar Close. Create a second alert
if you want both directions. Turning Show breakout markers OFF hides labels
but does NOT disable alert conditions. Recreate existing TradingView alerts
after changing the script or its inputs so they use your updated settings.

PREVIEW

Trading-Ranch-ORB-30-Preview.png is a real TradingView replay screenshot of
September 4 NQ on 5m. Its time axis is Pacific: 06:30 Pacific = 09:30 ET.
That timezone note applies to the preview; the indicator always uses New York.

This is an indicator: it places no orders and provides no strategy backtest.

OFFICIAL TRADINGVIEW HELP

Create a script:
https://www.tradingview.com/support/solutions/43000711497-how-to-create-new-script/
Save and add an indicator:
https://www.tradingview.com/pine-script-docs/primer/first-indicator/
