OPEN-SOURCE SCRIPT
ORB PRO by John K

ORB PRO identifies four price-action setups using the Opening Range, external swing liquidity, and an EMA. It includes configurable sessions, candle filters, alerts, and optional stop-loss and take-profit boxes.
The default Opening Range is 09:30–09:45, with signals enabled from 09:45–12:00, New York time. Both sessions are adjustable.
**Liquidity Sweeps — LQ BUY / SELL**
Price sweeps a confirmed swing low below the ORB or a swing high above it, then closes back inside the range with a bullish candle for buys or a bearish candle for sells.
By default, the sweep and confirmation must occur on separate candles. An optional filter restricts liquidity to swings confirmed before 09:45. Liquidity inside the ORB is excluded.
**ORB Rejections — ORB BUY / SELL**
Price tests the ORB low as support or the ORB high as resistance. The signal candle must close inside the range, match the trade direction, and have a body strictly larger than the previous candle.
Wicks through the boundary are allowed. A prior close through that boundary, or an external liquidity sweep on that side, disables its ORB rejection signals for the session.
**Breakout Retests — BO BUY / SELL**
After an ORB breakout, price retests the broken boundary. Confirmation can occur on a qualifying directional retest candle or immediately after an opposite-colored retest:
• Buy: red retest followed immediately by a larger green candle closing above ORB high.
• Sell: green retest followed immediately by a larger red candle closing below ORB low.
Optional close tolerance permits a small retest close inside the range, but the entry must still close outside the actual ORB. A deeper failed close locks both ordinary BO directions for the session.
**EMA Breakout Retests — EMA BO BUY / SELL**
Price breaks the ORB and EMA, then retests the EMA and confirms with a larger directional candle beyond both levels.
An optional filter requires the EMA to be outside the ORB when the range forms. A wrong-side EMA close before confirmation locks both EMA BO directions for the session.
**Filters and Visual Tools**
• Adjustable ORB retest, BO close, and EMA retest tolerances: 0–100 ticks.
• Optional minimum body-to-range filter to reduce doji-like signals.
• Optional red stop-loss and green take-profit boxes.
• Stops based on the signal candle, ATR, opposite ORB boundary, or confirmed swing.
• Targets include 1R, 2R, custom R, ORB boundaries where applicable, and ORB extensions.
• Approximate ORB volume profile with highlighted point of control.
• Individual and combined buy/sell alerts.
Signals confirm at candle close. This is an indicator, not an automated trading or backtesting strategy. SL/TP boxes are visual references, and signals do not guarantee profitable outcomes.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.