Sigma Analytics ORB Shield

Sigma Analytics ORB Shield is a risk-first version of the 15-minute opening range breakout (ORB) for intraday SPY trading on a 5-minute chart. It draws the opening range and initial balance, checks every closed candle against a fixed set of entry, context and exit rules, and labels only the setups that pass all of them. A breakout that fails any rule is marked as rejected, with the failed rule shown on hover, instead of being drawn as a signal.
Why "Shield"
Most ORB tools answer one question: where is the range, and did price break it? On its own, a breakout fires on many days that do not follow through, and nothing on the chart says how much the trade risks or when it is over. The name refers to the protective layer this script adds on top of the range: a breakout has to pass every rule before it is labeled, and once labeled it is a complete trade with a defined exit. The shield has five parts, each with one job:
"Shield" describes these rule filters and risk limits. It does not prevent losses: a stop can be skipped in a gap or a fast market, and any trade can lose.
Credit and what is reused
This script is built on the open-source "[CT] ORB Suite" by ChaosTrader63, published under the Mozilla Public License 2.0. The Suite provides the opening range and initial balance boxes, midlines, breakout targets (TP1-TP4), breakout candle highlighting and its session alerts. Its MPL notice and credit are kept in the code. Changes to the Suite itself are limited to defaults (Chicago session, 1-hour initial balance, TP2-TP4 hidden, 1-pixel lines) and two fixes so that a new session and the session end are detected on regular-hours charts.
Everything in the "0", "1" and "PB" settings sections is new: the shield described above, a second entry model, two panels, manual daily levels, label spacing and the playbook alerts.
How it works
Ranges. Opening range (OR): the first 15 minutes of the regular session, 8:30-8:45 CT (9:30-9:45 ET). Initial balance (IB): the first hour. Session, time zone and durations are settings.
Context score (0-3). Checked on each closed 5-minute candle, for the side of the breakout:
Entry 1 - breakout close. Inside the entry window (default 8:45-9:30 CT), a 5-minute candle closes above the OR high or below the OR low, on the matching side of VWAP, with volume at or above its 20-bar average and a context score of 3 of 3. The script then prints LONG (CALL) below the candle or SHORT (PUT) above it, with the entry price, and draws the stop and Target 1 lines.
Entry 2 - breach and retreat (tracking only). Adapted from the opening-range breach-and-retreat idea taught by Raghee Horner. After price first trades beyond one edge of the range, a zone is drawn inside the range, measured back from the breached edge. If a later candle touches the 38% level without a close beyond the 62% level, Entry 2 is labeled in the direction of the breach. Close-stop: a 5-minute close beyond 62%. Hard stop: 86%. Target 1: the breached edge. Entry 2 labels carry "E2" and are meant for paper tracking alongside Entry 1.
Exits. Checked on closed candles in this order: stop, Target 1, close-stop, a 45-minute time stop, and flat by 2:55 PM CT. If the stop and the target are both touched in the same candle, the stop is counted first. The result is printed in R next to the exit.
Daily state. One trade per day (Entry 1 or Entry 2, whichever comes first). Everything resets at the next session open.
Panels
Daily levels (manual)
The first settings section holds levels you type in each morning: max pain, the largest call and put open-interest strikes, up to three dark pool levels, and a "Levels as of" date. The panel shows "UPDATE" when the date is not today. Pine Script cannot read an option chain, so these are entered by hand. They are drawn for context only and are not part of any entry rule.
How to use
Settings overview
0 - Daily levels. 1 - Trade plan panel. The original ORB Suite groups (Session, History, Initial Balance, Opening Range, Labels, Breakout Targets, Breakout, Breakout Candle Highlight, Alerts). PB 1 - Entries. PB 2 - Context and display. PB 3 - Entry labels. PB 4 - Suite label spacing (staggers OR, IB and TP labels that sit within $0.30 of each other). PB 7 - Session panel rows.
Limitations
This script is for educational purposes only. It is not financial advice and does not guarantee any result. Trading options involves substantial risk of loss.
Why "Shield"
Most ORB tools answer one question: where is the range, and did price break it? On its own, a breakout fires on many days that do not follow through, and nothing on the chart says how much the trade risks or when it is over. The name refers to the protective layer this script adds on top of the range: a breakout has to pass every rule before it is labeled, and once labeled it is a complete trade with a defined exit. The shield has five parts, each with one job:
- Filter - a context score (trend, previous close, VWAP), the VWAP side and a volume check keep only breakouts that agree with the day's direction and have participation. A failed breakout gets an x with the reason instead of a signal.
- Defined risk - every label comes with a stop at the OR midpoint and Target 1 at 1R, so the risk is known before the entry.
- Time limits - an 8:45-9:30 CT entry window, a 45-minute time stop and flat by 2:55 PM CT.
- Frequency limit - one trade per day; everything resets at the next session.
- Size limit - the Trade plan panel checks the dollar risk of one option contract against a cap you set (capital x risk %) before you enter.
"Shield" describes these rule filters and risk limits. It does not prevent losses: a stop can be skipped in a gap or a fast market, and any trade can lose.
Credit and what is reused
This script is built on the open-source "[CT] ORB Suite" by ChaosTrader63, published under the Mozilla Public License 2.0. The Suite provides the opening range and initial balance boxes, midlines, breakout targets (TP1-TP4), breakout candle highlighting and its session alerts. Its MPL notice and credit are kept in the code. Changes to the Suite itself are limited to defaults (Chicago session, 1-hour initial balance, TP2-TP4 hidden, 1-pixel lines) and two fixes so that a new session and the session end are detected on regular-hours charts.
Everything in the "0", "1" and "PB" settings sections is new: the shield described above, a second entry model, two panels, manual daily levels, label spacing and the playbook alerts.
How it works
Ranges. Opening range (OR): the first 15 minutes of the regular session, 8:30-8:45 CT (9:30-9:45 ET). Initial balance (IB): the first hour. Session, time zone and durations are settings.
Context score (0-3). Checked on each closed 5-minute candle, for the side of the breakout:
- Trend: close above a rising 20 EMA for a long, below a falling 20 EMA for a short.
- Previous session close (PSC): close above it for a long, below it for a short.
- Session VWAP: close above it for a long, below it for a short.
Entry 1 - breakout close. Inside the entry window (default 8:45-9:30 CT), a 5-minute candle closes above the OR high or below the OR low, on the matching side of VWAP, with volume at or above its 20-bar average and a context score of 3 of 3. The script then prints LONG (CALL) below the candle or SHORT (PUT) above it, with the entry price, and draws the stop and Target 1 lines.
- Stop: the OR midpoint, or a 5-minute close back inside the range.
- Target 1: entry plus or minus 1R, where 1R is the distance from entry to the midpoint.
- A breakout close that fails any check prints a small pink x instead. Hover it to see which check failed. Only the first rejection of the day is marked.
Entry 2 - breach and retreat (tracking only). Adapted from the opening-range breach-and-retreat idea taught by Raghee Horner. After price first trades beyond one edge of the range, a zone is drawn inside the range, measured back from the breached edge. If a later candle touches the 38% level without a close beyond the 62% level, Entry 2 is labeled in the direction of the breach. Close-stop: a 5-minute close beyond 62%. Hard stop: 86%. Target 1: the breached edge. Entry 2 labels carry "E2" and are meant for paper tracking alongside Entry 1.
Exits. Checked on closed candles in this order: stop, Target 1, close-stop, a 45-minute time stop, and flat by 2:55 PM CT. If the stop and the target are both touched in the same candle, the stop is counted first. The result is printed in R next to the exit.
Daily state. One trade per day (Entry 1 or Entry 2, whichever comes first). Everything resets at the next session open.
Panels
- Session panel (default top center): chart check (5-minute), OR high/low/mid/width, IB, PSC, context score for calls and puts, entry window status and the daily levels. A Compact mode keeps only the essentials.
- Trade plan panel (default bottom right, can be turned off): call and put plan (trigger, stop, Target 1), a sizing line (trading capital x risk % = 1R cap), the estimated dollar 1R for one contract at an assumed delta, the highest entry price that keeps 1R within the cap, trade today, open position and last exit.
Daily levels (manual)
The first settings section holds levels you type in each morning: max pain, the largest call and put open-interest strikes, up to three dark pool levels, and a "Levels as of" date. The panel shows "UPDATE" when the date is not today. Pine Script cannot read an option chain, so these are entered by hand. They are drawn for context only and are not part of any entry rule.
How to use
- Open SPY on a 5-minute chart with regular trading hours only and standard candles.
- Before the open, enter the daily levels (optional) and set the trading capital and risk % in "1 - Trade plan panel".
- Wait for the range to form at 8:45 CT and watch the context score on the Session panel.
- Treat a LONG (CALL) or SHORT (PUT) label as a candidate, not an order. Check your own trade plan, the option's real price, delta and spread, and the 1R line before acting.
- Alerts: use "Any alert() function call" for full messages with prices and times in CT, or the individual alert conditions (Entry 1 long/short, Entry 1 not qualified, Entry 2, Entry 2 failed, exits), which send JSON payloads suited to webhooks.
Settings overview
0 - Daily levels. 1 - Trade plan panel. The original ORB Suite groups (Session, History, Initial Balance, Opening Range, Labels, Breakout Targets, Breakout, Breakout Candle Highlight, Alerts). PB 1 - Entries. PB 2 - Context and display. PB 3 - Entry labels. PB 4 - Suite label spacing (staggers OR, IB and TP labels that sit within $0.30 of each other). PB 7 - Session panel rows.
Limitations
- Designed and tested on SPY, 5-minute, US regular hours. Other symbols and timeframes will plot, but the default rules were not built for them.
- Signals are evaluated on closed candles only, so a label appears after the candle closes and does not repaint. The previous session close is requested from the daily timeframe with a one-bar offset, so historical values do not look ahead.
- Stops are not guaranteed: gaps and fast markets can fill beyond the stop. Exits are simulated on 5-minute bars. Fills, slippage, option pricing and spreads are not modeled, and R results are measured on the underlying's price, not the option's.
- The trade plan's dollar figures use an assumed delta and are estimates. Real option quotes and greeks must come from your broker.
- Daily levels depend on what you enter and are not backtested.
This script is for educational purposes only. It is not financial advice and does not guarantee any result. Trading options involves substantial risk of loss.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.