Session Opening Range Breakout (ORBO) — Strategy by AIScripts
By AIScripts
Performance Metrics
- Author: AIScripts
- Symbol: NASDAQ:MSTR
- Timeframe: 3 minutes
- Net P&L: +3,139.51 USD (+3.13%)
- Win Rate: 46.5%
- Profit Factor: 1.414
- Max Drawdown: 1,942.72 USD (1.87%)
- Total Trades: 58
Description
This strategy automates a classic Opening Range Breakout (ORBO) approach: it builds a price range for the first minutes after the market opens, then looks for strong breakouts above or below that range to catch early directional moves.ConceptThe idea behind ORBO is simple:The first minutes after the session open are often highly informative.Price forms an “opening range” that acts as a mini support/resistance zone.A clean breakout beyond this zone can lead to high-momentum moves.This script turns that logic into a fully backtestable strategy in TradingView.How the strategy worksOpening Range SessionDefault session: 09:30–09:50 (exchange time)During this window, the script tracks:orHigh → highest high within the sessionorLow → lowest low within the sessionThis forms your Opening Range for the day.Breakout Logic (after the window ends)Once the defined session ends:Long Entry:If the close crosses above the Opening Range High (orHigh), → strategy.entry("OR Long", strategy.long) is triggered.Short Entry:If the close crosses below the Opening Range Low (orLow), → strategy.entry("OR Short", strategy.short) is triggered.Only one opening range per day is considered, which keeps the logic clean and easy to interpret.Daily ResetAt the start of a new trading day, the script resets:orHigh := naorLow := naA fresh Opening Range is then built using the next session’s 09:30–09:50 candles.This ensures entries are always based on today’s structure, not yesterday’s.Visuals & InputsInputs:Opening range session → default: "0930-0950"Show OR levels → toggle visibility of OR High / Low linesFill range body → optional shaded zone between OR High and OR LowChart visuals:A green line marks the Opening Range High.A red line marks the Opening Range Low.Optional yellow fill highlights the entire OR zone.Background shading during the session shows when the range is currently being built.These visuals make it easy to see:Where the OR sits relative to current priceHow clean / noisy the breakout wasHow often price respects or rejects the opening zoneBacktesting & OptimizationBecause this is written as a strategy():You can use TradingView’s Strategy Tester to view:Win rateNet profitDrawdownProfit factorEquity curveIdeas to experiment with:Change the session window (e.g., 09:15–09:45, 10:00–10:30)Apply to different:Markets: indices, FX, crypto, stocksTimeframes: 1m / 5m / 15mAdd your own:Stop Loss & Take Profit levelsTime filters (only trade certain days / times)Volatility filters (e.g., ATR, range size thresholds)Higher-timeframe trend filter (e.g., only take longs above 200 EMA)