OPEN-SOURCE SCRIPT

ORB + Expected Move + Trade Bias RWC

115
ORB + Expected Move + Trade Bias v3
Overview
A comprehensive 0DTE SPX options trading indicator designed to identify optimal credit spread and iron condor setups based on Opening Range Breakout (ORB) analysis, Expected Move calculations, VWAP dynamics, and multi-factor confidence scoring. The indicator provides specific strike suggestions, real-time position management signals, and exit warnings.
Who This Is For
This indicator is built for traders who sell 0DTE SPX credit spreads (put spreads, call spreads, or iron condors) and want a systematic, data-driven approach to:

Determine trade direction (bullish, bearish, or neutral)
Select appropriate strikes based on market conditions
Manage positions with clear exit signals


Core Components
1. Opening Range Breakout (ORB)
The ORB establishes the initial trading range after market open, serving as the foundation for trade bias determination.
Settings:

ORB Period: Choose 15, 30, 45, or 60 minutes

Shorter periods (15-30 min) = more signals, more noise
Longer periods (45-60 min) = fewer signals, more reliable ranges


ORB Breakout Buffer %: Percentage buffer beyond ORB high/low before confirming breakout (default 0.1%)
Colors: Customize ORB high (green), low (red), and fill colors

How It Works:

Tracks the high and low during the ORB period
After ORB completes, monitors for breakouts above/below with buffer
Counts consecutive bars above/below ORB for confirmation

2. Expected Move (EM)
Calculates the statistically expected daily range based on Average True Range (ATR).
Settings:

ATR Length: Lookback period for ATR calculation (default 14)
ATR Multiplier: Scale the expected move (default 1.0)
Colors: Customize expected move lines and fill

How It Works:

Pulls daily ATR from the previous session
Projects expected move boundaries from session open
Used for strike distance calculations and range containment analysis

3. VWAP Analysis
Volume Weighted Average Price with standard deviation bands provides trend confirmation and stretch detection.
Settings:

Show VWAP: Toggle VWAP line visibility
Show VWAP StdDev Bands: Toggle ±1 standard deviation bands
VWAP Band Multiplier: Adjust band width (default 1.0)
VWAP Slope Lookback: Bars to measure VWAP slope (default 10)

Key Metrics:

VWAP Slope: Normalized slope indicating trend strength

Strong Up (↑↑): > 0.5
Up (↑): 0.3 to 0.5
Flat (—): -0.3 to 0.3
Down (↓): -0.5 to -0.3
Strong Down (↓↓): < -0.5


Stretched Detection: Warns when price is >1.5 standard deviations from VWAP

4. Prior Day Levels (PDH/PDL)
Yesterday's high and low serve as key support/resistance levels where institutional orders often cluster.
Settings:

Show Prior Day High/Low: Toggle PDH/PDL lines
Show Prior Day Close: Optional PDC line
Colors: Customize PDH (teal), PDL (orange), PDC (gray)

Why It Matters:

Price above PDH = strong bullish continuation signal
Price below PDL = strong bearish continuation signal
Price between PDH/PDL = range-bound, favors iron condors
Strikes are adjusted to respect these levels as potential support/resistance


Trade Signal System
Signal Time
Settings:

Signal Time (ET): Choose when the indicator evaluates and locks in the trade signal

1100 = 8:00 AM PT / 11:00 AM ET
1115 = 8:15 AM PT / 11:15 AM ET (default)
1130 = 8:30 AM PT / 11:30 AM ET
1145 = 8:45 AM PT / 11:45 AM ET
1200 = 9:00 AM PT / 12:00 PM ET



Recommendation: Later signal times (8:30-9:00 AM PT) provide more data and reduce morning fakeout signals, but leave less time for theta decay.
Confidence Scoring (9 Factors)
The indicator calculates three scores: Iron Condor (IC), Bullish, and Bearish. The highest score determines the signal.
Factor 1: Price Position vs ORB (max 40 pts)

Inside ORB → +35-40 IC points
Above ORB (confirmed breakout) → +40 Bull points
Below ORB (confirmed breakout) → +40 Bear points

Factor 2: VWAP Slope (max 30 pts)

Flat slope → +25 IC points
Strong positive slope → +30 Bull points
Strong negative slope → +30 Bear points

Factor 3: Price vs VWAP Position (max 20 pts)

Above upper band → +20 Bull points
Below lower band → +20 Bear points
Near VWAP → +12 IC points

Factor 4: VWAP Consistency (max 15 pts)

70%+ bars above VWAP → +15 Bull points
70%+ bars below VWAP → +15 Bear points
Mixed → +10 IC points

Factor 5: Move from Open (max 20 pts)



30% of EM up → +20 Bull points




30% of EM down → +20 Bear points


<12% move either way → +15 IC points

Factor 6: Trend Structure (max 15 pts)

Higher highs + higher lows → +15 Bull points
Lower lows + lower highs → +15 Bear points
No clear structure → +8 IC points

Factor 7: Day Range Containment (max 15 pts)

Range <35% of EM → +15 IC points
Range <50% of EM → +8 IC points
Range >65% of EM → Points to directional score

Factor 8: Gap Behavior (max 12 pts)

Gap up, unfilled, above ORB → +12 Bull points
Gap down, unfilled, below ORB → +12 Bear points
Gap filled, inside ORB → +8 IC points

Factor 9: Prior Day High/Low (max 20 pts)

Above PDH → +20 Bull points
Below PDL → +20 Bear points
Between PDH/PDL → +15-20 IC points

Alignment Bonuses (max 25 pts)
Additional points when multiple factors align in the same direction.
Signal Types
SignalMeaningTradeIRON CONDORRange-bound conditionsSell both put and call credit spreadsPUT SPREADBullish conditionsSell put credit spread onlyCALL SPREADBearish conditionsSell call credit spread onlyNO TRADEConflicting signals or low confidenceStay out
Confidence Levels
ConfidenceColorStrike Mode75%+Green🍆 AGGRESSIVE (tighter strikes, more premium)60-75%Lime/Yellow🌶️ NORMAL (balanced strikes)45-60%Yellow/Orange🐢 CONSERVATIVE (wider strikes, safer)<45%Orange/RedNO TRADE triggered

Strike Suggestions
Base Calculation
For Iron Condors: Strikes are calculated from current price at signal time as the midpoint, ensuring symmetric risk on both sides.
For Directional Spreads: Strikes are calculated from session open, betting on continuation.
Put Strike = Midpoint - (Expected Move × Distance)
Call Strike = Midpoint + (Expected Move × Distance)
Distance Settings:

High Confidence (75%+): 0.60 EM (default) - Tighter strikes, more premium
Mid Confidence (60-75%): 0.70 EM (default) - Balanced
Low Confidence (<60%): 0.80 EM (default) - Wider strikes, safer

Skew Adjustments
When Auto-Adjust for Skew is enabled, strikes are asymmetrically adjusted based on:
VIX Level:

VIX > 20: Puts pushed wider (-0.05), Calls pulled tighter (+0.05)
VIX < 15: Opposite adjustment

2-Day Momentum:

Strong down move: Puts pushed wider
Strong up move: Calls pushed wider

Prior Day Levels:

Below PDL: Puts pushed wider (more downside protection)
Above PDH: Calls pushed wider (more upside protection)

PDH/PDL Strike Reference
If the calculated strike is too close to PDH or PDL, the indicator adjusts to place strikes 10 points beyond these key levels (maximum 20 point adjustment).

Exit Signal System
Three-Stage Warning System
Stage 1: EARLY ⚠️ (Yellow)
Trigger: Price moves against position with:

Below VWAP AND in lower fib zones (for put spreads/IC downside)
Above VWAP AND in upper fib zones (for call spreads/IC upside)

Action: Heightened awareness. Consider reducing position or tightening mental stops.
Note: Only fires once per direction per day to avoid alert fatigue.
Stage 2: CAUTION (Orange)
Trigger:

2+ consecutive bars beyond ORB
Price has traveled 25%+ of the distance to short strike

Action: Actively manage position. Prepare to exit.
Stage 3: EXIT (Red)
Trigger:

3+ consecutive bars beyond ORB (configurable)
Price has traveled 40%+ of the distance to short strike
VWAP slope confirms the move (if enabled)

Action: Close position immediately.
Exit Settings

Exit Confirmation Bars: Consecutive bars required for EXIT signal (default 3)
CAUTION Distance %: How far toward strike before CAUTION (default 25%)
EXIT Distance %: How far toward strike before EXIT (default 40%)
Require VWAP Confirmation: EXIT only fires if VWAP slope confirms direction


Fibonacci Retracement Levels
After signal fires, fib levels are drawn between key price points:
For Iron Condors:

0% = Put Strike
100% = Call Strike

For Put Spreads:

0% = Put Strike (danger zone)
100% = Day High at signal

For Call Spreads:

0% = Day Low at signal
100% = Call Strike (danger zone)

Fib Levels Shown:

0%, 23.6%, 38.2%, 50%, 61.8%, 78.6%, 100%

Fib Zone Tracking: The left table shows current fib zone, color-coded:

Red: Near strikes (danger)
Orange: Approaching strikes
Green: Safe middle zones


Information Tables
Left Table (Position Management)
RowDescriptionSIGNALCurrent trade signal with confidence colorConfConfidence percentageEXITCurrent exit status (HOLD/EARLY/CAUTION/EXIT)Fib ZoneCurrent price position in fib structurePDHPrior day high valuePDLPrior day low valuevs PDPosition relative to prior day rangeModeStrike mode (🍆/🌶️/🐢)PutSuggested short put strikeCallSuggested short call strikeCall Dist% distance traveled toward call strikePut Dist% distance traveled toward put strike
Right Table (Market Factors)
RowDescriptionStructureOverall market structure (BULLISH/BEARISH/RANGE/MIXED)PricePosition relative to ORBVWAPVWAP slope direction and strengthStretchedWarning if price extended from VWAPMoveCurrent move from open as % of EMEM UsedDay range as % of expected moveGapGap status (up/down, filled/unfilled)ReversalV-top or V-bottom detectionConflictAny conflicting signals detectedVIXCurrent VIX levelSkewMomentum-based skew direction

Alerts
The indicator includes pre-configured alerts:
AlertDescriptionEntry: Iron CondorIC signal firedEntry: Put SpreadBullish signal firedEntry: Call SpreadBearish signal firedHigh Confidence EntryAny signal with 75%+ confidenceNo TradeNO TRADE signal firedEARLY WARNINGEarly warning triggeredCAUTIONPosition under pressureEXIT NOWExit signal triggered

Recommended Settings
Conservative (New Traders)

ORB Period: 60 minutes
Signal Time: 1130 (8:30 AM PT)
Min Confidence: 50%
Strike Distances: 0.65 / 0.75 / 0.85

Balanced (Default)

ORB Period: 30-45 minutes
Signal Time: 1115 (8:15 AM PT)
Min Confidence: 45%
Strike Distances: 0.60 / 0.70 / 0.80

Aggressive (Experienced)

ORB Period: 30 minutes
Signal Time: 1100 (8:00 AM PT)
Min Confidence: 40%
Strike Distances: 0.55 / 0.65 / 0.75


Important Notes

This indicator does not guarantee profits. It provides a systematic framework for trade selection and management.
Paper trade first. Test the indicator on historical data and paper trade before using real capital.
Position sizing matters. Never risk more than you can afford to lose on any single trade.
Exits are suggestions. Use the exit signals as guidance, but always apply your own judgment.
Market conditions vary. The indicator performs best in normal volatility environments. Use extra caution during major news events, FOMC days, and earnings season.
SPX/SPY focused. While the indicator may work on other instruments, it was designed specifically for SPX 0DTE options trading.


Version History
v3.0

Added 45/60 minute ORB options
Added configurable signal time (8:00-9:00 AM PT)
Added stretched detection (VWAP distance warning)
Added Prior Day High/Low as scoring factor
Iron Condor strikes now centered on current price (symmetric risk)
Split table UI (left: position, right: factors)
PDH/PDL reference for strike adjustments


Credits
Developed for the 0DTE SPX options trading community. Inspired by SMB Capital's ORB methodology, VWAP analysis techniques, and real-world credit spread trading experience.

Disclaimer: This indicator is for educational and informational purposes only. It is not financial advice. Trading options involves substantial risk of loss and is not suitable for all investors. Past performance is not indicative of future results.

Pernyataan Penyangkalan

Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.